diff options
| author | 2022-12-06 22:32:59 +0100 | |
|---|---|---|
| committer | 2023-01-01 16:43:58 -0500 | |
| commit | 8d694701bcd97c3766692dff2a9b4ec2f3a64ebd (patch) | |
| tree | 6fe6f656a60c830c1114e4da806359ca1b649009 /src/shader_recompiler/backend/glsl | |
| parent | Vulkan: Add other additional pipeline specs (diff) | |
| download | yuzu-8d694701bcd97c3766692dff2a9b4ec2f3a64ebd.tar.gz yuzu-8d694701bcd97c3766692dff2a9b4ec2f3a64ebd.tar.xz yuzu-8d694701bcd97c3766692dff2a9b4ec2f3a64ebd.zip | |
MacroHLE: Add OpenGL Support
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl.cpp | 2 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp | 12 |
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 | |||
| 219 | EmitContext ctx{program, bindings, profile, runtime_info}; | 219 | EmitContext ctx{program, bindings, profile, runtime_info}; |
| 220 | Precolor(program); | 220 | Precolor(program); |
| 221 | EmitCode(ctx, program); | 221 | EmitCode(ctx, program); |
| 222 | const std::string version{fmt::format("#version 450{}\n", GlslVersionSpecifier(ctx))}; | 222 | const std::string version{fmt::format("#version 460{}\n", GlslVersionSpecifier(ctx))}; |
| 223 | ctx.header.insert(0, version); | 223 | ctx.header.insert(0, version); |
| 224 | if (program.shared_memory_size > 0) { | 224 | if (program.shared_memory_size > 0) { |
| 225 | const auto requested_size{program.shared_memory_size}; | 225 | 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, | |||
| 234 | case IR::Attribute::FrontFace: | 234 | case IR::Attribute::FrontFace: |
| 235 | ctx.AddF32("{}=itof(gl_FrontFacing?-1:0);", inst); | 235 | ctx.AddF32("{}=itof(gl_FrontFacing?-1:0);", inst); |
| 236 | break; | 236 | break; |
| 237 | case IR::Attribute::BaseInstance: | ||
| 238 | ctx.AddF32("{}=itof(gl_BaseInstance);", inst); | ||
| 239 | break; | ||
| 240 | case IR::Attribute::BaseVertex: | ||
| 241 | ctx.AddF32("{}=itof(gl_BaseVertex);", inst); | ||
| 242 | break; | ||
| 237 | default: | 243 | default: |
| 238 | throw NotImplementedException("Get attribute {}", attr); | 244 | throw NotImplementedException("Get attribute {}", attr); |
| 239 | } | 245 | } |
| @@ -250,6 +256,12 @@ void EmitGetAttributeU32(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr, s | |||
| 250 | case IR::Attribute::VertexId: | 256 | case IR::Attribute::VertexId: |
| 251 | ctx.AddU32("{}=uint(gl_VertexID);", inst); | 257 | ctx.AddU32("{}=uint(gl_VertexID);", inst); |
| 252 | break; | 258 | break; |
| 259 | case IR::Attribute::BaseInstance: | ||
| 260 | ctx.AddU32("{}=uint(gl_BaseInstance);", inst); | ||
| 261 | break; | ||
| 262 | case IR::Attribute::BaseVertex: | ||
| 263 | ctx.AddU32("{}=uint(gl_BaseVertex);", inst); | ||
| 264 | break; | ||
| 253 | default: | 265 | default: |
| 254 | throw NotImplementedException("Get U32 attribute {}", attr); | 266 | throw NotImplementedException("Get U32 attribute {}", attr); |
| 255 | } | 267 | } |