direct3d: Fix dirty textures failing to update
authorCameron Gutman <aicommander@gmail.com>
Thu, 20 Jun 2019 19:51:00 -0700
changeset 1289889b3e1e9839c
parent 12897 25998acc4810
child 12899 11cb5d784a3a
direct3d: Fix dirty textures failing to update

Even if the texture itself has not changed since last time, the data may have
so we must call UpdateDirtyTexture() to handle that possibility.
src/render/direct3d/SDL_render_d3d.c
     1.1 --- a/src/render/direct3d/SDL_render_d3d.c	Wed Jun 19 17:11:20 2019 -0700
     1.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Thu Jun 20 19:51:00 2019 -0700
     1.3 @@ -1127,6 +1127,13 @@
     1.4          }
     1.5  
     1.6          data->drawstate.texture = texture;
     1.7 +    } else if (texture) {
     1.8 +        D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata;
     1.9 +        UpdateDirtyTexture(data->device, &texturedata->texture);
    1.10 +        if (texturedata->yuv) {
    1.11 +            UpdateDirtyTexture(data->device, &texturedata->utexture);
    1.12 +            UpdateDirtyTexture(data->device, &texturedata->vtexture);
    1.13 +        }
    1.14      }
    1.15  
    1.16      if (blend != data->drawstate.blend) {