diff options
| author | 2021-06-16 04:59:30 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:38 -0400 | |
| commit | 374eeda1a35f6a1dc81cf22122c701be68e89c0f (patch) | |
| tree | 1155e56fffab693fe2c66ca38e6a435562c21b6d /src/shader_recompiler/backend/spirv | |
| parent | glsl: Only declare fragment outputs on fragment shaders (diff) | |
| download | yuzu-374eeda1a35f6a1dc81cf22122c701be68e89c0f.tar.gz yuzu-374eeda1a35f6a1dc81cf22122c701be68e89c0f.tar.xz yuzu-374eeda1a35f6a1dc81cf22122c701be68e89c0f.zip | |
shader: Properly manage attributes not written from previous stages
Diffstat (limited to 'src/shader_recompiler/backend/spirv')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_context.cpp | 3 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp index 007b79650..612d087ad 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/emit_context.cpp | |||
| @@ -1209,6 +1209,9 @@ void EmitContext::DefineInputs(const Info& info) { | |||
| 1209 | tess_coord = DefineInput(*this, F32[3], false, spv::BuiltIn::TessCoord); | 1209 | tess_coord = DefineInput(*this, F32[3], false, spv::BuiltIn::TessCoord); |
| 1210 | } | 1210 | } |
| 1211 | for (size_t index = 0; index < info.input_generics.size(); ++index) { | 1211 | for (size_t index = 0; index < info.input_generics.size(); ++index) { |
| 1212 | if (!runtime_info.previous_stage_stores_generic[index]) { | ||
| 1213 | continue; | ||
| 1214 | } | ||
| 1212 | const InputVarying generic{info.input_generics[index]}; | 1215 | const InputVarying generic{info.input_generics[index]}; |
| 1213 | if (!generic.used) { | 1216 | if (!generic.used) { |
| 1214 | continue; | 1217 | continue; |
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 42fff74e3..4ac1fbae5 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 | |||
| @@ -286,7 +286,7 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, Id vertex) { | |||
| 286 | if (IR::IsGeneric(attr)) { | 286 | if (IR::IsGeneric(attr)) { |
| 287 | const u32 index{IR::GenericAttributeIndex(attr)}; | 287 | const u32 index{IR::GenericAttributeIndex(attr)}; |
| 288 | const std::optional<AttrInfo> type{AttrTypes(ctx, index)}; | 288 | const std::optional<AttrInfo> type{AttrTypes(ctx, index)}; |
| 289 | if (!type) { | 289 | if (!type || !ctx.runtime_info.previous_stage_stores_generic[index]) { |
| 290 | // Attribute is disabled | 290 | // Attribute is disabled |
| 291 | return ctx.Const(0.0f); | 291 | return ctx.Const(0.0f); |
| 292 | } | 292 | } |