Do not emit interpolation qualifiers to static globals.

This commit is contained in:
Hans-Kristian Arntzen 2017-03-20 09:52:18 +01:00
parent b8bda45802
commit a0a582dd04
2 changed files with 11 additions and 4 deletions

View File

@ -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
{

View File

@ -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)