Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue #16776 #16778

Merged
merged 4 commits into from
Jul 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions gfx/drivers/d3d11.c
Original file line number Diff line number Diff line change
Expand Up @@ -3690,15 +3690,16 @@ static bool d3d11_gfx_read_viewport(void* data, uint8_t* buffer, bool is_idle)
/* Assuming format is DXGI_FORMAT_R8G8B8A8_UNORM */
if (StagingDesc.Format == DXGI_FORMAT_R8G8B8A8_UNORM)
{
BackBufferData += Map.RowPitch * d3d11->vp.y;
for (y = 0; y < d3d11->vp.height; y++, BackBufferData += Map.RowPitch)
{
bufferRow = buffer + 3 * (d3d11->vp.height - y - 1) * d3d11->vp.width;

for (x = 0; x < d3d11->vp.width; x++)
{
bufferRow[3 * x + 2] = BackBufferData[4 * x + 0];
bufferRow[3 * x + 1] = BackBufferData[4 * x + 1];
bufferRow[3 * x + 0] = BackBufferData[4 * x + 2];
bufferRow[3 * x + 2] = BackBufferData[4 * (x + d3d11->vp.x) + 0];
bufferRow[3 * x + 1] = BackBufferData[4 * (x + d3d11->vp.x) + 1];
bufferRow[3 * x + 0] = BackBufferData[4 * (x + d3d11->vp.x) + 2];
}
}
ret = true;
Expand All @@ -3713,7 +3714,9 @@ static bool d3d11_gfx_read_viewport(void* data, uint8_t* buffer, bool is_idle)

/* Release the backbuffer staging. */
BackBufferStaging->lpVtbl->Release(BackBufferStaging);
BackBufferResource->lpVtbl->Release(BackBufferResource);
BackBufferStagingTexture->lpVtbl->Release(BackBufferStagingTexture);
BackBuffer->lpVtbl->Release(BackBuffer);

return ret;
}
Expand Down
Loading