mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-16 05:28:14 +02:00
microsoft/clc: Let lower_vars_to_explicit_types fill kernel input driver_location
Importantly, also run that before mucking with the variable list via image lowering, which removes and inserts variables, making the driver_location no longer line up with metadata. 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 commit9da8179a1e)
This commit is contained in:
parent
0ee919e708
commit
a98a386d13
2 changed files with 5 additions and 3 deletions
|
|
@ -4216,7 +4216,7 @@
|
|||
"description": "microsoft/clc: Let lower_vars_to_explicit_types fill kernel input driver_location",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "ff05da7f8dc4aa531704d48f718514e3b1fff45d"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1102,7 +1102,6 @@ clc_to_dxil(struct clc_context *ctx,
|
|||
|
||||
unsigned size = glsl_get_cl_size(var->type);
|
||||
offset = align(offset, glsl_get_cl_alignment(var->type));
|
||||
var->data.driver_location = offset;
|
||||
|
||||
metadata->args[i].offset = offset;
|
||||
metadata->args[i].size = size;
|
||||
|
|
@ -1267,6 +1266,9 @@ clc_to_dxil(struct clc_context *ctx,
|
|||
NIR_PASS_V(nir, nir_opt_dce);
|
||||
NIR_PASS_V(nir, nir_opt_deref);
|
||||
|
||||
// For uniforms (kernel inputs), run this before adjusting variable list via image/sampler lowering
|
||||
NIR_PASS_V(nir, nir_lower_vars_to_explicit_types, nir_var_uniform, glsl_get_cl_type_size_align);
|
||||
|
||||
// Needs to come before lower_explicit_io
|
||||
NIR_PASS_V(nir, nir_lower_cl_images_to_tex);
|
||||
struct clc_image_lower_context image_lower_context = { metadata, &srv_id, &uav_id };
|
||||
|
|
@ -1280,7 +1282,7 @@ clc_to_dxil(struct clc_context *ctx,
|
|||
|
||||
nir->scratch_size = 0;
|
||||
NIR_PASS_V(nir, nir_lower_vars_to_explicit_types,
|
||||
nir_var_mem_shared | nir_var_function_temp | nir_var_uniform | nir_var_mem_global | nir_var_mem_constant,
|
||||
nir_var_mem_shared | nir_var_function_temp | nir_var_mem_global | nir_var_mem_constant,
|
||||
glsl_get_cl_type_size_align);
|
||||
|
||||
NIR_PASS_V(nir, dxil_nir_lower_ubo_to_temp);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue