upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/shims/dxgi_com.cpp
diff options
context:
space:
mode:
authorExopus <230622659+Exopus-0x65f7ad0@users.noreply.github.com>2026-11-23 01:24:19 +0100
committerExopus <230622659+Exopus-0x65f7ad0@users.noreply.github.com>2026-11-23 01:24:19 +0100
commit429edff313e6b29de183929e520e014008d5cc91 (patch)
tree1b421d1c86ed0fc98adcde18a4790247e10ff79a /runtime/shims/dxgi_com.cpp
parentaa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff)
dxgi: Set/GetMatrixTransform answer DXGI_ERROR_INVALID_CALL, as on the host
IDXGISwapChain2::SetMatrixTransform/GetMatrixTransform stored and returned a matrix on every swapchain. A matrix transform belongs to composition swapchains (CreateSwapChainForComposition, E_NOTIMPL in the layer); host DXGI answers DXGI_ERROR_INVALID_CALL to both on an HWND swapchain, with a matrix and with null (Windows 11, RTX 5060 Ti, driver 621.14). Both now give that answer, and the stored matrix goes. dxgi_swapchain_test asserted the round-trip; it now checks the host's answer for the four calls (fails on main). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/shims/dxgi_com.cpp')
-rw-r--r--runtime/shims/dxgi_com.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/runtime/shims/dxgi_com.cpp b/runtime/shims/dxgi_com.cpp
index 734824e07..e29498cce 100644
--- a/runtime/shims/dxgi_com.cpp
+++ b/runtime/shims/dxgi_com.cpp
@@ -417,16 +417,11 @@ public:
417 return nullptr; 417 return nullptr;
418 return dup; 418 return dup;
419 } 419 }
420 HRESULT STDMETHODCALLTYPE SetMatrixTransform(const DXGI_MATRIX_3X2_F* matrix) override { 420 // A matrix transform belongs to composition swapchains only (CreateSwapChainForComposition, E_NOTIMPL here).
421 if (!matrix) return E_INVALIDARG; 421 // Host DXGI answers DXGI_ERROR_INVALID_CALL to both methods on an HWND swapchain, with a matrix or with null
422 matrix_transform_ = *matrix; 422 // (Windows 11, RTX 5060 Ti, driver 621.14); every swapchain the layer creates gets that answer.
423 return S_OK; 423 HRESULT STDMETHODCALLTYPE SetMatrixTransform(const DXGI_MATRIX_3X2_F*) override { return DXGI_ERROR_INVALID_CALL; }
424 } 424 HRESULT STDMETHODCALLTYPE GetMatrixTransform(DXGI_MATRIX_3X2_F*) override { return DXGI_ERROR_INVALID_CALL; }
425 HRESULT STDMETHODCALLTYPE GetMatrixTransform(DXGI_MATRIX_3X2_F* matrix) override {
426 if (!matrix) return E_INVALIDARG;
427 *matrix = matrix_transform_;
428 return S_OK;
429 }
430 425
431 // IDXGISwapChain3 426 // IDXGISwapChain3
432 UINT STDMETHODCALLTYPE GetCurrentBackBufferIndex() override { return swapchain_.current_back_buffer_index(); } 427 UINT STDMETHODCALLTYPE GetCurrentBackBufferIndex() override { return swapchain_.current_back_buffer_index(); }
@@ -495,7 +490,6 @@ private:
495 std::atomic<LONGLONG> last_present_qpc_{0}; 490 std::atomic<LONGLONG> last_present_qpc_{0};
496 std::atomic<UINT> max_frame_latency_{2}; 491 std::atomic<UINT> max_frame_latency_{2};
497 DXGI_RGBA background_color_{0, 0, 0, 0}; 492 DXGI_RGBA background_color_{0, 0, 0, 0};
498 DXGI_MATRIX_3X2_F matrix_transform_{1, 0, 0, 1, 0, 0};
499 DXGI_MODE_ROTATION rotation_ = DXGI_MODE_ROTATION_IDENTITY; 493 DXGI_MODE_ROTATION rotation_ = DXGI_MODE_ROTATION_IDENTITY;
500}; 494};
501 495