summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-01-29 13:17:21 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-01-29 13:17:21 +0100
commit78680cdebc8a97bc2d81decc72cd8cccafe1f669 (patch)
tree1a61bae95afeadde84dab8ccee76d920ada1a95a
parentef9cb3dfa5156901a7133ff30a46a844c4d97ce1 (diff)
parent47da9f8892254014e34e8e7f4aacab99096a6797 (diff)
downloadredot-engine-78680cdebc8a97bc2d81decc72cd8cccafe1f669.tar.gz
Merge pull request #87572 from RandomShaper/d3d12_custom_dbg_print
Direct3D 12: Fix and enable custom debug printing
-rw-r--r--drivers/d3d12/d3d12_context.cpp7
-rw-r--r--drivers/d3d12/d3d12_context.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/drivers/d3d12/d3d12_context.cpp b/drivers/d3d12/d3d12_context.cpp
index 0ba3f59119..b2ef0e66d8 100644
--- a/drivers/d3d12/d3d12_context.cpp
+++ b/drivers/d3d12/d3d12_context.cpp
@@ -520,9 +520,8 @@ Error D3D12Context::_create_device(DeviceBasics &r_basics) {
res = r_basics.device.As(&info_queue);
ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE);
-#if 0 // This causes crashes. Needs investigation.
ComPtr<ID3D12InfoQueue1> info_queue_1;
- device.As(&info_queue_1);
+ r_basics.device.As(&info_queue_1);
if (info_queue_1) {
// Custom printing supported (added in Windows 10 Release Preview build 20236).
@@ -530,9 +529,7 @@ Error D3D12Context::_create_device(DeviceBasics &r_basics) {
res = info_queue_1->RegisterMessageCallback(&_debug_message_func, D3D12_MESSAGE_CALLBACK_IGNORE_FILTERS, nullptr, 0);
ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE);
- } else
-#endif
- {
+ } else {
// Rely on D3D12's own debug printing.
if (Engine::get_singleton()->is_abort_on_gpu_errors_enabled()) {
diff --git a/drivers/d3d12/d3d12_context.h b/drivers/d3d12/d3d12_context.h
index ac90d38467..b6551d798d 100644
--- a/drivers/d3d12/d3d12_context.h
+++ b/drivers/d3d12/d3d12_context.h
@@ -174,7 +174,7 @@ private:
LocalVector<ID3D12CommandList *> command_list_queue;
uint32_t command_list_count = 1;
- static void _debug_message_func(
+ static void STDMETHODCALLTYPE _debug_message_func(
D3D12_MESSAGE_CATEGORY p_category,
D3D12_MESSAGE_SEVERITY p_severity,
D3D12_MESSAGE_ID p_id,