mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Updated spirv-cross.
This commit is contained in:
18
3rdparty/spirv-cross/spirv_glsl.cpp
vendored
18
3rdparty/spirv-cross/spirv_glsl.cpp
vendored
@@ -9824,7 +9824,17 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage)
|
||||
case BuiltInInvocationId:
|
||||
return "gl_InvocationID";
|
||||
case BuiltInLayer:
|
||||
{
|
||||
auto model = get_execution_model();
|
||||
if (model == ExecutionModelVertex || model == ExecutionModelTessellationEvaluation)
|
||||
{
|
||||
if (options.es)
|
||||
require_extension_internal("GL_NV_viewport_array2");
|
||||
else
|
||||
require_extension_internal("GL_ARB_shader_viewport_layer_array");
|
||||
}
|
||||
return "gl_Layer";
|
||||
}
|
||||
case BuiltInViewportIndex:
|
||||
return "gl_ViewportIndex";
|
||||
case BuiltInTessLevelOuter:
|
||||
@@ -17869,6 +17879,14 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
|
||||
|
||||
case SPIRBlock::Unreachable:
|
||||
{
|
||||
// If the entry point ends with unreachable and has a return value, insert a return
|
||||
// statement to avoid potential compiler errors from non-void functions without a return value.
|
||||
if (block.return_value)
|
||||
{
|
||||
statement("return ", to_unpacked_expression(block.return_value), ";");
|
||||
break;
|
||||
}
|
||||
|
||||
// Avoid emitting false fallthrough, which can happen for
|
||||
// if (cond) break; else discard; inside a case label.
|
||||
// Discard is not always implementable as a terminator.
|
||||
|
||||
Reference in New Issue
Block a user