Fixed bug 4991 - Pixel shader problem when recreating a texture for direct3d renderer
authorSam Lantinga <slouken@libsdl.org>
Sun, 08 Mar 2020 19:23:21 -0700
changeset 13598663f2daa3e4f
parent 13597 178f27cd89a9
child 13599 5cfc87d218e1
Fixed bug 4991 - Pixel shader problem when recreating a texture for direct3d renderer


cmediaplayer

Hi, i already mentioned in the SDL discourse a bug that recreating of a texture occours pixel shader problem on direct3d renderer. There is no problem for direct3d11. You can see the issue by using my app named C Media Player which is available for Windows for free using my web site www.cmediaplayer.com. Just follow the steps:

*Open a media file
*When playing the file change the scale quality under the video menu.
*You will see the problem.
src/render/direct3d/SDL_render_d3d.c
     1.1 --- a/src/render/direct3d/SDL_render_d3d.c	Sun Mar 08 18:56:07 2020 -0700
     1.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Sun Mar 08 19:23:21 2020 -0700
     1.3 @@ -712,6 +712,7 @@
     1.4          texturedata->texture.dirty = SDL_TRUE;
     1.5          if (data->drawstate.texture == texture) {
     1.6              data->drawstate.texture = NULL;
     1.7 +            data->drawstate.shader = NULL;
     1.8              IDirect3DDevice9_SetPixelShader(data->device, NULL);
     1.9              IDirect3DDevice9_SetTexture(data->device, 0, NULL);
    1.10              if (texturedata->yuv) {
    1.11 @@ -1531,6 +1532,7 @@
    1.12  
    1.13      if (renderdata->drawstate.texture == texture) {
    1.14          renderdata->drawstate.texture = NULL;
    1.15 +        renderdata->drawstate.shader = NULL;
    1.16          IDirect3DDevice9_SetPixelShader(renderdata->device, NULL);
    1.17          IDirect3DDevice9_SetTexture(renderdata->device, 0, NULL);
    1.18          if (data->yuv) {