mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 20:40:09 +01:00
libagx: export coordinate twiddle routine
we'll use for both image atomics and fast-clears Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35662>
This commit is contained in:
parent
319a6259d9
commit
908d12d346
2 changed files with 10 additions and 6 deletions
|
|
@ -25,3 +25,7 @@ void nir_bindless_image_store(uint2 handle, int4 coord, uint sample,
|
|||
uint4 datum, uint lod, uint image_dim,
|
||||
uint image_array, uint format, uint access,
|
||||
uint src_type);
|
||||
|
||||
uint32_t libagx_twiddle_coordinates(ushort2 coord, uint16_t tile_w_px,
|
||||
uint16_t tile_h_px,
|
||||
uint32_t aligned_width_px);
|
||||
|
|
|
|||
|
|
@ -124,9 +124,9 @@ libagx_lower_txf_robustness(constant struct agx_texture_packed *ptr,
|
|||
return valid ? x : 0xFFF0;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
calculate_twiddled_coordinates(ushort2 coord, uint16_t tile_w_px,
|
||||
uint16_t tile_h_px, uint32_t aligned_width_px)
|
||||
uint32_t
|
||||
libagx_twiddle_coordinates(ushort2 coord, uint16_t tile_w_px,
|
||||
uint16_t tile_h_px, uint32_t aligned_width_px)
|
||||
{
|
||||
/* Modulo by the tile width/height to get the offsets within the tile */
|
||||
ushort2 tile_mask_vec = (ushort2)(tile_w_px - 1, tile_h_px - 1);
|
||||
|
|
@ -183,9 +183,9 @@ libagx_image_texel_address(constant const struct agx_pbe_packed *ptr,
|
|||
aligned_width_px = align(width_px, d.tile_width_sw);
|
||||
}
|
||||
|
||||
total_px = calculate_twiddled_coordinates(
|
||||
convert_ushort2(coord.xy), d.tile_width_sw, d.tile_height_sw,
|
||||
aligned_width_px);
|
||||
total_px =
|
||||
libagx_twiddle_coordinates(convert_ushort2(coord.xy), d.tile_width_sw,
|
||||
d.tile_height_sw, aligned_width_px);
|
||||
}
|
||||
|
||||
uint samples_log2 = is_msaa ? d.sample_count_log2_sw : 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue