summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMai M <mathew1800@gmail.com>2021-08-19 23:16:37 +0200
committerGitHub <noreply@github.com>2021-08-19 23:16:37 +0200
commit519978ce704606a6e56954f8eee90fdf88824185 (patch)
tree9cb115784d035a282d205f4ffd9f7e4f94965061
parentMerge pull request #6886 from Morph1984/error-code-64 (diff)
parentSPIR-V: Merge two ifs in EmitGetAttribute (diff)
downloadyuzu-519978ce704606a6e56954f8eee90fdf88824185.tar
yuzu-519978ce704606a6e56954f8eee90fdf88824185.tar.gz
yuzu-519978ce704606a6e56954f8eee90fdf88824185.tar.bz2
yuzu-519978ce704606a6e56954f8eee90fdf88824185.tar.lz
yuzu-519978ce704606a6e56954f8eee90fdf88824185.tar.xz
yuzu-519978ce704606a6e56954f8eee90fdf88824185.tar.zst
yuzu-519978ce704606a6e56954f8eee90fdf88824185.zip
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp8
1 files changed, 2 insertions, 6 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 fb8c02a77..14c77f162 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,14 +298,10 @@ 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) {
- // Attribute is disabled
+ if (!type || !ctx.runtime_info.previous_stage_stores.Generic(index, element)) {
+ // Attribute is disabled or varying component is not written
return ctx.Const(element == 3 ? 1.0f : 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)};