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:
authorkapitche <kapitche@users.noreply.github.com>2026-11-22 14:58:17 -0500
committerkapitche <kapitche@users.noreply.github.com>2026-11-22 19:42:00 -0500
commit5b3eb785cbfaffab362dc7fdd06091a34b4cbddf (patch)
treeecd4836bfd7db2d08dce8162f8db0de70b936683 /runtime/shims/dxgi_com.cpp
parent03b09a086592a197db64d91655c6e65c30764d96 (diff)
DXGI: RegisterStereoStatusWindow/Event return S_OK with a cookie
Both returned E_NOTIMPL, which Microsoft documents only for the Windows 7 Platform Update. They now return S_OK with a unique cookie for UnregisterStereoStatus; stereo is never enabled so nothing is notified. Test: dxgi_swapchain.
Diffstat (limited to 'runtime/shims/dxgi_com.cpp')
-rw-r--r--runtime/shims/dxgi_com.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/runtime/shims/dxgi_com.cpp b/runtime/shims/dxgi_com.cpp
index 734824e07..07abe5f76 100644
--- a/runtime/shims/dxgi_com.cpp
+++ b/runtime/shims/dxgi_com.cpp
@@ -925,8 +925,19 @@ public:
925 return CreateSwapChainForHwnd(device, hwnd, desc, nullptr, restrict_to_output, out); 925 return CreateSwapChainForHwnd(device, hwnd, desc, nullptr, restrict_to_output, out);
926 } 926 }
927 HRESULT STDMETHODCALLTYPE GetSharedResourceAdapterLuid(HANDLE, LUID*) override { return E_NOTIMPL; } 927 HRESULT STDMETHODCALLTYPE GetSharedResourceAdapterLuid(HANDLE, LUID*) override { return E_NOTIMPL; }
928 HRESULT STDMETHODCALLTYPE RegisterStereoStatusWindow(HWND, UINT, DWORD*) override { return E_NOTIMPL; } 928 // Microsoft documents S_OK with a cookie for UnregisterStereoStatus (E_NOTIMPL is only the answer of the
929 HRESULT STDMETHODCALLTYPE RegisterStereoStatusEvent(HANDLE, DWORD*) override { return E_NOTIMPL; } 929 // Windows 7 Platform Update). Stereo is never enabled here, so the window or event is never notified.
930 HRESULT STDMETHODCALLTYPE RegisterStereoStatusWindow(HWND hwnd, UINT msg, DWORD* cookie) override {
931 (void)msg;
932 if (!hwnd || !cookie) return DXGI_ERROR_INVALID_CALL;
933 *cookie = next_stereo_cookie_.fetch_add(1, std::memory_order_relaxed);
934 return S_OK;
935 }
936 HRESULT STDMETHODCALLTYPE RegisterStereoStatusEvent(HANDLE event, DWORD* cookie) override {
937 if (!event || !cookie) return DXGI_ERROR_INVALID_CALL;
938 *cookie = next_stereo_cookie_.fetch_add(1, std::memory_order_relaxed);
939 return S_OK;
940 }
930 void STDMETHODCALLTYPE UnregisterStereoStatus(DWORD) override {} 941 void STDMETHODCALLTYPE UnregisterStereoStatus(DWORD) override {}
931 HRESULT STDMETHODCALLTYPE RegisterOcclusionStatusWindow(HWND hwnd, UINT msg, DWORD* cookie) override { 942 HRESULT STDMETHODCALLTYPE RegisterOcclusionStatusWindow(HWND hwnd, UINT msg, DWORD* cookie) override {
932 (void)msg; 943 (void)msg;
@@ -1061,6 +1072,7 @@ private:
1061 std::mutex adapters_changed_mutex_; 1072 std::mutex adapters_changed_mutex_;
1062 std::map<DWORD, HANDLE> adapters_changed_events_; 1073 std::map<DWORD, HANDLE> adapters_changed_events_;
1063 DWORD next_adapters_changed_cookie_ = 1; 1074 DWORD next_adapters_changed_cookie_ = 1;
1075 std::atomic<DWORD> next_stereo_cookie_{1};
1064}; 1076};
1065 1077
1066} // namespace 1078} // namespace