d3d12: Keep state vars last in the per-stage root parameters
Reviewed-by: Sil Vilerino <sivileri@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14367>
This commit is contained in:
parent
166cd05071
commit
fbc1d90f19
|
@ -458,13 +458,6 @@ update_graphics_root_parameters(struct d3d12_context *ctx,
|
|||
}
|
||||
num_params++;
|
||||
}
|
||||
/* TODO Don't always update state vars */
|
||||
if (shader->num_state_vars > 0) {
|
||||
uint32_t constants[D3D12_MAX_STATE_VARS * 4];
|
||||
unsigned size = fill_state_vars(ctx, dinfo, draw, shader, constants);
|
||||
ctx->cmdlist->SetGraphicsRoot32BitConstants(num_params, size, constants, 0);
|
||||
num_params++;
|
||||
}
|
||||
if (shader->nir->info.num_ssbos > 0) {
|
||||
if (dirty & D3D12_SHADER_DIRTY_SSBO) {
|
||||
assert(num_root_desciptors < MAX_DESCRIPTOR_TABLES);
|
||||
|
@ -481,6 +474,13 @@ update_graphics_root_parameters(struct d3d12_context *ctx,
|
|||
}
|
||||
num_params++;
|
||||
}
|
||||
/* TODO Don't always update state vars */
|
||||
if (shader->num_state_vars > 0) {
|
||||
uint32_t constants[D3D12_MAX_STATE_VARS * 4];
|
||||
unsigned size = fill_state_vars(ctx, dinfo, draw, shader, constants);
|
||||
ctx->cmdlist->SetGraphicsRoot32BitConstants(num_params, size, constants, 0);
|
||||
num_params++;
|
||||
}
|
||||
}
|
||||
return num_root_desciptors;
|
||||
}
|
||||
|
|
|
@ -135,13 +135,6 @@ create_root_signature(struct d3d12_context *ctx, struct d3d12_root_signature_key
|
|||
0);
|
||||
}
|
||||
|
||||
if (key->stages[i].state_vars_size > 0) {
|
||||
init_constant_root_param(&root_params[num_params++],
|
||||
key->stages[i].num_cb_bindings + (key->stages[i].has_default_ubo0 ? 0 : 1),
|
||||
key->stages[i].state_vars_size,
|
||||
visibility);
|
||||
}
|
||||
|
||||
if (key->stages[i].num_ssbos > 0) {
|
||||
init_range_root_param(&root_params[num_params++],
|
||||
&desc_ranges[num_ranges++],
|
||||
|
@ -161,6 +154,13 @@ create_root_signature(struct d3d12_context *ctx, struct d3d12_root_signature_key
|
|||
0,
|
||||
1);
|
||||
}
|
||||
|
||||
if (key->stages[i].state_vars_size > 0) {
|
||||
init_constant_root_param(&root_params[num_params++],
|
||||
key->stages[i].num_cb_bindings + (key->stages[i].has_default_ubo0 ? 0 : 1),
|
||||
key->stages[i].state_vars_size,
|
||||
visibility);
|
||||
}
|
||||
assert(num_params < PIPE_SHADER_TYPES * D3D12_NUM_BINDING_TYPES);
|
||||
assert(num_ranges < PIPE_SHADER_TYPES * D3D12_NUM_BINDING_TYPES);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue