mirror of https://github.com/libsdl-org/SDL.git
We need to rebind D3D12 resources after updating them
Fixes https://github.com/libsdl-org/SDL/issues/12544
This commit is contained in:
parent
3538abfb82
commit
4ceb02434b
|
|
@ -1996,6 +1996,10 @@ static bool D3D12_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // SDL_HAVE_YUV
|
#endif // SDL_HAVE_YUV
|
||||||
|
if (textureData->mainTextureResourceView.ptr == rendererData->currentShaderResource.ptr) {
|
||||||
|
// We'll need to rebind this resource after updating it
|
||||||
|
rendererData->currentShaderResource.ptr = 0;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2022,6 +2026,10 @@ static bool D3D12_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||||
if (!D3D12_UpdateTextureInternal(rendererData, textureData->mainTextureV, 0, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Vplane, Vpitch, &textureData->mainResourceStateV)) {
|
if (!D3D12_UpdateTextureInternal(rendererData, textureData->mainTextureV, 0, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Vplane, Vpitch, &textureData->mainResourceStateV)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (textureData->mainTextureResourceView.ptr == rendererData->currentShaderResource.ptr) {
|
||||||
|
// We'll need to rebind this resource after updating it
|
||||||
|
rendererData->currentShaderResource.ptr = 0;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2040,10 +2048,13 @@ static bool D3D12_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||||
if (!D3D12_UpdateTextureInternal(rendererData, textureData->mainTexture, 0, rect->x, rect->y, rect->w, rect->h, Yplane, Ypitch, &textureData->mainResourceState)) {
|
if (!D3D12_UpdateTextureInternal(rendererData, textureData->mainTexture, 0, rect->x, rect->y, rect->w, rect->h, Yplane, Ypitch, &textureData->mainResourceState)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!D3D12_UpdateTextureInternal(rendererData, textureData->mainTexture, 1, rect->x, rect->y, rect->w, rect->h, UVplane, UVpitch, &textureData->mainResourceState)) {
|
if (!D3D12_UpdateTextureInternal(rendererData, textureData->mainTexture, 1, rect->x, rect->y, rect->w, rect->h, UVplane, UVpitch, &textureData->mainResourceState)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (textureData->mainTextureResourceView.ptr == rendererData->currentShaderResource.ptr) {
|
||||||
|
// We'll need to rebind this resource after updating it
|
||||||
|
rendererData->currentShaderResource.ptr = 0;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue