diff options
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 | 18 |
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 | |||
| 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..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, | |||
| 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; | ||
| 243 | case IR::Attribute::DrawID: | ||
| 244 | ctx.AddF32("{}=itof(gl_DrawID);", inst); | ||
| 245 | break; | ||
| 237 | default: | 246 | default: |
| 238 | throw NotImplementedException("Get attribute {}", attr); | 247 | throw NotImplementedException("Get attribute {}", attr); |
| 239 | } | 248 | } |
| @@ -250,6 +259,15 @@ void EmitGetAttributeU32(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr, s | |||
| 250 | case IR::Attribute::VertexId: | 259 | case IR::Attribute::VertexId: |
| 251 | ctx.AddU32("{}=uint(gl_VertexID);", inst); | 260 | ctx.AddU32("{}=uint(gl_VertexID);", inst); |
| 252 | break; | 261 | break; |
| 262 | case IR::Attribute::BaseInstance: | ||
| 263 | ctx.AddU32("{}=uint(gl_BaseInstance);", inst); | ||
| 264 | break; | ||
| 265 | case IR::Attribute::BaseVertex: | ||
| 266 | ctx.AddU32("{}=uint(gl_BaseVertex);", inst); | ||
| 267 | break; | ||
| 268 | case IR::Attribute::DrawID: | ||
| 269 | ctx.AddU32("{}=uint(gl_DrawID);", inst); | ||
| 270 | break; | ||
| 253 | default: | 271 | default: |
| 254 | throw NotImplementedException("Get U32 attribute {}", attr); | 272 | throw NotImplementedException("Get U32 attribute {}", attr); |
| 255 | } | 273 | } |