@@ -42,18 +42,16 @@ struct Instance {
4242
4343class ShaderTable {
4444public:
45- void Init (ID3D12Device *Device, int RaygenCount, int MissCount,
46- int HitGroupCount, int RayTypeCount, int RootTableDwords) {
47- RayTypeCount = RayTypeCount;
48- RaygenCount = RaygenCount;
49- MissCount = MissCount * RayTypeCount;
50- HitGroupCount = HitGroupCount * RayTypeCount;
51- RootTableSizeInBytes = RootTableDwords * 4 ;
52- ShaderRecordSizeInBytes =
53- ROUND_UP (RootTableSizeInBytes + SHADER_ID_SIZE_IN_BYTES,
54- D3D12_RAYTRACING_SHADER_RECORD_BYTE_ALIGNMENT);
55- MissStartIdx = RaygenCount;
56- HitGroupStartIdx = MissStartIdx + MissCount;
45+ ShaderTable (ID3D12Device *Device, int RaygenCount, int MissCount,
46+ int HitGroupCount, int RayTypeCount, int RootTableDwords)
47+ : RayTypeCount(RayTypeCount), RaygenCount(RaygenCount),
48+ MissCount (MissCount * RayTypeCount),
49+ HitGroupCount(HitGroupCount * RayTypeCount),
50+ RootTableSizeInBytes(RootTableDwords * 4 ),
51+ ShaderRecordSizeInBytes(
52+ ROUND_UP (RootTableSizeInBytes + SHADER_ID_SIZE_IN_BYTES,
53+ D3D12_RAYTRACING_SHADER_RECORD_BYTE_ALIGNMENT)),
54+ MissStartIdx(RaygenCount), HitGroupStartIdx(MissStartIdx + MissCount) {
5755
5856 const int TotalSizeInBytes =
5957 (RaygenCount + MissCount + HitGroupCount) * ShaderRecordSizeInBytes;
0 commit comments