diff --git a/src/asahi/lib/agx_device.h b/src/asahi/lib/agx_device.h index f8842efb333..6de83be68c6 100644 --- a/src/asahi/lib/agx_device.h +++ b/src/asahi/lib/agx_device.h @@ -30,7 +30,7 @@ enum agx_dbg { AGX_DBG_SMALLTILE = BITFIELD_BIT(14), AGX_DBG_NOMSAA = BITFIELD_BIT(15), AGX_DBG_NOSHADOW = BITFIELD_BIT(16), - AGX_DBG_VARYINGS = BITFIELD_BIT(17), + /* bit 17 unused */ AGX_DBG_SCRATCH = BITFIELD_BIT(18), AGX_DBG_COMPBLIT = BITFIELD_BIT(19), AGX_DBG_FEEDBACK = BITFIELD_BIT(20), diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index d232f035bcf..ec1352c0fec 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -79,7 +79,6 @@ static const struct debug_named_value agx_debug_options[] = { {"feedback", AGX_DBG_FEEDBACK, "Debug feedback loops"}, {"nomsaa", AGX_DBG_NOMSAA, "Force disable MSAA"}, {"noshadow", AGX_DBG_NOSHADOW, "Force disable resource shadowing"}, - {"varyings", AGX_DBG_VARYINGS, "Validate varying linkage"}, {"scratch", AGX_DBG_SCRATCH, "Debug scratch memory usage"}, DEBUG_NAMED_VALUE_END }; diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 82ce2cfb0be..693ddfcbca9 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -1523,7 +1523,7 @@ asahi_cs_shader_key_equal(const void *a, const void *b) static unsigned agx_find_linked_slot(struct agx_varyings_vs *vs, struct agx_varyings_fs *fs, - gl_varying_slot slot, unsigned offset, bool debug) + gl_varying_slot slot, unsigned offset) { assert(offset < 4); assert(slot != VARYING_SLOT_PNTC && "point coords aren't linked"); @@ -1541,19 +1541,9 @@ agx_find_linked_slot(struct agx_varyings_vs *vs, struct agx_varyings_fs *fs, unsigned vs_index = vs->slots[slot]; - if (!(vs_index < vs->nr_index)) { - /* Varyings not written by vertex shader are undefined, be robust. - * - * If the layer is read but not written, its value will be ignored by the - * agx_nir_predicate_layer_id lowering, so read garbage. - * - * For other varyings, this is probably an app bug. - */ - if (unlikely(debug && (slot != VARYING_SLOT_LAYER))) - unreachable("Fragment shader read varying not written by vertex!"); - + /* Varyings not written by vertex shader are undefined but we can't crash */ + if (!(vs_index < vs->nr_index)) return 0; - } assert(vs_index >= 4 && "gl_Position should have been the first 4 slots"); assert((vs_index < vs->base_index_fp16) == @@ -1623,9 +1613,8 @@ agx_link_varyings_vs_fs(struct agx_pool *pool, struct agx_varyings_vs *vs, cfg.source = AGX_COEFFICIENT_SOURCE_PRIMITIVE_ID; *generate_primitive_id = true; } else { - cfg.base_slot = agx_find_linked_slot( - vs, fs, fs->bindings[i].slot, fs->bindings[i].offset, - pool->dev->debug & AGX_DBG_VARYINGS); + cfg.base_slot = agx_find_linked_slot(vs, fs, fs->bindings[i].slot, + fs->bindings[i].offset); assert(cfg.base_slot + cfg.components <= MAX2(nr_slots, cfg.components) &&