diff options
author | bunnei <bunneidev@gmail.com> | 2022-11-04 06:21:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-04 06:21:58 +0100 |
commit | 38e4382f532d606afbd3969990a9ca3bac70e557 (patch) | |
tree | b9af6ed0a26285f4b0dcd5c21028601004267607 /src/shader_recompiler/backend/glsl | |
parent | Merge pull request #9135 from liamwhite/service-thread-event (diff) | |
parent | Merge branch 'master' into mipmap (diff) | |
download | yuzu-38e4382f532d606afbd3969990a9ca3bac70e557.tar yuzu-38e4382f532d606afbd3969990a9ca3bac70e557.tar.gz yuzu-38e4382f532d606afbd3969990a9ca3bac70e557.tar.bz2 yuzu-38e4382f532d606afbd3969990a9ca3bac70e557.tar.lz yuzu-38e4382f532d606afbd3969990a9ca3bac70e557.tar.xz yuzu-38e4382f532d606afbd3969990a9ca3bac70e557.tar.zst yuzu-38e4382f532d606afbd3969990a9ca3bac70e557.zip |
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
3 files changed, 8 insertions, 0 deletions
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 fad8d1e30..d7c845469 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 @@ -416,6 +416,10 @@ void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst) { ctx.AddF32("{}=scaling.z;", inst); } +void EmitRenderArea(EmitContext& ctx, IR::Inst& inst) { + ctx.AddF32x4("{}=render_area;", inst); +} + void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, std::string_view word_offset) { ctx.AddU32("{}=lmem[{}];", inst, word_offset); } diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h index 639691ba6..3c8bcb7e9 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h +++ b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h @@ -87,6 +87,7 @@ void EmitSampleId(EmitContext& ctx, IR::Inst& inst); void EmitIsHelperInvocation(EmitContext& ctx, IR::Inst& inst); void EmitYDirection(EmitContext& ctx, IR::Inst& inst); void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst); +void EmitRenderArea(EmitContext& ctx, IR::Inst& inst); void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, std::string_view word_offset); void EmitWriteLocal(EmitContext& ctx, std::string_view word_offset, std::string_view value); void EmitUndefU1(EmitContext& ctx, IR::Inst& inst); diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp index c767a9dc3..5d01ec0cd 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp @@ -358,6 +358,9 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile if (info.uses_rescaling_uniform) { header += "layout(location=0) uniform vec4 scaling;"; } + if (info.uses_render_area) { + header += "layout(location=1) uniform vec4 render_area;"; + } DefineConstantBuffers(bindings); DefineConstantBufferIndirect(); DefineStorageBuffers(bindings); |