diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 9d2ffebcb2f..96b929dbfa9 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -2789,10 +2789,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode, if (bfloat_dst) { for (int i = 0; i < num_components; i++) { - /* Ensure the pad bits are zeroed by fully assigning the value. */ const uint16_t b = _mesa_float_to_bfloat16_bits_rte(val->constant->values[i].f32); - val->constant->values[i] = (nir_const_value){ .u16 = b }; + val->constant->values[i] = nir_const_value_for_raw_uint(b, 16); } }