diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index 83859334a..f04a50a6d 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -712,6 +712,7 @@ D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) texturedata->texture.dirty = SDL_TRUE; if (data->drawstate.texture == texture) { data->drawstate.texture = NULL; + data->drawstate.shader = NULL; IDirect3DDevice9_SetPixelShader(data->device, NULL); IDirect3DDevice9_SetTexture(data->device, 0, NULL); if (texturedata->yuv) { @@ -1531,6 +1532,7 @@ D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (renderdata->drawstate.texture == texture) { renderdata->drawstate.texture = NULL; + renderdata->drawstate.shader = NULL; IDirect3DDevice9_SetPixelShader(renderdata->device, NULL); IDirect3DDevice9_SetTexture(renderdata->device, 0, NULL); if (data->yuv) {