@@ -73,7 +73,6 @@ class DXDevice : public hlsltest::Device {
73
73
private:
74
74
CComPtr<IDXGIAdapter1> Adapter;
75
75
CComPtr<ID3D12Device> Device;
76
- CComPtr<ID3D12InfoQueue> InfoQueue;
77
76
Capabilities Caps;
78
77
79
78
struct UAVResourceSet {
@@ -123,6 +122,8 @@ class DXDevice : public hlsltest::Device {
123
122
if (auto Err = HR::toError (Adapter->GetDesc1 (&Desc),
124
123
" Failed to get device description" ))
125
124
return Err;
125
+ if (auto Err = configureInfoQueue (Device))
126
+ return Err;
126
127
return DXDevice (Adapter, Device, Desc);
127
128
}
128
129
@@ -152,9 +153,10 @@ class DXDevice : public hlsltest::Device {
152
153
#include " DXFeatures.def"
153
154
}
154
155
155
- llvm::Error initializeInfoQueue ( ) {
156
+ static llvm::Error configureInfoQueue (ID3D12Device *Device ) {
156
157
#ifndef NDEBUG
157
- if (auto Err = HR::toError (Device.QueryInterface (&InfoQueue),
158
+ CComPtr<ID3D12InfoQueue> InfoQueue;
159
+ if (auto Err = HR::toError (Device->QueryInterface (&InfoQueue),
158
160
" Error initializing info queue" ))
159
161
return Err;
160
162
InfoQueue->SetBreakOnSeverity (D3D12_MESSAGE_SEVERITY_CORRUPTION, TRUE );
@@ -557,8 +559,6 @@ class DXDevice : public hlsltest::Device {
557
559
}
558
560
559
561
llvm::Error executeProgram (llvm::StringRef Program, Pipeline &P) override {
560
- if (auto Err = initializeInfoQueue ())
561
- return Err;
562
562
InvocationState State;
563
563
llvm::outs () << " Configuring execution on device: " << Description << " \n " ;
564
564
if (auto Err = createRootSignature (P, State))
0 commit comments