diff --git a/reference/shaders-hlsl/vert/qualifiers.vert b/reference/shaders-hlsl/vert/qualifiers.vert index 43d49b1b..16dcbc80 100644 --- a/reference/shaders-hlsl/vert/qualifiers.vert +++ b/reference/shaders-hlsl/vert/qualifiers.vert @@ -1,8 +1,8 @@ static float4 gl_Position; -static nointerpolation float vFlat; -static centroid float vCentroid; -static sample float vSample; -static noperspective float vNoperspective; +static float vFlat; +static float vCentroid; +static float vSample; +static float vNoperspective; struct Block { diff --git a/spirv_hlsl.cpp b/spirv_hlsl.cpp index ad61e97b..0016bd33 100644 --- a/spirv_hlsl.cpp +++ b/spirv_hlsl.cpp @@ -131,7 +131,14 @@ void CompilerHLSL::emit_header() void CompilerHLSL::emit_interface_block_globally(const SPIRVariable &var) { add_resource_name(var.self); + + // The global copies of I/O variables should not contain interpolation qualifiers. + // These are emitted inside the interface structs. + auto &flags = meta[var.self].decoration.decoration_flags; + auto old_flags = flags; + flags = 0; statement("static ", variable_decl(var), ";"); + flags = old_flags; } const char *CompilerHLSL::to_storage_qualifiers_glsl(const SPIRVariable &var)