Skip to content

Commit 268ae2c

Browse files
committed
DX: Configure InfoQueue per-device, not per invocation
1 parent a8967dd commit 268ae2c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/API/DX/Device.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ class DXDevice : public hlsltest::Device {
7373
private:
7474
CComPtr<IDXGIAdapter1> Adapter;
7575
CComPtr<ID3D12Device> Device;
76-
CComPtr<ID3D12InfoQueue> InfoQueue;
7776
Capabilities Caps;
7877

7978
struct UAVResourceSet {
@@ -123,6 +122,8 @@ class DXDevice : public hlsltest::Device {
123122
if (auto Err = HR::toError(Adapter->GetDesc1(&Desc),
124123
"Failed to get device description"))
125124
return Err;
125+
if (auto Err = configureInfoQueue(Device))
126+
return Err;
126127
return DXDevice(Adapter, Device, Desc);
127128
}
128129

@@ -152,9 +153,10 @@ class DXDevice : public hlsltest::Device {
152153
#include "DXFeatures.def"
153154
}
154155

155-
llvm::Error initializeInfoQueue() {
156+
static llvm::Error configureInfoQueue(ID3D12Device *Device) {
156157
#ifndef NDEBUG
157-
if (auto Err = HR::toError(Device.QueryInterface(&InfoQueue),
158+
CComPtr<ID3D12InfoQueue> InfoQueue;
159+
if (auto Err = HR::toError(Device->QueryInterface(&InfoQueue),
158160
"Error initializing info queue"))
159161
return Err;
160162
InfoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_CORRUPTION, TRUE);
@@ -557,8 +559,6 @@ class DXDevice : public hlsltest::Device {
557559
}
558560

559561
llvm::Error executeProgram(llvm::StringRef Program, Pipeline &P) override {
560-
if (auto Err = initializeInfoQueue())
561-
return Err;
562562
InvocationState State;
563563
llvm::outs() << "Configuring execution on device: " << Description << "\n";
564564
if (auto Err = createRootSignature(P, State))

0 commit comments

Comments
 (0)