shader: Properly manage attributes not written from previous stages
This commit is contained in:
parent
892b8aa2ad
commit
374eeda1a3
12 changed files with 62 additions and 41 deletions
|
@ -1209,6 +1209,9 @@ void EmitContext::DefineInputs(const Info& info) {
|
|||
tess_coord = DefineInput(*this, F32[3], false, spv::BuiltIn::TessCoord);
|
||||
}
|
||||
for (size_t index = 0; index < info.input_generics.size(); ++index) {
|
||||
if (!runtime_info.previous_stage_stores_generic[index]) {
|
||||
continue;
|
||||
}
|
||||
const InputVarying generic{info.input_generics[index]};
|
||||
if (!generic.used) {
|
||||
continue;
|
||||
|
|
|
@ -286,7 +286,7 @@ 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) {
|
||||
if (!type || !ctx.runtime_info.previous_stage_stores_generic[index]) {
|
||||
// Attribute is disabled
|
||||
return ctx.Const(0.0f);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue