mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
anv: use primitive ID override when shader does not supply it
Patch moves over this fix from iris driver.
Fixes following test on DG2:
dEQP-VK.rasterization.culling.primitive_id
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com> [v1]
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22130>
(cherry picked from commit ca4ec49b0e)
This commit is contained in:
parent
b96362381b
commit
3c4e28cdf4
2 changed files with 14 additions and 1 deletions
|
|
@ -3208,7 +3208,7 @@
|
||||||
"description": "anv: use primitive ID override when shader does not supply it",
|
"description": "anv: use primitive ID override when shader does not supply it",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 0,
|
"nomination_type": 0,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": null
|
"because_sha": null
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -498,6 +498,19 @@ emit_3dstate_sbe(struct anv_graphics_pipeline *pipeline)
|
||||||
sbe.VertexURBEntryReadLength = DIV_ROUND_UP(max_source_attr + 1, 2);
|
sbe.VertexURBEntryReadLength = DIV_ROUND_UP(max_source_attr + 1, 2);
|
||||||
sbe.ForceVertexURBEntryReadOffset = true;
|
sbe.ForceVertexURBEntryReadOffset = true;
|
||||||
sbe.ForceVertexURBEntryReadLength = true;
|
sbe.ForceVertexURBEntryReadLength = true;
|
||||||
|
|
||||||
|
/* Ask the hardware to supply PrimitiveID if the fragment shader
|
||||||
|
* reads it but a previous stage didn't write one.
|
||||||
|
*/
|
||||||
|
if ((wm_prog_data->inputs & VARYING_BIT_PRIMITIVE_ID) &&
|
||||||
|
fs_input_map->varying_to_slot[VARYING_SLOT_PRIMITIVE_ID] == -1) {
|
||||||
|
sbe.PrimitiveIDOverrideAttributeSelect =
|
||||||
|
wm_prog_data->urb_setup[VARYING_SLOT_PRIMITIVE_ID];
|
||||||
|
sbe.PrimitiveIDOverrideComponentX = true;
|
||||||
|
sbe.PrimitiveIDOverrideComponentY = true;
|
||||||
|
sbe.PrimitiveIDOverrideComponentZ = true;
|
||||||
|
sbe.PrimitiveIDOverrideComponentW = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
assert(anv_pipeline_is_mesh(pipeline));
|
assert(anv_pipeline_is_mesh(pipeline));
|
||||||
#if GFX_VERx10 >= 125
|
#if GFX_VERx10 >= 125
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue