}
}
if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB) {
- assert(sizeof(ctx->di.fbfetch_db) <= screen->info.db_props.inputAttachmentDescriptorSize);
/* cache null fbfetch descriptor info */
ctx->di.fbfetch.imageView = zink_get_dummy_surface(ctx, 0)->image_view;
ctx->di.fbfetch.imageLayout = VK_IMAGE_LAYOUT_GENERAL;
mesa_loge("Cannot use db descriptor mode without robustness2.nullDescriptor");
goto fail;
}
+ if (ZINK_FBFETCH_DESCRIPTOR_SIZE < screen->info.db_props.inputAttachmentDescriptorSize) {
+ mesa_loge("Cannot use db descriptor mode with inputAttachmentDescriptorSize(%u) > %u", (unsigned)screen->info.db_props.inputAttachmentDescriptorSize, ZINK_FBFETCH_DESCRIPTOR_SIZE);
+ goto fail;
+ }
if (screen->compact_descriptors) {
/* TODO: bindless */
if (screen->info.db_props.maxDescriptorBufferBindings < 3) {
/* enum zink_descriptor_type */
#define ZINK_MAX_DESCRIPTOR_SETS 6
#define ZINK_MAX_DESCRIPTORS_PER_TYPE (32 * ZINK_GFX_SHADER_COUNT)
+/* max size from gpuinfo */
+#define ZINK_FBFETCH_DESCRIPTOR_SIZE 64
/* suballocator defines */
#define NUM_SLAB_ALLOCATORS 3
};
VkDescriptorImageInfo fbfetch;
- uint8_t fbfetch_db[64]; //max size from gpuinfo
+ uint8_t fbfetch_db[ZINK_FBFETCH_DESCRIPTOR_SIZE];
/* the current state of the shadow swizzle data */
struct zink_fs_shadow_key shadow;