VERY experimental Nintendo Switch 2 emulator
C++
glsl: implement set clip distance
ameerjc6615e9d0568
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.cpp b/src/shader_recompiler/backend/glsl/emit_glsl.cppindex 4304ee4d5f..f0257db7f8 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) {ir.PhiMove(phi, IR::Value{arg.InstRecursive()});}}+ for (size_t i = 0; i < num_args; ++i) {+ IR::IREmitter{*phi.PhiBlock(i)}.Reference(IR::Value{&phi});+ }}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.cppindex 8688686e8a..8f5f947527 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 valcase IR::Attribute::PositionW:ctx.Add("gl_Position.{}={};", swizzle, value);break;+ case IR::Attribute::ClipDistance0:+ case IR::Attribute::ClipDistance1:+ case IR::Attribute::ClipDistance2:+ case IR::Attribute::ClipDistance3:+ case IR::Attribute::ClipDistance4:+ case IR::Attribute::ClipDistance5:+ case IR::Attribute::ClipDistance6:+ case IR::Attribute::ClipDistance7: {+ const u32 index{static_cast<u32>(attr) - static_cast<u32>(IR::Attribute::ClipDistance0)};+ ctx.Add("gl_ClipDistance[{}]={};", index, value);+ break;+ }default:fmt::print("Set attribute {}", attr);throw NotImplementedException("Set attribute {}", attr);