asahi: add agx_fill_decompress_push helper
easy share between gl and vk Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30981>
This commit is contained in:

committed by
Marge Bot

parent
cd1c7ff776
commit
591bf066ba
@@ -8,6 +8,7 @@
|
||||
#include <stdbool.h>
|
||||
#include "asahi/compiler/agx_compile.h"
|
||||
#include "asahi/layout/layout.h"
|
||||
#include "shaders/compression.h"
|
||||
#include "agx_device.h"
|
||||
#include "agx_pack.h"
|
||||
#include "agx_ppp.h"
|
||||
@@ -263,6 +264,22 @@ agx_gather_device_key(struct agx_device *dev)
|
||||
};
|
||||
}
|
||||
|
||||
static void
|
||||
agx_fill_decompress_push(struct libagx_decompress_push *push,
|
||||
struct ail_layout *layout, unsigned layer,
|
||||
unsigned level, uint64_t ptr)
|
||||
{
|
||||
*push = (struct libagx_decompress_push){
|
||||
.tile_uncompressed = ail_tile_mode_uncompressed(layout->format),
|
||||
.metadata = ptr + layout->metadata_offset_B +
|
||||
layout->level_offsets_compressed_B[level] +
|
||||
(layer * layout->compression_layer_stride_B),
|
||||
.metadata_layer_stride_tl = layout->compression_layer_stride_B / 8,
|
||||
.metadata_width_tl = ail_metadata_width_tl(layout, level),
|
||||
.metadata_height_tl = ail_metadata_height_tl(layout, level),
|
||||
};
|
||||
}
|
||||
|
||||
struct agx_border_packed;
|
||||
|
||||
void agx_pack_border(struct agx_border_packed *out, const uint32_t in[4],
|
||||
|
Reference in New Issue
Block a user