From 2df609a48c9bd1c339a24bb98b9ef738af9c2a84 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Mon, 16 Sep 2024 02:50:49 +0200 Subject: [PATCH] Use D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND to fix raytracing descriptors --- Sources/integrations/kope.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/integrations/kope.c b/Sources/integrations/kope.c index 7c56df3..08bb06e 100644 --- a/Sources/integrations/kope.c +++ b/Sources/integrations/kope.c @@ -270,6 +270,8 @@ static void write_root_signature(FILE *output, descriptor_set *all_descriptor_se fprintf(output, "\tranges%i[%" PRIu64 "].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_CBV;\n", table_index, range_index); fprintf(output, "\tranges%i[%" PRIu64 "].BaseShaderRegister = %i;\n", table_index, range_index, cbv_index); fprintf(output, "\tranges%i[%" PRIu64 "].NumDescriptors = 1;\n", table_index, range_index); + fprintf(output, "\tranges%i[%" PRIu64 "].OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;\n", table_index, + range_index); cbv_index += 1; @@ -284,6 +286,8 @@ static void write_root_signature(FILE *output, descriptor_set *all_descriptor_se fprintf(output, "\tranges%i[%" PRIu64 "].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_UAV;\n", table_index, range_index); fprintf(output, "\tranges%i[%" PRIu64 "].BaseShaderRegister = %i;\n", table_index, range_index, uav_index); fprintf(output, "\tranges%i[%" PRIu64 "].NumDescriptors = 1;\n", table_index, range_index); + fprintf(output, "\tranges%i[%" PRIu64 "].OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;\n", table_index, + range_index); uav_index += 1; } @@ -291,6 +295,8 @@ static void write_root_signature(FILE *output, descriptor_set *all_descriptor_se fprintf(output, "\tranges%i[%" PRIu64 "].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV;\n", table_index, range_index); fprintf(output, "\tranges%i[%" PRIu64 "].BaseShaderRegister = %i;\n", table_index, range_index, srv_index); fprintf(output, "\tranges%i[%" PRIu64 "].NumDescriptors = 1;\n", table_index, range_index); + fprintf(output, "\tranges%i[%" PRIu64 "].OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;\n", table_index, + range_index); srv_index += 1; } @@ -303,6 +309,8 @@ static void write_root_signature(FILE *output, descriptor_set *all_descriptor_se fprintf(output, "\tranges%i[%" PRIu64 "].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV;\n", table_index, range_index); fprintf(output, "\tranges%i[%" PRIu64 "].BaseShaderRegister = %i;\n", table_index, range_index, srv_index); fprintf(output, "\tranges%i[%" PRIu64 "].NumDescriptors = 1;\n", table_index, range_index); + fprintf(output, "\tranges%i[%" PRIu64 "].OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;\n", table_index, + range_index); srv_index += 1; @@ -344,6 +352,8 @@ static void write_root_signature(FILE *output, descriptor_set *all_descriptor_se fprintf(output, "\tranges%i[%" PRIu64 "].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER;\n", table_index, range_index); fprintf(output, "\tranges%i[%" PRIu64 "].BaseShaderRegister = %i;\n", table_index, range_index, sampler_index); fprintf(output, "\tranges%i[%" PRIu64 "].NumDescriptors = 1;\n", table_index, range_index); + fprintf(output, "\tranges%i[%" PRIu64 "].OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;\n", table_index, + range_index); sampler_index += 1; break; }