From 6b157cc1497fe423a556f5d816e3e8d1ca79988d Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 21 Oct 2025 10:06:17 +0200 Subject: [PATCH] tests/shader_runner_d3d12: Move the uniform root parameter to the end of the root signature. So that it's easy to index SRV and UAV root parameters without an offset. --- tests/shader_runner_d3d12.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index ed6abcbdc..ede85a8f3 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -323,17 +323,6 @@ static ID3D12RootSignature *d3d12_runner_create_root_signature(struct d3d12_shad root_signature_desc.pStaticSamplers = static_samplers; root_signature_desc.Flags = D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT; - if (runner->r.uniform_count) - { - *uniform_index = root_signature_desc.NumParameters++; - root_param = &root_params[*uniform_index]; - root_param->ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS; - root_param->Constants.ShaderRegister = 0; - root_param->Constants.RegisterSpace = 0; - root_param->Constants.Num32BitValues = runner->r.uniform_count; - root_param->ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL; - } - for (i = 0; i < runner->r.resource_count; ++i) { struct d3d12_resource *resource = d3d12_resource(runner->r.resources[i]); @@ -380,6 +369,17 @@ static ID3D12RootSignature *d3d12_runner_create_root_signature(struct d3d12_shad } } + if (runner->r.uniform_count) + { + *uniform_index = root_signature_desc.NumParameters++; + root_param = &root_params[*uniform_index]; + root_param->ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS; + root_param->Constants.ShaderRegister = 0; + root_param->Constants.RegisterSpace = 0; + root_param->Constants.Num32BitValues = runner->r.uniform_count; + root_param->ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL; + } + assert(root_signature_desc.NumParameters <= ARRAY_SIZE(root_params)); for (i = 0; i < runner->r.sampler_count; ++i)