mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-09 22:45:39 +00:00
Make sure the render target isn't bound as a resource
Fixes https://github.com/libsdl-org/SDL/issues/3380 (cherry picked from commit a73132177d3311e70196f8de4e8a2e3b0b70cbcf)
This commit is contained in:
parent
f7ab765b84
commit
109bb2f17e
|
@ -1842,6 +1842,19 @@ static int D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c
|
||||||
ID3D11BlendState *blendState = NULL;
|
ID3D11BlendState *blendState = NULL;
|
||||||
SDL_bool updateSubresource = SDL_FALSE;
|
SDL_bool updateSubresource = SDL_FALSE;
|
||||||
|
|
||||||
|
if (numShaderResources > 0) {
|
||||||
|
shaderResource = shaderResources[0];
|
||||||
|
} else {
|
||||||
|
shaderResource = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make sure the render target isn't bound to a shader */
|
||||||
|
if (shaderResource != rendererData->currentShaderResource) {
|
||||||
|
ID3D11ShaderResourceView *pNullResource = NULL;
|
||||||
|
ID3D11DeviceContext_PSSetShaderResources(rendererData->d3dContext, 0, 1, &pNullResource);
|
||||||
|
rendererData->currentShaderResource = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (renderTargetView != rendererData->currentRenderTargetView) {
|
if (renderTargetView != rendererData->currentRenderTargetView) {
|
||||||
ID3D11DeviceContext_OMSetRenderTargets(rendererData->d3dContext,
|
ID3D11DeviceContext_OMSetRenderTargets(rendererData->d3dContext,
|
||||||
1,
|
1,
|
||||||
|
@ -1905,11 +1918,6 @@ static int D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c
|
||||||
ID3D11DeviceContext_PSSetShader(rendererData->d3dContext, shader, NULL, 0);
|
ID3D11DeviceContext_PSSetShader(rendererData->d3dContext, shader, NULL, 0);
|
||||||
rendererData->currentShader = shader;
|
rendererData->currentShader = shader;
|
||||||
}
|
}
|
||||||
if (numShaderResources > 0) {
|
|
||||||
shaderResource = shaderResources[0];
|
|
||||||
} else {
|
|
||||||
shaderResource = NULL;
|
|
||||||
}
|
|
||||||
if (shaderResource != rendererData->currentShaderResource) {
|
if (shaderResource != rendererData->currentShaderResource) {
|
||||||
ID3D11DeviceContext_PSSetShaderResources(rendererData->d3dContext, 0, numShaderResources, shaderResources);
|
ID3D11DeviceContext_PSSetShaderResources(rendererData->d3dContext, 0, numShaderResources, shaderResources);
|
||||||
rendererData->currentShaderResource = shaderResource;
|
rendererData->currentShaderResource = shaderResource;
|
||||||
|
|
Loading…
Reference in a new issue