summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-06-26 06:14:06 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:39 +0200
commit5643a909bc3fa9f497d2f2e68650f823ed2944ac (patch)
tree9fd367abf424ed751d0053e22b7bc53ed6b4e61c /src/shader_recompiler/backend/glsl
parentglsl: Fix shared and local memory declarations (diff)
downloadyuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar.gz
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar.bz2
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar.lz
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar.xz
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar.zst
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.zip
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_context_get_set.cpp8
1 files changed, 6 insertions, 2 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 16e2a8502..d5424301b 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
@@ -179,8 +179,12 @@ void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr,
const char swizzle{"xyzw"[element]};
if (IR::IsGeneric(attr)) {
const u32 index{IR::GenericAttributeIndex(attr)};
- if (!ctx.runtime_info.previous_stage_stores.Generic(index)) {
- ctx.AddF32("{}=0.f;", inst, attr);
+ if (!ctx.runtime_info.previous_stage_stores.Generic(index, element)) {
+ if (element == 3) {
+ ctx.AddF32("{}=1.f;", inst, attr);
+ } else {
+ ctx.AddF32("{}=0.f;", inst, attr);
+ }
return;
}
ctx.AddF32("{}=in_attr{}{}.{};", inst, index, InputVertexIndex(ctx, vertex), swizzle);