mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 16:30:10 +01:00
panvk: Add an elems field to panvk_buffer_view
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16276>
This commit is contained in:
parent
6621ab8bf9
commit
6ed298dce7
2 changed files with 6 additions and 5 deletions
|
|
@ -1053,6 +1053,7 @@ struct panvk_buffer_view {
|
|||
uint32_t img_attrib_buf[ATTRIB_BUF_DESC_WORDS * 2];
|
||||
} descs;
|
||||
enum pipe_format fmt;
|
||||
uint32_t elems;
|
||||
};
|
||||
|
||||
struct panvk_attachment_info {
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ panvk_per_arch(CreateBufferView)(VkDevice _device,
|
|||
unsigned size = panvk_buffer_range(buffer, pCreateInfo->offset,
|
||||
pCreateInfo->range);
|
||||
unsigned blksz = util_format_get_blocksize(view->fmt);
|
||||
unsigned width = size / blksz;
|
||||
view->elems = size / blksz;
|
||||
|
||||
assert(!(address & 63));
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ panvk_per_arch(CreateBufferView)(VkDevice _device,
|
|||
pan_pack(tex, TEXTURE, cfg) {
|
||||
cfg.dimension = MALI_TEXTURE_DIMENSION_1D;
|
||||
cfg.format = pdev->formats[view->fmt].hw;
|
||||
cfg.width = width;
|
||||
cfg.width = view->elems;
|
||||
cfg.depth = cfg.height = 1;
|
||||
cfg.swizzle = PAN_V6_SWIZZLE(R, G, B, A);
|
||||
cfg.texel_ordering = MALI_TEXTURE_LAYOUT_LINEAR;
|
||||
|
|
@ -247,15 +247,15 @@ panvk_per_arch(CreateBufferView)(VkDevice _device,
|
|||
cfg.type = MALI_ATTRIBUTE_TYPE_3D_LINEAR;
|
||||
cfg.pointer = address;
|
||||
cfg.stride = blksz;
|
||||
cfg.size = width * blksz;
|
||||
cfg.size = view->elems * blksz;
|
||||
}
|
||||
|
||||
attrib_buf += pan_size(ATTRIBUTE_BUFFER);
|
||||
pan_pack(attrib_buf, ATTRIBUTE_BUFFER_CONTINUATION_3D, cfg) {
|
||||
cfg.s_dimension = width;
|
||||
cfg.s_dimension = view->elems;
|
||||
cfg.t_dimension = 1;
|
||||
cfg.r_dimension = 1;
|
||||
cfg.row_stride = width * blksz;
|
||||
cfg.row_stride = view->elems * blksz;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue