radv: Add radv_gather_unlinked_io_mask to shader info header.
We will call this from another file. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28488>
This commit is contained in:
@@ -453,8 +453,8 @@ gather_shader_info_ngg_query(struct radv_device *device, struct radv_shader_info
|
|||||||
info->has_prim_query = device->cache_key.primitives_generated_query || info->has_xfb_query;
|
info->has_prim_query = device->cache_key.primitives_generated_query || info->has_xfb_query;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t
|
uint64_t
|
||||||
gather_io_mask(const uint64_t nir_mask)
|
radv_gather_unlinked_io_mask(const uint64_t nir_mask)
|
||||||
{
|
{
|
||||||
/* Select the correct NIR IO mask.
|
/* Select the correct NIR IO mask.
|
||||||
* Exclude per-patch built-in variables, because in NIR they are not part of the patch I/O masks.
|
* Exclude per-patch built-in variables, because in NIR they are not part of the patch I/O masks.
|
||||||
@@ -481,7 +481,7 @@ gather_info_unlinked_input(struct radv_shader_info *info, const nir_shader *nir)
|
|||||||
if (info->inputs_linked)
|
if (info->inputs_linked)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const uint64_t io_mask = gather_io_mask(nir->info.inputs_read);
|
const uint64_t io_mask = radv_gather_unlinked_io_mask(nir->info.inputs_read);
|
||||||
const unsigned num_linked_inputs = util_last_bit64(io_mask);
|
const unsigned num_linked_inputs = util_last_bit64(io_mask);
|
||||||
|
|
||||||
switch (nir->info.stage) {
|
switch (nir->info.stage) {
|
||||||
@@ -505,7 +505,7 @@ gather_info_unlinked_output(struct radv_shader_info *info, const nir_shader *nir
|
|||||||
if (info->outputs_linked)
|
if (info->outputs_linked)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const uint64_t io_mask = gather_io_mask(nir->info.outputs_written);
|
const uint64_t io_mask = radv_gather_unlinked_io_mask(nir->info.outputs_written);
|
||||||
const unsigned num_linked_outputs = util_last_bit64(io_mask);
|
const unsigned num_linked_outputs = util_last_bit64(io_mask);
|
||||||
|
|
||||||
switch (nir->info.stage) {
|
switch (nir->info.stage) {
|
||||||
|
@@ -264,4 +264,6 @@ void radv_nir_shader_info_link(struct radv_device *device, const struct radv_gra
|
|||||||
|
|
||||||
enum ac_hw_stage radv_select_hw_stage(const struct radv_shader_info *const info, const enum amd_gfx_level gfx_level);
|
enum ac_hw_stage radv_select_hw_stage(const struct radv_shader_info *const info, const enum amd_gfx_level gfx_level);
|
||||||
|
|
||||||
|
uint64_t radv_gather_unlinked_io_mask(const uint64_t nir_mask);
|
||||||
|
|
||||||
#endif /* RADV_SHADER_INFO_H */
|
#endif /* RADV_SHADER_INFO_H */
|
||||||
|
Reference in New Issue
Block a user