diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp index 0098d6ac..e915b861 100644 --- a/spirv_glsl.cpp +++ b/spirv_glsl.cpp @@ -3993,7 +3993,7 @@ void CompilerGLSL::emit_output_variable_initializer(const SPIRVariable &var) } } -void CompilerGLSL::emit_subgroup_arithmetic_workaround(std::string func, Op op, GroupOperation group_op) +void CompilerGLSL::emit_subgroup_arithmetic_workaround(const std::string &func, Op op, GroupOperation group_op) { std::string result; switch (group_op) @@ -4092,7 +4092,8 @@ void CompilerGLSL::emit_subgroup_arithmetic_workaround(std::string func, Op op, op_symbol = "*="; } - for (const TypeInfo& t : type_infos) { + for (const TypeInfo &t : type_infos) + { statement(t.type, " ", func, "(", t.type, " v)"); begin_scope(); statement(t.type, " ", result, " = ", t.identity, ";"); @@ -7339,6 +7340,10 @@ bool CompilerGLSL::is_supported_subgroup_op_in_opengl(spv::Op op, const uint32_t { return true; } + else + { + return false; + } } default: return false; diff --git a/spirv_glsl.hpp b/spirv_glsl.hpp index 8c8f470c..ee6989ce 100644 --- a/spirv_glsl.hpp +++ b/spirv_glsl.hpp @@ -639,7 +639,7 @@ protected: void emit_struct(SPIRType &type); void emit_resources(); void emit_extension_workarounds(spv::ExecutionModel model); - void emit_subgroup_arithmetic_workaround(std::string func, spv::Op op, spv::GroupOperation group_op); + void emit_subgroup_arithmetic_workaround(const std::string &func, spv::Op op, spv::GroupOperation group_op); void emit_polyfills(uint32_t polyfills, bool relaxed); void emit_buffer_block_native(const SPIRVariable &var); void emit_buffer_reference_block(uint32_t type_id, bool forward_declaration);