Skip to content

Commit 71f3c57

Browse files
committed
move SM 6.9 support check to a better place, before shader creation (was after)
1 parent 94efea4 commit 71f3c57

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingHelloShaderExecutionReordering/D3D12RaytracingHelloShaderExecutionReordering.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,6 @@ void D3D12RaytracingHelloShaderExecutionReordering::OnInit()
181181

182182
CreateDeviceDependentResources();
183183

184-
D3D12_FEATURE_DATA_SHADER_MODEL SM;
185-
SM.HighestShaderModel = D3D_SHADER_MODEL_6_9;
186-
m_dxrDevice->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &SM, sizeof(SM));
187-
ThrowIfFalse(SM.HighestShaderModel >= D3D_SHADER_MODEL_6_9,
188-
L"ERROR: Device doesn't support Shader Model 6.9.\n\n");
189-
190184
CreateWindowSizeDependentResources();
191185
}
192186

@@ -287,6 +281,12 @@ void D3D12RaytracingHelloShaderExecutionReordering::CreateLocalRootSignatureSubo
287281
// with all configuration options resolved, such as local signatures and other state.
288282
void D3D12RaytracingHelloShaderExecutionReordering::CreateRaytracingPipelineStateObject()
289283
{
284+
D3D12_FEATURE_DATA_SHADER_MODEL SM;
285+
SM.HighestShaderModel = D3D_SHADER_MODEL_6_9;
286+
m_dxrDevice->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &SM, sizeof(SM));
287+
ThrowIfFalse(SM.HighestShaderModel >= D3D_SHADER_MODEL_6_9,
288+
L"ERROR: Device doesn't support Shader Model 6.9.\n\n");
289+
290290
// Create 7 subobjects that combine into a RTPSO:
291291
// Subobjects need to be associated with DXIL exports (i.e. shaders) either by way of default or explicit associations.
292292
// Default association applies to every exported shader entrypoint that doesn't have any of the same type of subobject associated with it.

0 commit comments

Comments
 (0)