Skip to content

Commit 4e00a43

Browse files
committed
sdk version cleanups
1 parent 26bf0cc commit 4e00a43

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <atlbase.h>
1717
#include <vector>
1818

19-
extern "C" { __declspec(dllexport) extern const UINT D3D12SDKVersion = 619; }
19+
extern "C" { __declspec(dllexport) extern const UINT D3D12SDKVersion = D3D12_SDK_VERSION; }
2020
extern "C" { __declspec(dllexport) extern const char* D3D12SDKPath = u8".\\D3D12\\"; }
2121

2222

@@ -284,6 +284,18 @@ void D3D12RaytracingHelloShaderExecutionReordering::CreateRaytracingPipelineStat
284284
ThrowIfFalse(SM.HighestShaderModel >= D3D_SHADER_MODEL_6_9,
285285
L"ERROR: Device doesn't support Shader Model 6.9.\n\n");
286286

287+
D3D12_FEATURE_DATA_D3D12_OPTIONS22 Options22 = {};
288+
m_dxrDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS22, &Options22, sizeof(Options22));
289+
if (Options22.ShaderExecutionReorderingActuallyReorders)
290+
{
291+
PRINT("ShaderExecutionReorderingActuallyReorders = TRUE on this device.\n");
292+
}
293+
else
294+
{
295+
PRINT("ShaderExecutionReorderingActuallyReorders = TRUE on this device.\n");
296+
}
297+
m_shaderExecutionReorderingActuallyReorders = Options22.ShaderExecutionReorderingActuallyReorders;
298+
287299
// Create 7 subobjects that combine into a RTPSO:
288300
// Subobjects need to be associated with DXIL exports (i.e. shaders) either by way of default or explicit associations.
289301
// Default association applies to every exported shader entrypoint that doesn't have any of the same type of subobject associated with it.
@@ -781,8 +793,9 @@ void D3D12RaytracingHelloShaderExecutionReordering::CalculateFrameStats()
781793
wstringstream windowText;
782794

783795
windowText //<< setprecision(2) << fixed
784-
<< L" fps: " << fps << L" ~Million Primary Rays/s: " << MRaysPerSecond
785-
<< L" GPU[" << m_deviceResources->GetAdapterID() << L"]: " << m_deviceResources->GetAdapterDescription();
796+
<< L" fps: " << fps << L" ~MegaRays/s: " << MRaysPerSecond
797+
<< L" GPU[" << m_deviceResources->GetAdapterID() << L"]: " << m_deviceResources->GetAdapterDescription()
798+
<< L" Device reports ShaderExecutionReorderingActuallyReorders=" << (m_shaderExecutionReorderingActuallyReorders ? L"TRUE" : L"FALSE");
786799
SetCustomWindowText(windowText.str().c_str());
787800
}
788801
}

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingHelloShaderExecutionReordering/D3D12RaytracingHelloShaderExecutionReordering.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class D3D12RaytracingHelloShaderExecutionReordering : public DXSample
5353

5454
// DirectX Raytracing (DXR) attributes
5555
ComPtr<ID3D12Device5> m_dxrDevice;
56+
BOOL m_shaderExecutionReorderingActuallyReorders = FALSE;
5657
ComPtr<ID3D12GraphicsCommandList4> m_dxrCommandList;
5758
ComPtr<ID3D12StateObject> m_dxrStateObject;
5859

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingSakuraForestSER/D3D12RaytracingSakuraForestSER.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "SharedCode.h"
2323
#include <random>
2424

25-
extern "C" { __declspec(dllexport) extern const UINT D3D12SDKVersion = 619; }
25+
extern "C" { __declspec(dllexport) extern const UINT D3D12SDKVersion = D3D12_SDK_VERSION; }
2626
extern "C" { __declspec(dllexport) extern const char* D3D12SDKPath = u8".\\D3D12\\"; }
2727

2828
using namespace std;

0 commit comments

Comments
 (0)