summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2022-12-06 22:32:59 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2023-01-01 22:43:58 +0100
commit8d694701bcd97c3766692dff2a9b4ec2f3a64ebd (patch)
tree6fe6f656a60c830c1114e4da806359ca1b649009 /src/shader_recompiler/backend/glsl
parentVulkan: Add other additional pipeline specs (diff)
downloadyuzu-8d694701bcd97c3766692dff2a9b4ec2f3a64ebd.tar
yuzu-8d694701bcd97c3766692dff2a9b4ec2f3a64ebd.tar.gz
yuzu-8d694701bcd97c3766692dff2a9b4ec2f3a64ebd.tar.bz2
yuzu-8d694701bcd97c3766692dff2a9b4ec2f3a64ebd.tar.lz
yuzu-8d694701bcd97c3766692dff2a9b4ec2f3a64ebd.tar.xz
yuzu-8d694701bcd97c3766692dff2a9b4ec2f3a64ebd.tar.zst
yuzu-8d694701bcd97c3766692dff2a9b4ec2f3a64ebd.zip
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl.cpp2
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp12
2 files changed, 13 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.cpp b/src/shader_recompiler/backend/glsl/emit_glsl.cpp
index e8a4390f6..d91e04446 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl.cpp
@@ -219,7 +219,7 @@ std::string EmitGLSL(const Profile& profile, const RuntimeInfo& runtime_info, IR
EmitContext ctx{program, bindings, profile, runtime_info};
Precolor(program);
EmitCode(ctx, program);
- const std::string version{fmt::format("#version 450{}\n", GlslVersionSpecifier(ctx))};
+ const std::string version{fmt::format("#version 460{}\n", GlslVersionSpecifier(ctx))};
ctx.header.insert(0, version);
if (program.shared_memory_size > 0) {
const auto requested_size{program.shared_memory_size};
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
index 39579cf5d..25106da67 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp
@@ -234,6 +234,12 @@ void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr,
case IR::Attribute::FrontFace:
ctx.AddF32("{}=itof(gl_FrontFacing?-1:0);", inst);
break;
+ case IR::Attribute::BaseInstance:
+ ctx.AddF32("{}=itof(gl_BaseInstance);", inst);
+ break;
+ case IR::Attribute::BaseVertex:
+ ctx.AddF32("{}=itof(gl_BaseVertex);", inst);
+ break;
default:
throw NotImplementedException("Get attribute {}", attr);
}
@@ -250,6 +256,12 @@ void EmitGetAttributeU32(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr, s
case IR::Attribute::VertexId:
ctx.AddU32("{}=uint(gl_VertexID);", inst);
break;
+ case IR::Attribute::BaseInstance:
+ ctx.AddU32("{}=uint(gl_BaseInstance);", inst);
+ break;
+ case IR::Attribute::BaseVertex:
+ ctx.AddU32("{}=uint(gl_BaseVertex);", inst);
+ break;
default:
throw NotImplementedException("Get U32 attribute {}", attr);
}