diff options
| author | kingzzim7-create <275977600+kingzzim7-create@users.noreply.github.com> | 2026-11-23 08:42:50 +0500 |
|---|---|---|
| committer | kingzzim7-create <275977600+kingzzim7-create@users.noreply.github.com> | 2026-11-23 08:42:50 +0500 |
| commit | 0eb3a7698cccdbb5bbad1247b4e527435e942a9b (patch) | |
| tree | 9e00897740a996a02622e7aa155d7c9af55800a3 /runtime/shims/d3d12_xs.cpp | |
| parent | d0835dd9f9ec0a88faee510126436f2427854c2e (diff) | |
d3d12_xs: print D3D12XboxCreateDevice's parameter words with --trace-d3d12 too (RT-310)
Diffstat (limited to 'runtime/shims/d3d12_xs.cpp')
| -rw-r--r-- | runtime/shims/d3d12_xs.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/runtime/shims/d3d12_xs.cpp b/runtime/shims/d3d12_xs.cpp index 85997fce7..89eb8efee 100644 --- a/runtime/shims/d3d12_xs.cpp +++ b/runtime/shims/d3d12_xs.cpp | |||
| @@ -129,24 +129,25 @@ HRESULT WINAPI D3D12XboxCreateDevice(IUnknown* adapter, const void* params, cons | |||
| 129 | if (!riid) return result(method, E_POINTER); | 129 | if (!riid) return result(method, E_POINTER); |
| 130 | 130 | ||
| 131 | const bool tracing = rt::d3d12_trace::enabled(); | 131 | const bool tracing = rt::d3d12_trace::enabled(); |
| 132 | if (!tracing) { | 132 | if (!tracing) |
| 133 | std::fprintf(stderr, "[rt] d3d12_xs: D3D12XboxCreateDevice adapter=%p params=%p riid=%08lx-%04x-%04x\n", | 133 | std::fprintf(stderr, "[rt] d3d12_xs: D3D12XboxCreateDevice adapter=%p params=%p riid=%08lx-%04x-%04x\n", |
| 134 | adapter, params, static_cast<unsigned long>(riid->Data1), riid->Data2, riid->Data3); | 134 | adapter, params, static_cast<unsigned long>(riid->Data1), riid->Data2, riid->Data3); |
| 135 | if (params) { | 135 | // The 24 words are the title's device parameters (docs/boot.md, question 1). Unlike the pointers above they are the |
| 136 | const uint32_t* words = static_cast<const uint32_t*>(params); | 136 | // same on every run, so they are printed with --trace-d3d12 as well, and one traced run shows them. |
| 137 | char line[24 * 11 + 1]; | 137 | if (params) { |
| 138 | line[0] = '\0'; | 138 | const uint32_t* words = static_cast<const uint32_t*>(params); |
| 139 | size_t used = 0; | 139 | char line[24 * 11 + 1]; |
| 140 | for (int i = 0; i < 24 && used < sizeof(line); ++i) { | 140 | line[0] = '\0'; |
| 141 | int n = std::snprintf(line + used, sizeof(line) - used, "%s%08x", i ? " " : "", | 141 | size_t used = 0; |
| 142 | static_cast<unsigned>(words[i])); | 142 | for (int i = 0; i < 24 && used < sizeof(line); ++i) { |
| 143 | if (n < 0) break; | 143 | int n = std::snprintf(line + used, sizeof(line) - used, "%s%08x", i ? " " : "", |
| 144 | used += static_cast<size_t>(n); | 144 | static_cast<unsigned>(words[i])); |
| 145 | } | 145 | if (n < 0) break; |
| 146 | std::fprintf(stderr, "[rt] d3d12_xs: D3D12XboxCreateDevice params[24] =%s\n", line); | 146 | used += static_cast<size_t>(n); |
| 147 | } else { | ||
| 148 | std::fprintf(stderr, "[rt] d3d12_xs: D3D12XboxCreateDevice params = null\n"); | ||
| 149 | } | 147 | } |
| 148 | std::fprintf(stderr, "[rt] d3d12_xs: D3D12XboxCreateDevice params[24] =%s\n", line); | ||
| 149 | } else { | ||
| 150 | std::fprintf(stderr, "[rt] d3d12_xs: D3D12XboxCreateDevice params = null\n"); | ||
| 150 | } | 151 | } |
| 151 | 152 | ||
| 152 | static std::atomic<bool> proxy_logged{false}; | 153 | static std::atomic<bool> proxy_logged{false}; |