Fixed resource leak and crash at exit in the D3D11 renderer

Also, for some reason ID3D11DeviceContext_OMGetRenderTargets() was failing in the second read pixels call in the "testautomation --filter render_testViewport" test.

We already know the target view, so just use that.
main
Sam Lantinga 2023-07-03 17:39:29 -07:00
parent 90262f274a
commit 619f65af0c
1 changed files with 1 additions and 1 deletions

View File

@ -2137,7 +2137,7 @@ static int D3D11_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect,
D3D11_BOX srcBox;
D3D11_MAPPED_SUBRESOURCE textureMemory;
ID3D11DeviceContext_OMGetRenderTargets(data->d3dContext, 1, &renderTargetView, NULL);
renderTargetView = D3D11_GetCurrentRenderTargetView(renderer);
if (renderTargetView == NULL) {
SDL_SetError("%s, ID3D11DeviceContext::OMGetRenderTargets failed", __FUNCTION__);
goto done;