diff options
| author | 2022-11-03 22:21:58 -0700 | |
|---|---|---|
| committer | 2022-11-03 22:21:58 -0700 | |
| 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.gz yuzu-38e4382f532d606afbd3969990a9ca3bac70e557.tar.xz yuzu-38e4382f532d606afbd3969990a9ca3bac70e557.zip | |
Merge pull request #8858 from vonchenplus/mipmap
video_core: Generate mipmap texture by drawing
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) { | |||
| 416 | ctx.AddF32("{}=scaling.z;", inst); | 416 | ctx.AddF32("{}=scaling.z;", inst); |
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | void EmitRenderArea(EmitContext& ctx, IR::Inst& inst) { | ||
| 420 | ctx.AddF32x4("{}=render_area;", inst); | ||
| 421 | } | ||
| 422 | |||
| 419 | void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, std::string_view word_offset) { | 423 | void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, std::string_view word_offset) { |
| 420 | ctx.AddU32("{}=lmem[{}];", inst, word_offset); | 424 | ctx.AddU32("{}=lmem[{}];", inst, word_offset); |
| 421 | } | 425 | } |
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); | |||
| 87 | void EmitIsHelperInvocation(EmitContext& ctx, IR::Inst& inst); | 87 | void EmitIsHelperInvocation(EmitContext& ctx, IR::Inst& inst); |
| 88 | void EmitYDirection(EmitContext& ctx, IR::Inst& inst); | 88 | void EmitYDirection(EmitContext& ctx, IR::Inst& inst); |
| 89 | void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst); | 89 | void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst); |
| 90 | void EmitRenderArea(EmitContext& ctx, IR::Inst& inst); | ||
| 90 | void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, std::string_view word_offset); | 91 | void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, std::string_view word_offset); |
| 91 | void EmitWriteLocal(EmitContext& ctx, std::string_view word_offset, std::string_view value); | 92 | void EmitWriteLocal(EmitContext& ctx, std::string_view word_offset, std::string_view value); |
| 92 | void EmitUndefU1(EmitContext& ctx, IR::Inst& inst); | 93 | 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 | |||
| 358 | if (info.uses_rescaling_uniform) { | 358 | if (info.uses_rescaling_uniform) { |
| 359 | header += "layout(location=0) uniform vec4 scaling;"; | 359 | header += "layout(location=0) uniform vec4 scaling;"; |
| 360 | } | 360 | } |
| 361 | if (info.uses_render_area) { | ||
| 362 | header += "layout(location=1) uniform vec4 render_area;"; | ||
| 363 | } | ||
| 361 | DefineConstantBuffers(bindings); | 364 | DefineConstantBuffers(bindings); |
| 362 | DefineConstantBufferIndirect(); | 365 | DefineConstantBufferIndirect(); |
| 363 | DefineStorageBuffers(bindings); | 366 | DefineStorageBuffers(bindings); |