microsoft/spirv_to_dxil: Fix push_constants type declaration

We're not declaring an array of bytes but an array of uint32. Let's
fix the element_count we pass to glsl_array_type().

Fixes: de1e941c59 ("microsoft/spirv_to_dxil: Lower push constant loads to UBO loads")
Reviewed-by: Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16703>
This commit is contained in:
Boris Brezillon
2022-05-25 10:05:26 +02:00
committed by Marge Bot
parent b56fcefa0f
commit 6783a88455
+3 -2
View File
@@ -159,9 +159,10 @@ static nir_variable *
add_push_constant_var(nir_shader *nir, unsigned size, unsigned desc_set, unsigned binding)
{
/* Size must be a multiple of 16 as buffer load is loading 16 bytes at a time */
size = ALIGN_POT(size, 16) / 16;
unsigned num_32bit_words = ALIGN_POT(size, 16) / 4;
const struct glsl_type *array_type = glsl_array_type(glsl_uint_type(), size, 4);
const struct glsl_type *array_type =
glsl_array_type(glsl_uint_type(), num_32bit_words, 4);
const struct glsl_struct_field field = {array_type, "arr"};
nir_variable *var = nir_variable_create(
nir, nir_var_mem_ubo,