Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/spirv.c:
* as a signed integer, but Direct3D expects the result to saturate, * and for NaN to yield zero. */
- component_count = vkd3d_write_mask_component_count(dst->write_mask); src_type_id = spirv_compiler_get_type_id_for_reg(compiler, &src->reg, dst->write_mask);
- type_id = spirv_compiler_get_type_id_for_dst(compiler, dst);
- dst_type_id = spirv_compiler_get_type_id_for_dst(compiler, dst); src_id = spirv_compiler_emit_load_src(compiler, src, dst->write_mask);
- int_min_id = spirv_compiler_get_constant_float_vector(compiler, -2147483648.0f,
vkd3d_write_mask_component_count(dst->write_mask));
- int_min_id = spirv_compiler_get_constant_float_vector(compiler, -2147483648.0f, component_count); val_id = vkd3d_spirv_build_op_glsl_std450_max(builder, src_type_id, src_id, int_min_id);
Here you're not mapping NaN to zero, but rather to `INT_MIN`.