Commit 57a5c45372ba05f88cfdd5f01cea1884c835add0

Sylvain Becker 2021-01-05T22:06:51

Fix D3D11 UpdateTextureNV in non fullscreen (bug #5430)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c
index f3c2d42..7fad944 100644
--- a/src/render/direct3d11/SDL_render_d3d11.c
+++ b/src/render/direct3d11/SDL_render_d3d11.c
@@ -1422,7 +1422,7 @@ D3D11_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture,
         return -1;
     }
 
-    if (D3D11_UpdateTextureInternal(rendererData, textureData->mainTextureNV, SDL_BYTESPERPIXEL(texture->format), rect->x, rect->y, rect->w, rect->h / 2, UVplane, UVpitch) < 0) {
+    if (D3D11_UpdateTextureInternal(rendererData, textureData->mainTextureNV, SDL_BYTESPERPIXEL(texture->format), rect->x / 2, rect->y / 2, rect->w, rect->h / 2, UVplane, UVpitch) < 0) {
         return -1;
     }
     return 0;