mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 06:20:19 +01:00
panvk: Make panvk_buffer_view per-gen
Use auto-generated mali_xx_packed structs for the descriptors and make sure panvk_buffer_view.h is never included from a non per-gen context. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Reviewed-by: Rebecca Mckeever <rebecca.mckeever@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28170>
This commit is contained in:
parent
2de95773b9
commit
4aeb7aa22f
3 changed files with 14 additions and 12 deletions
|
|
@ -6,21 +6,25 @@
|
|||
#ifndef PANVK_BUFFER_VIEW_H
|
||||
#define PANVK_BUFFER_VIEW_H
|
||||
|
||||
#ifndef PAN_ARCH
|
||||
#error "PAN_ARCH must be defined"
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "vk_buffer_view.h"
|
||||
|
||||
struct panvk_priv_bo;
|
||||
#include "genxml/gen_macros.h"
|
||||
|
||||
#define TEXTURE_DESC_WORDS 8
|
||||
#define ATTRIB_BUF_DESC_WORDS 4
|
||||
struct panvk_priv_bo;
|
||||
|
||||
struct panvk_buffer_view {
|
||||
struct vk_buffer_view vk;
|
||||
struct panvk_priv_bo *bo;
|
||||
|
||||
struct {
|
||||
uint32_t tex[TEXTURE_DESC_WORDS];
|
||||
uint32_t img_attrib_buf[ATTRIB_BUF_DESC_WORDS * 2];
|
||||
struct mali_texture_packed tex;
|
||||
struct mali_attribute_buffer_packed img_attrib_buf[2];
|
||||
} descs;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ panvk_per_arch(CreateBufferView)(VkDevice _device,
|
|||
cfg.pointer = address;
|
||||
}
|
||||
|
||||
pan_pack(view->descs.tex, TEXTURE, cfg) {
|
||||
pan_pack(view->descs.tex.opaque, TEXTURE, cfg) {
|
||||
cfg.dimension = MALI_TEXTURE_DIMENSION_1D;
|
||||
cfg.format = GENX(panfrost_format_from_pipe_format)(pfmt)->hw;
|
||||
cfg.width = view->vk.elements;
|
||||
|
|
@ -68,17 +68,15 @@ panvk_per_arch(CreateBufferView)(VkDevice _device,
|
|||
}
|
||||
|
||||
if (buffer->vk.usage & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) {
|
||||
uint8_t *attrib_buf = (uint8_t *)view->descs.img_attrib_buf;
|
||||
|
||||
pan_pack(attrib_buf, ATTRIBUTE_BUFFER, cfg) {
|
||||
pan_pack(view->descs.img_attrib_buf[0].opaque, ATTRIBUTE_BUFFER, cfg) {
|
||||
cfg.type = MALI_ATTRIBUTE_TYPE_3D_LINEAR;
|
||||
cfg.pointer = address;
|
||||
cfg.stride = blksz;
|
||||
cfg.size = view->vk.elements * blksz;
|
||||
}
|
||||
|
||||
attrib_buf += pan_size(ATTRIBUTE_BUFFER);
|
||||
pan_pack(attrib_buf, ATTRIBUTE_BUFFER_CONTINUATION_3D, cfg) {
|
||||
pan_pack(view->descs.img_attrib_buf[1].opaque,
|
||||
ATTRIBUTE_BUFFER_CONTINUATION_3D, cfg) {
|
||||
cfg.s_dimension = view->vk.elements;
|
||||
cfg.t_dimension = 1;
|
||||
cfg.r_dimension = 1;
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ panvk_write_tex_buf_desc(struct panvk_descriptor_set *set, uint32_t binding,
|
|||
{
|
||||
VK_FROM_HANDLE(panvk_buffer_view, view, bufferView);
|
||||
|
||||
memcpy(panvk_tex_desc(set, binding, elem), view->descs.tex,
|
||||
memcpy(panvk_tex_desc(set, binding, elem), view->descs.tex.opaque,
|
||||
pan_size(TEXTURE));
|
||||
|
||||
panvk_fill_bview_desc(panvk_desc_ubo_data(set, binding, elem), view);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue