]> git.tdb.fi Git - libs/gl.git/commitdiff
Handle the flat and centroid qualifiers in SPIR-V output
authorMikko Rasa <tdb@tdb.fi>
Sat, 3 Sep 2022 13:15:52 +0000 (16:15 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 3 Sep 2022 13:23:10 +0000 (16:23 +0300)
source/glsl/spirv.cpp
source/glsl/spirvconstants.h

index 8cb485c9b429844f2bcc0869b80212687f9e7b76..85312bc4edb67760f2e87d0591a0e7499707d114 100644 (file)
@@ -1771,6 +1771,10 @@ void SpirVGenerator::visit(VariableDeclaration &var)
                        BuiltinSemantic semantic = get_builtin_semantic(var.name);
                        writer.write_op_decorate(var_id, DECO_BUILTIN, semantic);
                }
+               if(var.sampling=="flat")
+                       writer.write_op_decorate(var_id, DECO_FLAT);
+               if(var.sampling=="centroid")
+                       writer.write_op_decorate(var_id, DECO_CENTROID);
 
                if(init_id && current_function)
                {
index d60b809cbcf067ecc35dfab89b28296644531382..bd82becd0e54699530ed92a9d2c0bdbb6dcc91c3 100644 (file)
@@ -209,6 +209,8 @@ enum SpirVDecoration
        DECO_ARRAY_STRIDE = 6,
        DECO_MATRIX_STRIDE = 7,
        DECO_BUILTIN = 11,
+       DECO_FLAT = 14,
+       DECO_CENTROID = 16,
        DECO_LOCATION = 30,
        DECO_BINDING = 33,
        DECO_DESCRIPTOR_SET = 34,