Skip to content

Commit

Permalink
Fixed bug 4991 - Pixel shader problem when recreating a texture for d…
Browse files Browse the repository at this point in the history
…irect3d 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.
  • Loading branch information
slouken committed Mar 9, 2020
1 parent 367a356 commit c8c05a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/render/direct3d/SDL_render_d3d.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c8c05a9

Please sign in to comment.