[PATCH] vkd3d-shader: Decorate integer fragment shader builtins as flat
Philip Rebohle
philip.rebohle at tu-dortmund.de
Sat Feb 23 08:25:51 CST 2019
>From the Vulkan spec, 8.13 "Interpolation Decorations":
Fragment shader inputs that are signed or unsigned integers,
integer vectors, or any double-precision floating-point type
must be decorated with Flat.
This also matches glslang behaviour.
Specifically, this fixes tone-mapping in Unreal Engine 4 on RADV
and AMDGPU-PRO, where gl_Layer is used as a fragment shader input.
Signed-off-by: Philip Rebohle <philip.rebohle at tu-dortmund.de>
---
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 82598df..5ed4df2 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -3489,6 +3489,10 @@ static uint32_t vkd3d_dxbc_compiler_emit_builtin_variable(struct vkd3d_dxbc_comp
vkd3d_spirv_add_iface_variable(builder, id);
vkd3d_dxbc_compiler_decorate_builtin(compiler, id, builtin->spirv_builtin);
+ if (compiler->shader_type == VKD3D_SHADER_TYPE_PIXEL && storage_class == SpvStorageClassInput
+ && builtin->component_type != VKD3D_TYPE_FLOAT && builtin->component_type != VKD3D_TYPE_BOOL)
+ vkd3d_spirv_build_op_decorate(builder, id, SpvDecorationFlat, NULL, 0);
+
return id;
}
--
2.20.1
More information about the wine-devel
mailing list