From 7272d97c23eedb3850661deec964c4a9c96337fe Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 3 Sep 2022 16:15:52 +0300 Subject: [PATCH] Handle the flat and centroid qualifiers in SPIR-V output --- source/glsl/spirv.cpp | 4 ++++ source/glsl/spirvconstants.h | 2 ++ 2 files changed, 6 insertions(+) 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, -- 2.45.2