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.
This commit is contained in:
Giovanni Mascellani
2025-10-21 10:06:17 +02:00
committed by Henri Verbeet
parent cc1db404b0
commit 6b157cc149
Notes: Henri Verbeet 2025-10-30 20:00:19 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1805

View File

@@ -323,17 +323,6 @@ static ID3D12RootSignature *d3d12_runner_create_root_signature(struct d3d12_shad
root_signature_desc.pStaticSamplers = static_samplers; root_signature_desc.pStaticSamplers = static_samplers;
root_signature_desc.Flags = D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT; 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) for (i = 0; i < runner->r.resource_count; ++i)
{ {
struct d3d12_resource *resource = d3d12_resource(runner->r.resources[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)); assert(root_signature_desc.NumParameters <= ARRAY_SIZE(root_params));
for (i = 0; i < runner->r.sampler_count; ++i) for (i = 0; i < runner->r.sampler_count; ++i)