summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-01-05 03:20:00 +0100
committerGitHub <noreply@github.com>2023-01-05 03:20:00 +0100
commitb78328f19a54964ef6874281d1a4d6b6ad1c34d9 (patch)
tree239947ad53a4a06c3641d58c5d6b8daf5b3dc16a /src/shader_recompiler/backend/glsl
parentMerge pull request #9518 from gidoly/revert-9504-pg2 (diff)
parentyuzu-ui: Add setting for disabling macro HLE (diff)
downloadyuzu-b78328f19a54964ef6874281d1a4d6b6ad1c34d9.tar
yuzu-b78328f19a54964ef6874281d1a4d6b6ad1c34d9.tar.gz
yuzu-b78328f19a54964ef6874281d1a4d6b6ad1c34d9.tar.bz2
yuzu-b78328f19a54964ef6874281d1a4d6b6ad1c34d9.tar.lz
yuzu-b78328f19a54964ef6874281d1a4d6b6ad1c34d9.tar.xz
yuzu-b78328f19a54964ef6874281d1a4d6b6ad1c34d9.tar.zst
yuzu-b78328f19a54964ef6874281d1a4d6b6ad1c34d9.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.cpp18
2 files changed, 19 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..2e369ed72 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,15 @@ 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;
+ case IR::Attribute::DrawID:
+ ctx.AddF32("{}=itof(gl_DrawID);", inst);
+ break;
default:
throw NotImplementedException("Get attribute {}", attr);
}
@@ -250,6 +259,15 @@ 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;
+ case IR::Attribute::DrawID:
+ ctx.AddU32("{}=uint(gl_DrawID);", inst);
+ break;
default:
throw NotImplementedException("Get U32 attribute {}", attr);
}