diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-06-26 06:14:06 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:39 +0200 |
commit | 5643a909bc3fa9f497d2f2e68650f823ed2944ac (patch) | |
tree | 9fd367abf424ed751d0053e22b7bc53ed6b4e61c /src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | |
parent | glsl: Fix shared and local memory declarations (diff) | |
download | yuzu-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 '')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index 77fbb2b2f..756de0a27 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp @@ -298,10 +298,14 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, Id vertex) { if (IR::IsGeneric(attr)) { const u32 index{IR::GenericAttributeIndex(attr)}; const std::optional<AttrInfo> type{AttrTypes(ctx, index)}; - if (!type || !ctx.runtime_info.previous_stage_stores.Generic(index)) { + if (!type) { // Attribute is disabled return ctx.Const(0.0f); } + if (!ctx.runtime_info.previous_stage_stores.Generic(index, element)) { + // Varying component is not written + return ctx.Const(type && element == 3 ? 1.0f : 0.0f); + } const Id generic_id{ctx.input_generics.at(index)}; const Id pointer{AttrPointer(ctx, type->pointer, vertex, generic_id, ctx.Const(element))}; const Id value{ctx.OpLoad(type->id, pointer)}; |