zink: use maintenance10 info for DRLR optimization

idk where the original version of this went?

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39739>
This commit is contained in:
Mike Blumenkrantz 2026-02-06 11:12:45 -05:00 committed by Marge Bot
parent 7e217112a0
commit 055aec542e
5 changed files with 23 additions and 1 deletions

View file

@ -408,6 +408,7 @@
"VK_KHR_maintenance6": 1,
"VK_KHR_maintenance7": 1,
"VK_KHR_maintenance8": 1,
"VK_KHR_maintenance10": 1,
"VK_KHR_shader_float_controls2": 1
},
"features": {
@ -459,6 +460,9 @@
},
"VkPhysicalDeviceMaintenance8FeaturesKHR": {
"maintenance8": true
},
"VkPhysicalDeviceMaintenance10FeaturesKHR": {
"maintenance10": true
}
},
"properties": {

View file

@ -181,7 +181,7 @@ traces:
gl-zink-anv-tgl:
checksum: 68f20f660b9d812083066342398fe1b0
zink-radv-vangogh:
checksum: 0ac0c9af59e9f269bdef3af1f903d49c
checksum: 12a801d2fb5458c76101af537f98dadb
zink-radv-gfx1201:
checksum: 0ac0c9af59e9f269bdef3af1f903d49c

View file

@ -2862,6 +2862,7 @@ zink_update_fbfetch(struct zink_context *ctx)
ctx->di.fbfetch.imageLayout = VK_IMAGE_LAYOUT_UNDEFINED;
ctx->di.fbfetch.imageView = VK_NULL_HANDLE;
ctx->invalidate_descriptor_state(ctx, MESA_SHADER_FRAGMENT, ZINK_DESCRIPTOR_TYPE_UBO, 0, 1);
ctx->dynamic_fb.flags[0].flags &= ~VK_RENDERING_ATTACHMENT_INPUT_ATTACHMENT_FEEDBACK_BIT_KHR;
return true;
}
@ -2878,8 +2879,10 @@ zink_update_fbfetch(struct zink_context *ctx)
bool fbfetch_ms = ctx->fb_state.cbufs[0].texture->nr_samples > 1;
if (zink_get_fs_base_key(ctx)->fbfetch_ms != fbfetch_ms)
zink_set_fs_base_key(ctx)->fbfetch_ms = fbfetch_ms;
ctx->dynamic_fb.flags[0].flags |= VK_RENDERING_ATTACHMENT_INPUT_ATTACHMENT_FEEDBACK_BIT_KHR;
} else {
ctx->di.fbfetch.imageView = VK_NULL_HANDLE;
ctx->dynamic_fb.flags[0].flags &= ~VK_RENDERING_ATTACHMENT_INPUT_ATTACHMENT_FEEDBACK_BIT_KHR;
}
bool ret = false;
ctx->di.fbfetch.imageLayout = VK_IMAGE_LAYOUT_GENERAL;
@ -5799,6 +5802,17 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
VK_FALSE
};
}
if (screen->info.have_KHR_maintenance10) {
ctx->dynamic_fb.info.flags = VK_RENDERING_LOCAL_READ_CONCURRENT_ACCESS_CONTROL_BIT_KHR;
for (unsigned i = 0; i < ARRAY_SIZE(ctx->dynamic_fb.flags); i++) {
ctx->dynamic_fb.flags[i] = (VkRenderingAttachmentFlagsInfoKHR){
VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_FLAGS_INFO_KHR,
ctx->dynamic_fb.attachments[i].pNext,
0
};
ctx->dynamic_fb.attachments[i].pNext = &ctx->dynamic_fb.flags[i];
}
}
ctx->gfx_pipeline_state.rendering_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO;
ctx->gfx_pipeline_state.rendering_info.pColorAttachmentFormats = ctx->gfx_pipeline_state.rendering_formats;

View file

@ -81,6 +81,9 @@ EXTENSIONS = [
Extension("VK_KHR_maintenance9",
alias="maint9",
features=True, properties=True),
Extension("VK_KHR_maintenance10",
alias="maint10",
features=True, properties=True),
Extension("VK_KHR_unified_image_layouts", alias="unified_layouts", features=True),
Extension("VK_KHR_external_memory"),
Extension("VK_KHR_external_memory_fd"),

View file

@ -1806,6 +1806,7 @@ struct zink_context {
VkRenderingInfo info;
struct tc_renderpass_info tc_info;
VkAttachmentFeedbackLoopInfoEXT fbfetch_att[PIPE_MAX_COLOR_BUFS + 2]; //+depth, +stencil
VkRenderingAttachmentFlagsInfoKHR flags[PIPE_MAX_COLOR_BUFS + 2]; //+depth, +stencil
} dynamic_fb;
uint32_t fb_layer_mismatch; //bitmask
struct set rendering_state_cache[6]; //[util_logbase2_ceil(msrtss samplecount)]