asahi: Identify triangle/lines vs point varyings
Seems to allow skipping over point coords? Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11818>
This commit is contained in:

committed by
Marge Bot

parent
e2176490d6
commit
3d75cff7d7
@@ -1212,7 +1212,7 @@ agx_remap_varyings_fs(nir_shader *nir, struct agx_varyings *varyings,
|
||||
agx_pack(packed, VARYING, cfg) {
|
||||
cfg.type = AGX_VARYING_TYPE_FRAGCOORD_W;
|
||||
cfg.components = 1;
|
||||
cfg.slot_1 = cfg.slot_2 = base;
|
||||
cfg.triangle_slot = cfg.point_slot = base;
|
||||
}
|
||||
|
||||
base++;
|
||||
@@ -1221,7 +1221,7 @@ agx_remap_varyings_fs(nir_shader *nir, struct agx_varyings *varyings,
|
||||
agx_pack(packed, VARYING, cfg) {
|
||||
cfg.type = AGX_VARYING_TYPE_FRAGCOORD_Z;
|
||||
cfg.components = 1;
|
||||
cfg.slot_1 = cfg.slot_2 = base;
|
||||
cfg.triangle_slot = cfg.point_slot = base;
|
||||
}
|
||||
|
||||
base++;
|
||||
@@ -1258,7 +1258,7 @@ agx_remap_varyings_fs(nir_shader *nir, struct agx_varyings *varyings,
|
||||
AGX_VARYING_TYPE_FLAT_LAST :
|
||||
AGX_VARYING_TYPE_SMOOTH;
|
||||
cfg.components = channels;
|
||||
cfg.slot_1 = cfg.slot_2 = base;
|
||||
cfg.triangle_slot = cfg.point_slot = base;
|
||||
}
|
||||
|
||||
base += channels;
|
||||
|
@@ -130,8 +130,8 @@
|
||||
</enum>
|
||||
|
||||
<struct name="Varying header" size="4">
|
||||
<field name="Slots 1" size="8" start="0:0" type="uint"/>
|
||||
<field name="Slots 2" size="8" start="0:8" type="uint"/>
|
||||
<field name="Triangle slots" size="8" start="0:0" type="uint"/>
|
||||
<field name="Point slots" size="8" start="0:8" type="uint"/>
|
||||
</struct>
|
||||
|
||||
<enum name="Varying Type">
|
||||
@@ -140,13 +140,14 @@
|
||||
<value name="Fragcoord W" value="3"/>
|
||||
<value name="Smooth" value="7"/>
|
||||
<value name="Fragcoord Z" value="11"/>
|
||||
<value name="Point coordinates" value="19"/>
|
||||
</enum>
|
||||
|
||||
<struct name="Varying" size="4">
|
||||
<field name="Components" size="2" start="0" type="uint" modifier="minus(1)"/>
|
||||
<field name="Type" size="6" start="2" type="Varying Type" default="Smooth"/>
|
||||
<field name="Slot 1" size="8" start="8" type="uint"/>
|
||||
<field name="Slot 2" size="8" start="16" type="uint"/>
|
||||
<field name="Triangle slot" size="8" start="8" type="uint"/>
|
||||
<field name="Point slot" size="8" start="16" type="uint"/>
|
||||
</struct>
|
||||
|
||||
<struct name="Format" size="2">
|
||||
|
@@ -895,7 +895,7 @@ agx_update_shader(struct agx_context *ctx, struct agx_compiled_shader **out,
|
||||
uint8_t *packed_varyings = alloca(packed_varying_sz);
|
||||
|
||||
agx_pack(packed_varyings, VARYING_HEADER, cfg) {
|
||||
cfg.slots_1 = cfg.slots_2 = varyings->nr_slots;
|
||||
cfg.triangle_slots = cfg.point_slots = varyings->nr_slots;
|
||||
}
|
||||
|
||||
memcpy(packed_varyings + AGX_VARYING_HEADER_LENGTH, varyings->packed,
|
||||
|
Reference in New Issue
Block a user