mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-19 23:00:45 +01:00
spirv: In SpecConstantOp handling don't adjust convert ops bit_size twice
After 8fa70cfcfd ("spirv: Use the right bit-size for spec constant
ops") the bit-size will already be adjusted based on the sources, and
this will take care of Convert operations too.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34119>
This commit is contained in:
parent
5e25ef16d9
commit
f78a27eb18
1 changed files with 3 additions and 5 deletions
|
|
@ -2615,7 +2615,6 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,
|
|||
nir_alu_type dst_alu_type = nir_get_nir_type_for_glsl_type(val->type->type);
|
||||
nir_alu_type src_alu_type = dst_alu_type;
|
||||
unsigned num_components = glsl_get_vector_elements(val->type->type);
|
||||
unsigned bit_size;
|
||||
|
||||
vtn_assert(count <= 7);
|
||||
|
||||
|
|
@ -2623,14 +2622,12 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,
|
|||
case SpvOpSConvert:
|
||||
case SpvOpFConvert:
|
||||
case SpvOpUConvert:
|
||||
/* We have a source in a conversion */
|
||||
/* We have a different source type in a conversion. */
|
||||
src_alu_type =
|
||||
nir_get_nir_type_for_glsl_type(vtn_get_value_type(b, w[4])->type);
|
||||
/* We use the bitsize of the conversion source to evaluate the opcode later */
|
||||
bit_size = glsl_get_bit_size(vtn_get_value_type(b, w[4])->type);
|
||||
break;
|
||||
default:
|
||||
bit_size = glsl_get_bit_size(val->type->type);
|
||||
break;
|
||||
};
|
||||
|
||||
bool exact;
|
||||
|
|
@ -2643,6 +2640,7 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,
|
|||
*/
|
||||
assert(!exact);
|
||||
|
||||
unsigned bit_size = glsl_get_bit_size(val->type->type);
|
||||
nir_const_value src[3][NIR_MAX_VEC_COMPONENTS];
|
||||
|
||||
for (unsigned i = 0; i < count - 4; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue