diff options
| author | 2021-05-30 19:21:30 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:37 -0400 | |
| commit | 8ec0028e687f0ace26e0a4abf8ffbe1abb19653d (patch) | |
| tree | 6d28ebc2067f811814eeb9e18836ab1915cf8e28 /src/shader_recompiler/backend | |
| parent | glsl: Rework var alloc to not assign unused results (diff) | |
| download | yuzu-8ec0028e687f0ace26e0a4abf8ffbe1abb19653d.tar.gz yuzu-8ec0028e687f0ace26e0a4abf8ffbe1abb19653d.tar.xz yuzu-8ec0028e687f0ace26e0a4abf8ffbe1abb19653d.zip | |
glsl: implement set clip distance
and missed a diff in emit_glsl relating to var alloc ref counting
Diffstat (limited to 'src/shader_recompiler/backend')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl.cpp | 3 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.cpp b/src/shader_recompiler/backend/glsl/emit_glsl.cpp index 4304ee4d5..f0257db7f 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl.cpp | |||
| @@ -112,6 +112,9 @@ void PrecolorInst(IR::Inst& phi) { | |||
| 112 | ir.PhiMove(phi, IR::Value{arg.InstRecursive()}); | 112 | ir.PhiMove(phi, IR::Value{arg.InstRecursive()}); |
| 113 | } | 113 | } |
| 114 | } | 114 | } |
| 115 | for (size_t i = 0; i < num_args; ++i) { | ||
| 116 | IR::IREmitter{*phi.PhiBlock(i)}.Reference(IR::Value{&phi}); | ||
| 117 | } | ||
| 115 | } | 118 | } |
| 116 | 119 | ||
| 117 | void Precolor(const IR::Program& program) { | 120 | void Precolor(const IR::Program& program) { |
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 8688686e8..8f5f94752 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 | |||
| @@ -186,6 +186,18 @@ void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, std::string_view val | |||
| 186 | case IR::Attribute::PositionW: | 186 | case IR::Attribute::PositionW: |
| 187 | ctx.Add("gl_Position.{}={};", swizzle, value); | 187 | ctx.Add("gl_Position.{}={};", swizzle, value); |
| 188 | break; | 188 | break; |
| 189 | case IR::Attribute::ClipDistance0: | ||
| 190 | case IR::Attribute::ClipDistance1: | ||
| 191 | case IR::Attribute::ClipDistance2: | ||
| 192 | case IR::Attribute::ClipDistance3: | ||
| 193 | case IR::Attribute::ClipDistance4: | ||
| 194 | case IR::Attribute::ClipDistance5: | ||
| 195 | case IR::Attribute::ClipDistance6: | ||
| 196 | case IR::Attribute::ClipDistance7: { | ||
| 197 | const u32 index{static_cast<u32>(attr) - static_cast<u32>(IR::Attribute::ClipDistance0)}; | ||
| 198 | ctx.Add("gl_ClipDistance[{}]={};", index, value); | ||
| 199 | break; | ||
| 200 | } | ||
| 189 | default: | 201 | default: |
| 190 | fmt::print("Set attribute {}", attr); | 202 | fmt::print("Set attribute {}", attr); |
| 191 | throw NotImplementedException("Set attribute {}", attr); | 203 | throw NotImplementedException("Set attribute {}", attr); |