Sfoglia il codice sorgente

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.
Cameron Gutman 6 anni fa
parent
commit
e681623cb2
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 7 0
      src/render/direct3d/SDL_render_d3d.c

+ 7 - 0
src/render/direct3d/SDL_render_d3d.c

@@ -1127,6 +1127,13 @@ SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd)
         }
 
         data->drawstate.texture = texture;
+    } else if (texture) {
+        D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata;
+        UpdateDirtyTexture(data->device, &texturedata->texture);
+        if (texturedata->yuv) {
+            UpdateDirtyTexture(data->device, &texturedata->utexture);
+            UpdateDirtyTexture(data->device, &texturedata->vtexture);
+        }
     }
 
     if (blend != data->drawstate.blend) {