mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
anv: include ClipDistance array in mesh shader per-vertex output
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13662>
This commit is contained in:
parent
c95b4ac2eb
commit
27c32fd14b
1 changed files with 16 additions and 0 deletions
|
|
@ -509,6 +509,22 @@ emit_3dstate_sbe(struct anv_graphics_pipeline *pipeline)
|
|||
sbe_mesh.PerVertexURBEntryOutputReadOffset = mue->per_vertex_header_size_dw / 8;
|
||||
sbe_mesh.PerVertexURBEntryOutputReadLength = DIV_ROUND_UP(mue->per_vertex_data_size_dw, 8);
|
||||
|
||||
/* Clip distance array is passed in the per-vertex header so that
|
||||
* it can be consumed by the HW. If user wants to read it in the FS,
|
||||
* adjust the offset and length to cover it. Conveniently it is at
|
||||
* the end of the per-vertex header, right before per-vertex
|
||||
* attributes.
|
||||
*
|
||||
* Note that FS attribute reading must be aware that the clip
|
||||
* distances have fixed position.
|
||||
*/
|
||||
if (mue->per_vertex_header_size_dw > 8 &&
|
||||
(wm_prog_data->urb_setup[VARYING_SLOT_CLIP_DIST0] >= 0 ||
|
||||
wm_prog_data->urb_setup[VARYING_SLOT_CLIP_DIST1] >= 0)) {
|
||||
sbe_mesh.PerVertexURBEntryOutputReadOffset -= 1;
|
||||
sbe_mesh.PerVertexURBEntryOutputReadLength += 1;
|
||||
}
|
||||
|
||||
assert(mue->per_primitive_header_size_dw % 8 == 0);
|
||||
sbe_mesh.PerPrimitiveURBEntryOutputReadOffset = mue->per_primitive_header_size_dw / 8;
|
||||
sbe_mesh.PerPrimitiveURBEntryOutputReadLength = DIV_ROUND_UP(mue->per_primitive_data_size_dw, 8);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue