diff options
| author | bobcatchris <83428450+bobcatchris@users.noreply.github.com> | 2026-11-22 06:45:59 -0600 |
|---|---|---|
| committer | bobcatchris <83428450+bobcatchris@users.noreply.github.com> | 2026-11-22 06:45:59 -0600 |
| commit | cc467ab60b6745f7e5058204cffb264a7f0d85fa (patch) | |
| tree | 11f630dc0551e0525003afd25b569b6dd50f7a95 /runtime/shims/dxgi_com.cpp | |
| parent | 3746f917b56a39635066de7f0fd1361359205af8 (diff) | |
dxgi: round-trip the swapchain rotation
SetRotation returned S_OK without storing the mode and GetRotation always reported identity. Store it and return E_INVALIDARG for a null output, matching the other getters. Cover the default, a 90-degree round-trip and the null argument in dxgi_swapchain.
Verified on Windows 11 with an RX 7900 XTX: dxgi_swapchain_test passes. No game files.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Diffstat (limited to 'runtime/shims/dxgi_com.cpp')
| -rw-r--r-- | runtime/shims/dxgi_com.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/shims/dxgi_com.cpp b/runtime/shims/dxgi_com.cpp index b0301df74..df4d48ba2 100644 --- a/runtime/shims/dxgi_com.cpp +++ b/runtime/shims/dxgi_com.cpp | |||
| @@ -290,9 +290,13 @@ public: | |||
| 290 | *color = background_color_; | 290 | *color = background_color_; |
| 291 | return S_OK; | 291 | return S_OK; |
| 292 | } | 292 | } |
| 293 | HRESULT STDMETHODCALLTYPE SetRotation(DXGI_MODE_ROTATION) override { return S_OK; } | 293 | HRESULT STDMETHODCALLTYPE SetRotation(DXGI_MODE_ROTATION rotation) override { |
| 294 | HRESULT STDMETHODCALLTYPE GetRotation(DXGI_MODE_ROTATION* r) override { | 294 | rotation_ = rotation; |
| 295 | if (r) *r = DXGI_MODE_ROTATION_IDENTITY; | 295 | return S_OK; |
| 296 | } | ||
| 297 | HRESULT STDMETHODCALLTYPE GetRotation(DXGI_MODE_ROTATION* rotation) override { | ||
| 298 | if (!rotation) return E_INVALIDARG; | ||
| 299 | *rotation = rotation_; | ||
| 296 | return S_OK; | 300 | return S_OK; |
| 297 | } | 301 | } |
| 298 | 302 | ||
| @@ -400,6 +404,7 @@ private: | |||
| 400 | std::atomic<UINT> max_frame_latency_{2}; | 404 | std::atomic<UINT> max_frame_latency_{2}; |
| 401 | DXGI_RGBA background_color_{0, 0, 0, 0}; | 405 | DXGI_RGBA background_color_{0, 0, 0, 0}; |
| 402 | DXGI_MATRIX_3X2_F matrix_transform_{1, 0, 0, 1, 0, 0}; | 406 | DXGI_MATRIX_3X2_F matrix_transform_{1, 0, 0, 1, 0, 0}; |
| 407 | DXGI_MODE_ROTATION rotation_ = DXGI_MODE_ROTATION_IDENTITY; | ||
| 403 | }; | 408 | }; |
| 404 | 409 | ||
| 405 | struct ReservationState { | 410 | struct ReservationState { |