From: Mikko Rasa Date: Sat, 11 Dec 2021 17:34:25 +0000 (+0200) Subject: Emit a max invocations exec mode for geometry shaders X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0859998b4d394cb31f92c1031339bf6404561a8a;p=libs%2Fgl.git Emit a max invocations exec mode for geometry shaders --- diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index e1ba981b..7b3e104e 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -1701,7 +1701,10 @@ void SpirVGenerator::visit_entry_point(FunctionDeclaration &func, Id func_id) writer.write_op(content.exec_modes, OP_EXECUTION_MODE, func_id, origin); } else if(stage->type==Stage::GEOMETRY) + { use_capability(CAP_GEOMETRY); + writer.write_op(content.exec_modes, OP_EXECUTION_MODE, func_id, EXEC_INVOCATIONS, 1); + } for(const InterfaceLayout *i: interface_layouts) { diff --git a/source/glsl/spirvconstants.h b/source/glsl/spirvconstants.h index 9935b43e..aa164b87 100644 --- a/source/glsl/spirvconstants.h +++ b/source/glsl/spirvconstants.h @@ -169,6 +169,7 @@ enum SpirVCapability enum SpirVExecutionMode { + EXEC_INVOCATIONS = 0, EXEC_ORIGIN_UPPER_LEFT = 7, EXEC_ORIGIN_LOWER_LEFT = 8, EXEC_INPUT_POINTS = 19,