[PATCH vkd3d] vkd3d-shader: Decorate "precise" arithmetic instructions with SpvDecorationNoContraction.
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> --- For Wine bug 45046. I'm unable to reproduce the issue myself, but the patch is reported as working by Matteo on IRC. libs/vkd3d-shader/spirv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 61d0d472..27bf40bd 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -6368,6 +6368,8 @@ static void vkd3d_dxbc_compiler_emit_alu_instruction(struct vkd3d_dxbc_compiler val_id = vkd3d_spirv_build_op_trv(builder, &builder->function_stream, op, type_id, src_ids, instruction->src_count); + if (instruction->flags & VKD3DSI_PRECISE_XYZW) + vkd3d_spirv_build_op_decorate(builder, val_id, SpvDecorationNoContraction, NULL, 0); vkd3d_dxbc_compiler_emit_store_dst(compiler, dst, val_id); } @@ -6600,6 +6602,8 @@ static void vkd3d_dxbc_compiler_emit_dot(struct vkd3d_dxbc_compiler *compiler, val_id = vkd3d_dxbc_compiler_emit_construct_vector(compiler, component_type, component_count, val_id, 0, 1); } + if (instruction->flags & VKD3DSI_PRECISE_XYZW) + vkd3d_spirv_build_op_decorate(builder, val_id, SpvDecorationNoContraction, NULL, 0); vkd3d_dxbc_compiler_emit_store_dst(compiler, dst, val_id); } -- 2.11.0
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> --- Yeah, it does fix the original issue from bug 45046 for me on Nvidia + Vulkan backend. I can see at least two other graphical issues on this setup but those would be separate bugs.
participants (2)
-
Henri Verbeet -
Matteo Bruni