diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index 54443f88b9c..6aa6a7641f7 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -530,15 +530,22 @@ namespace platf::dxgi { out_Y_or_YUV_viewports[0] = { offsetX, offsetY, out_width_f, out_height_f, 0.0f, 1.0f }; // Y plane out_Y_or_YUV_viewports[1] = out_Y_or_YUV_viewports[0]; // left half of U plane out_Y_or_YUV_viewports[1].TopLeftY += out_height; - out_Y_or_YUV_viewports[1].Width /= 2; + out_Y_or_YUV_viewports[1].Width = out_width / 2 - offsetX; out_Y_or_YUV_viewports[2] = out_Y_or_YUV_viewports[1]; // left half of V plane - out_Y_or_YUV_viewports[2].TopLeftX += out_Y_or_YUV_viewports[1].Width; + out_Y_or_YUV_viewports[2].TopLeftX += out_width / 2; - out_Y_or_YUV_viewports_for_clear = out_Y_or_YUV_viewports; // TODO: do this properly + out_Y_or_YUV_viewports_for_clear[0] = { 0, 0, (float) out_width, (float) out_height, 0.0f, 1.0f }; // Y plane + out_Y_or_YUV_viewports_for_clear[1] = out_Y_or_YUV_viewports_for_clear[0]; // left half of U plane + out_Y_or_YUV_viewports_for_clear[1].TopLeftY += out_height; + out_Y_or_YUV_viewports_for_clear[1].Width /= 2; + out_Y_or_YUV_viewports_for_clear[2] = out_Y_or_YUV_viewports_for_clear[1]; // left half of V plane + out_Y_or_YUV_viewports_for_clear[2].TopLeftX += out_Y_or_YUV_viewports_for_clear[1].Width; out_UV_viewport = out_Y_or_YUV_viewports[0]; - out_UV_viewport.Width /= 2; - out_UV_viewport_for_clear = out_UV_viewport; // TODO: do this properly + out_UV_viewport.TopLeftX = 0; + out_UV_viewport.Width = out_width_f - out_Y_or_YUV_viewports[1].Width; + + out_UV_viewport_for_clear = { 0, 0, (float) out_width / 2, (float) out_height, 0.0f, 1.0f }; } else { out_Y_or_YUV_viewports[0] = { offsetX, offsetY, out_width_f, out_height_f, 0.0f, 1.0f }; // Y plane