X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fspirv.cpp;h=7f99ebb3d9ecc61b737739542feed5a72994633f;hb=f1e31ee641f0cafdfe2015bff206b9ee2ad85abf;hp=13c58a695ab3668d9c0a605ce679f1d00565a997;hpb=e98188ff6c9bba9761b71f2a69f3be7eb89ba3da;p=libs%2Fgl.git diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index 13c58a69..7f99ebb3 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -135,8 +135,9 @@ SpirVGenerator::SpirVGenerator(): writer(content) { } -void SpirVGenerator::apply(Module &module) +void SpirVGenerator::apply(Module &module, const Features &f) { + features = f; use_capability(CAP_SHADER); for(Stage &s: module.stages) @@ -1745,7 +1746,10 @@ void SpirVGenerator::visit_entry_point(FunctionDeclaration &func, Id func_id) writer.end_op(OP_ENTRY_POINT); if(stage->type==Stage::FRAGMENT) - writer.write_op(content.exec_modes, OP_EXECUTION_MODE, func_id, EXEC_ORIGIN_LOWER_LEFT); + { + SpirVExecutionMode origin = (features.target_api==VULKAN ? EXEC_ORIGIN_UPPER_LEFT : EXEC_ORIGIN_LOWER_LEFT); + writer.write_op(content.exec_modes, OP_EXECUTION_MODE, func_id, origin); + } else if(stage->type==Stage::GEOMETRY) use_capability(CAP_GEOMETRY);