nvk: Add NVK_MAX_IMAGE_PLANES for images

Reviewed-by: Faith Ekstrand <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33453>
This commit is contained in:
Mohamed Ahmed 2025-02-12 18:37:47 +02:00 committed by Marge Bot
parent db53e53bf6
commit 8c70c8f60f
5 changed files with 7 additions and 5 deletions

View file

@ -55,7 +55,7 @@ get_sampled_image_view_desc(VkDescriptorType descriptor_type,
const VkDescriptorImageInfo *const info,
void *dst, size_t dst_size)
{
struct nvk_sampled_image_descriptor desc[3] = { };
struct nvk_sampled_image_descriptor desc[NVK_MAX_IMAGE_PLANES] = { };
uint8_t plane_count = 1;
if (descriptor_type != VK_DESCRIPTOR_TYPE_SAMPLER &&

View file

@ -80,7 +80,7 @@ struct nvk_image {
bool disjoint;
uint8_t plane_count;
struct nvk_image_plane planes[3];
struct nvk_image_plane planes[NVK_MAX_IMAGE_PLANES];
/* In order to support D32_SFLOAT_S8_UINT, a temp area is
* needed. The stencil plane can't be a copied using the DMA

View file

@ -27,7 +27,7 @@ struct nvk_image_view {
/** Index in the image descriptor table for the storage image descriptor */
uint32_t storage_desc_index;
} planes[3];
} planes[NVK_MAX_IMAGE_PLANES];
};
VK_DEFINE_NONDISP_HANDLE_CASTS(nvk_image_view, vk.base, VkImageView,
@ -37,7 +37,7 @@ struct nvk_image_view_capture {
struct {
uint32_t sampled_desc_index;
uint32_t storage_desc_index;
} planes[3];
} planes[NVK_MAX_IMAGE_PLANES];
};
VkResult nvk_image_view_init(struct nvk_device *dev,

View file

@ -954,7 +954,7 @@ nvk_get_device_properties(const struct nvk_instance *instance,
.nonStrictSinglePixelWideLinesUseParallelogram = false,
.nonStrictWideLinesUseParallelogram = false,
.blockTexelViewCompatibleMultipleLayers = true,
.maxCombinedImageSamplerDescriptorCount = 3,
.maxCombinedImageSamplerDescriptorCount = NVK_MAX_IMAGE_PLANES,
.fragmentShadingRateClampCombinerInputs = false, /* TODO */
.defaultRobustnessStorageBuffers =
VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT,

View file

@ -35,6 +35,8 @@
/* Max size of a bound cbuf */
#define NVK_MAX_CBUF_SIZE (1u << 16)
#define NVK_MAX_IMAGE_PLANES 3
struct nvk_addr_range {
uint64_t addr;
uint64_t range;