Skip to content

Commit b2058aa

Browse files
authored
Merge pull request #12 from damyanp/infoqueue
DX: Configure InfoQueue per-device, not per invocation
2 parents 2a440b4 + 268ae2c commit b2058aa

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);
@@ -554,8 +556,6 @@ class DXDevice : public hlsltest::Device {
554556
}
555557

556558
llvm::Error executeProgram(llvm::StringRef Program, Pipeline &P) override {
557-
if (auto Err = initializeInfoQueue())
558-
return Err;
559559
InvocationState State;
560560
llvm::outs() << "Configuring execution on device: " << Description << "\n";
561561
if (auto Err = createRootSignature(P, State))

0 commit comments

Comments
 (0)