]> git.tdb.fi Git - libs/gl.git/commitdiff
Emit a max invocations exec mode for geometry shaders
authorMikko Rasa <tdb@tdb.fi>
Sat, 11 Dec 2021 17:34:25 +0000 (19:34 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 11 Dec 2021 17:34:25 +0000 (19:34 +0200)
source/glsl/spirv.cpp
source/glsl/spirvconstants.h

index e1ba981b552f1b63de515334bdd516ed0846159f..7b3e104e372c65a7d845bfd0a77c93358762aee3 100644 (file)
@@ -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)
        {
index 9935b43e592d3081f4e1ad7493d22df08d37644c..aa164b87c1d803ec27ad74a080fd7f39a391bcbb 100644 (file)
@@ -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,