Remove destroyed sampler states from the current samplers list
parent
d56432304e
commit
12f0877ebc
|
@ -1641,6 +1641,15 @@ void zstencil_destroy(zstencil_t zstencil)
|
|||
|
||||
void samplerstate_destroy(samplerstate_t samplerstate)
|
||||
{
|
||||
if (!samplerstate)
|
||||
return;
|
||||
|
||||
if (samplerstate->device)
|
||||
for (int i = 0; i < GS_MAX_TEXTURES; i++)
|
||||
if (samplerstate->device->curSamplers[i] ==
|
||||
samplerstate)
|
||||
samplerstate->device->curSamplers[i] = nullptr;
|
||||
|
||||
delete samplerstate;
|
||||
}
|
||||
|
||||
|
|
|
@ -1304,5 +1304,14 @@ enum gs_color_format volumetexture_getcolorformat(texture_t voltex)
|
|||
|
||||
void samplerstate_destroy(samplerstate_t samplerstate)
|
||||
{
|
||||
if (!samplerstate)
|
||||
return;
|
||||
|
||||
if (samplerstate->device)
|
||||
for (int i = 0; i < GS_MAX_TEXTURES; i++)
|
||||
if (samplerstate->device->cur_samplers[i] ==
|
||||
samplerstate)
|
||||
samplerstate->device->cur_samplers[i] = NULL;
|
||||
|
||||
samplerstate_release(samplerstate);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue