diff options
| author | 2021-05-20 21:54:02 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:32 -0400 | |
| commit | 394b96a2fe0fb7c93052f043383889e46ff6202a (patch) | |
| tree | d19c015f419e7723770d01768a054be32f18cbee /src/shader_recompiler/backend | |
| parent | glasm: Fix tessellation input attributes (diff) | |
| download | yuzu-394b96a2fe0fb7c93052f043383889e46ff6202a.tar.gz yuzu-394b96a2fe0fb7c93052f043383889e46ff6202a.tar.xz yuzu-394b96a2fe0fb7c93052f043383889e46ff6202a.zip | |
glasm: Implement clip distance stores
Diffstat (limited to 'src/shader_recompiler/backend')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_context.cpp | 3 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.cpp b/src/shader_recompiler/backend/glasm/emit_context.cpp index bb68b3d19..e82c8995a 100644 --- a/src/shader_recompiler/backend/glasm/emit_context.cpp +++ b/src/shader_recompiler/backend/glasm/emit_context.cpp | |||
| @@ -86,6 +86,9 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile | |||
| 86 | if (info.stores_tess_level_inner) { | 86 | if (info.stores_tess_level_inner) { |
| 87 | Add("OUTPUT result_patch_tessinner[]={{result.patch.tessinner[0..1]}};"); | 87 | Add("OUTPUT result_patch_tessinner[]={{result.patch.tessinner[0..1]}};"); |
| 88 | } | 88 | } |
| 89 | if (info.stores_clip_distance) { | ||
| 90 | Add("OUTPUT result_clip[]={{result.clip[0..7]}};"); | ||
| 91 | } | ||
| 89 | for (size_t index = 0; index < info.uses_patches.size(); ++index) { | 92 | for (size_t index = 0; index < info.uses_patches.size(); ++index) { |
| 90 | if (!info.uses_patches[index]) { | 93 | if (!info.uses_patches[index]) { |
| 91 | continue; | 94 | continue; |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp index 7a084508d..b64025420 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp | |||
| @@ -121,6 +121,18 @@ void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, ScalarF32 value, | |||
| 121 | case IR::Attribute::PositionW: | 121 | case IR::Attribute::PositionW: |
| 122 | ctx.Add("MOV.F result.position.{},{};", swizzle, value); | 122 | ctx.Add("MOV.F result.position.{},{};", swizzle, value); |
| 123 | break; | 123 | break; |
| 124 | case IR::Attribute::ClipDistance0: | ||
| 125 | case IR::Attribute::ClipDistance1: | ||
| 126 | case IR::Attribute::ClipDistance2: | ||
| 127 | case IR::Attribute::ClipDistance3: | ||
| 128 | case IR::Attribute::ClipDistance4: | ||
| 129 | case IR::Attribute::ClipDistance5: | ||
| 130 | case IR::Attribute::ClipDistance6: | ||
| 131 | case IR::Attribute::ClipDistance7: { | ||
| 132 | const u32 index{static_cast<u32>(attr) - static_cast<u32>(IR::Attribute::ClipDistance0)}; | ||
| 133 | ctx.Add("MOV.F result.clip[{}].x,{};", index, value); | ||
| 134 | break; | ||
| 135 | } | ||
| 124 | case IR::Attribute::ViewportIndex: | 136 | case IR::Attribute::ViewportIndex: |
| 125 | if (ctx.stage == Stage::Geometry || ctx.profile.support_viewport_index_layer_non_geometry) { | 137 | if (ctx.stage == Stage::Geometry || ctx.profile.support_viewport_index_layer_non_geometry) { |
| 126 | ctx.Add("MOV.F result.viewport.x,{};", value); | 138 | ctx.Add("MOV.F result.viewport.x,{};", value); |