From: Mikko Rasa Date: Sat, 3 Sep 2022 13:15:52 +0000 (+0300) Subject: Handle the flat and centroid qualifiers in SPIR-V output X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7272d97c23eedb3850661deec964c4a9c96337fe;p=libs%2Fgl.git Handle the flat and centroid qualifiers in SPIR-V output --- diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index 8cb485c9..85312bc4 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -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) { diff --git a/source/glsl/spirvconstants.h b/source/glsl/spirvconstants.h index d60b809c..bd82becd 100644 --- a/source/glsl/spirvconstants.h +++ b/source/glsl/spirvconstants.h @@ -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,