Skip to content

Commit 49c2046

Browse files
committed
Unify uint32_t flags into 1 sortMode enum
1 parent 3ab470c commit 49c2046

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,15 +1554,22 @@ void D3D12RaytracingSakuraForestSER::OnUpdate()
15541554
const XMVECTOR& prevLightPosition = m_sceneCB[prevFrameIndex].lightPosition;
15551555
m_sceneCB[frameIndex].lightPosition = XMVector3Transform(prevLightPosition, rotate);
15561556
}
1557-
m_sceneCB[frameIndex].enableSER = m_serEnabled ? 1 : 0;
1558-
if (m_sortByHit)
1557+
if (!m_serEnabled)
1558+
{
1559+
m_sceneCB[frameIndex].sortMode = SORTMODE_OFF;
1560+
}
1561+
else if (m_sortByHit)
1562+
{
15591563
m_sceneCB[frameIndex].sortMode = SORTMODE_BY_HIT;
1564+
}
15601565
else if (m_sortByMaterial)
1566+
{
15611567
m_sceneCB[frameIndex].sortMode = SORTMODE_BY_MATERIAL;
1568+
}
15621569
else if (m_sortByBoth)
1570+
{
15631571
m_sceneCB[frameIndex].sortMode = SORTMODE_BY_BOTH;
1564-
else
1565-
m_sceneCB[frameIndex].sortMode = SORTMODE_OFF;
1572+
}
15661573
}
15671574

15681575
void D3D12RaytracingSakuraForestSER::DoRaytracing()

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingSakuraForestSER/RayTracingHlslCompat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ struct SceneConstantBuffer
3737
XMVECTOR lightPosition;
3838
XMVECTOR lightAmbientColor;
3939
XMVECTOR lightDiffuseColor;
40-
uint32_t enableSER;
4140
uint32_t sortMode;
4241
};
4342

0 commit comments

Comments
 (0)