mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-14 05:48:04 +02:00
microsoft/clc: Move inline samplers to the end of the variable list
Since inline samplers are uniforms, just like kernel args, and nir_lower_vars_to_explicit_types will assign driver_location based on order in the variable list, move the inline samplers to the end of the list to prevent them from creating gaps in the kernel arg offsets. Fixes:ff05da7f("microsoft: Add CLC frontend and kernel/compute support to DXIL converter") Reviewed-By: Bill Kristiansen <billkris@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9138> (cherry picked from commit3ee8f2ccba)
This commit is contained in:
parent
ba87319c94
commit
0cd2eab1b8
2 changed files with 10 additions and 3 deletions
|
|
@ -4198,7 +4198,7 @@
|
|||
"description": "microsoft/clc: Move inline samplers to the end of the variable list",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "ff05da7f8dc4aa531704d48f718514e3b1fff45d"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1209,8 +1209,11 @@ clc_to_dxil(struct clc_context *ctx,
|
|||
|
||||
NIR_PASS_V(nir, scale_fdiv);
|
||||
|
||||
// Assign bindings for constant samplers
|
||||
nir_foreach_variable_with_modes(var, nir, nir_var_uniform) {
|
||||
struct exec_list tmp_list;
|
||||
exec_list_make_empty(&tmp_list);
|
||||
|
||||
// Assign bindings for constant samplers, and move them to the end of the variable list
|
||||
nir_foreach_variable_with_modes_safe(var, nir, nir_var_uniform) {
|
||||
if (glsl_type_is_sampler(var->type) && var->data.sampler.is_inline_sampler) {
|
||||
int_sampler_states[sampler_id].wrap[0] =
|
||||
int_sampler_states[sampler_id].wrap[1] =
|
||||
|
|
@ -1228,8 +1231,12 @@ clc_to_dxil(struct clc_context *ctx,
|
|||
metadata->const_samplers[metadata->num_const_samplers].normalized_coords = var->data.sampler.normalized_coordinates;
|
||||
metadata->const_samplers[metadata->num_const_samplers].filter_mode = var->data.sampler.filter_mode;
|
||||
metadata->num_const_samplers++;
|
||||
|
||||
exec_node_remove(&var->node);
|
||||
exec_list_push_tail(&tmp_list, &var->node);
|
||||
}
|
||||
}
|
||||
exec_node_insert_list_after(exec_list_get_tail(&nir->variables), &tmp_list);
|
||||
|
||||
NIR_PASS_V(nir, nir_lower_variable_initializers, ~(nir_var_function_temp | nir_var_shader_temp));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue