amd: add nir_intrinsic_xfb_counter_sub_amd and fix overflowed streamout offsets
Fixes: 5ec79f9899
- ac/nir/ngg: nogs support streamout
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21584>
This commit is contained in:
@@ -672,6 +672,7 @@ visit_intrinsic(nir_shader *shader, nir_intrinsic_instr *instr)
|
||||
case nir_intrinsic_load_topology_id_intel:
|
||||
case nir_intrinsic_load_scratch_base_ptr:
|
||||
case nir_intrinsic_ordered_xfb_counter_add_amd:
|
||||
case nir_intrinsic_xfb_counter_sub_amd:
|
||||
case nir_intrinsic_load_stack:
|
||||
case nir_intrinsic_load_ray_launch_id:
|
||||
case nir_intrinsic_load_ray_instance_custom_index:
|
||||
|
@@ -1529,10 +1529,15 @@ intrinsic("load_streamout_buffer_amd", dest_comp=4, indices=[BASE], bit_sizes=[3
|
||||
# An ID for each workgroup ordered by primitve sequence
|
||||
system_value("ordered_id_amd", 1)
|
||||
|
||||
# Add to global streamout buffer counter in specified order
|
||||
# Add src1 to global streamout buffer offsets in the specified order
|
||||
# src[] = { ordered_id, counter }
|
||||
# WRITE_MASK = mask for counter channel to update
|
||||
intrinsic("ordered_xfb_counter_add_amd", dest_comp=0, src_comp=[1, 0], indices=[WRITE_MASK], bit_sizes=[32])
|
||||
# Subtract from global streamout buffer offsets. Used to fix up the offsets
|
||||
# when we overflow streamout buffers.
|
||||
# src[] = { offsets }
|
||||
# WRITE_MASK = mask of offsets to subtract
|
||||
intrinsic("xfb_counter_sub_amd", src_comp=[0], indices=[WRITE_MASK], bit_sizes=[32])
|
||||
|
||||
# Provoking vertex index in a primitive
|
||||
system_value("provoking_vtx_in_prim_amd", 1)
|
||||
|
Reference in New Issue
Block a user