mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 20:10:17 +01:00
zink: convert all 64bit vertex attribs to 32bit
this applies not only to dvec3/dvec4, but to any type of 64bit input since that's what gallium gives us fixes #6211 Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
This commit is contained in:
parent
7cf7e113ba
commit
5ca6b28c58
1 changed files with 17 additions and 4 deletions
|
|
@ -179,11 +179,25 @@ lower_64bit_uint_attribs_instr(nir_builder *b, nir_instr *instr, void *data)
|
|||
nir_variable *var = nir_deref_instr_get_variable(nir_instr_as_deref(intr->src[0].ssa->parent_instr));
|
||||
if (var->data.mode != nir_var_shader_in)
|
||||
return false;
|
||||
if (glsl_get_bit_size(var->type) != 64)
|
||||
if (glsl_get_bit_size(var->type) != 64 || glsl_get_base_type(var->type) >= GLSL_TYPE_SAMPLER)
|
||||
return false;
|
||||
|
||||
unsigned num_components = glsl_get_vector_elements(var->type);
|
||||
var->type = glsl_vector_type(GLSL_TYPE_UINT, num_components * 2);
|
||||
enum glsl_base_type base_type;
|
||||
switch (glsl_get_base_type(var->type)) {
|
||||
case GLSL_TYPE_UINT64:
|
||||
base_type = GLSL_TYPE_UINT;
|
||||
break;
|
||||
case GLSL_TYPE_INT64:
|
||||
base_type = GLSL_TYPE_INT;
|
||||
break;
|
||||
case GLSL_TYPE_DOUBLE:
|
||||
base_type = GLSL_TYPE_FLOAT;
|
||||
break;
|
||||
default:
|
||||
unreachable("unknown 64-bit vertex attribute format!");
|
||||
}
|
||||
var->type = glsl_vector_type(base_type, num_components * 2);
|
||||
|
||||
b->cursor = nir_after_instr(instr);
|
||||
|
||||
|
|
@ -215,8 +229,7 @@ lower_64bit_vertex_attribs(nir_shader *shader)
|
|||
return false;
|
||||
|
||||
bool progress = nir_shader_instructions_pass(shader, lower_64bit_vertex_attribs_instr, nir_metadata_dominance, NULL);
|
||||
if (progress)
|
||||
nir_shader_instructions_pass(shader, lower_64bit_uint_attribs_instr, nir_metadata_dominance, NULL);
|
||||
progress |= nir_shader_instructions_pass(shader, lower_64bit_uint_attribs_instr, nir_metadata_dominance, NULL);
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue