zink: support PIPE_CAP_FBFETCH_COHERENT

that's what VK_EXT_rasterization_order_attachment_access is for

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18133>
This commit is contained in:
Mike Blumenkrantz 2022-08-18 12:59:46 -04:00 committed by Marge Bot
parent 9f7195949b
commit c4f78396d4
6 changed files with 13 additions and 1 deletions

View File

@ -331,7 +331,7 @@ Khronos, ARB, and OES extensions that are not part of any OpenGL or OpenGL ES ve
GL_EXT_sRGB_write_control DONE (all drivers that support GLES 3.0+)
GL_EXT_texture_norm16 DONE (freedreno, i965, r600, radeonsi, nvc0i, softpipe, zink)
GL_EXT_texture_sRGB_R8 DONE (all drivers that support GLES 3.0+)
GL_KHR_blend_equation_advanced_coherent DONE (i965/gen9+, panfrost)
GL_KHR_blend_equation_advanced_coherent DONE (i965/gen9+, panfrost, zink)
GL_KHR_texture_compression_astc_hdr DONE (core only)
GL_KHR_texture_compression_astc_sliced_3d DONE (i965/gen9+, r600, radeonsi, panfrost, softpipe, v3d, zink, lima)
GL_OES_depth_texture_cube_map DONE (all drivers that support GLSL 1.30+)

View File

@ -3,3 +3,4 @@ VK_KHR_shader_clock on lavapipe
Mesa-DB, the new single file cache type
VK_EXT_attachment_feedback_loop_layout on RADV
VK_KHR_global_priority on RADV
GL_KHR_blend_equation_advanced_coherent on zink

View File

@ -206,6 +206,10 @@ EXTENSIONS = [
features=True,
conditions=["$feats.scalarBlockLayout"]),
Extension("VK_KHR_swapchain"),
Extension("VK_EXT_rasterization_order_attachment_access",
alias="rast_order_access",
features=True,
conditions=["$feats.rasterizationOrderColorAttachmentAccess"]),
Extension("VK_KHR_shader_float16_int8",
alias="shader_float16_int8",
features=True),

View File

@ -117,6 +117,9 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
blend_state.logicOpEnable = state->blend_state->logicop_enable;
blend_state.logicOp = state->blend_state->logicop_func;
}
if (screen->info.have_EXT_rasterization_order_attachment_access &&
prog->shaders[MESA_SHADER_FRAGMENT]->nir->info.fs.uses_fbfetch_output)
blend_state.flags |= VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT;
VkPipelineMultisampleStateCreateInfo ms_state = {0};
ms_state.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;

View File

@ -193,6 +193,8 @@ create_render_pass2(struct zink_screen *screen, struct zink_render_pass_state *s
};
VkSubpassDescription2 subpass = {0};
if (pstate->fbfetch && screen->info.have_EXT_rasterization_order_attachment_access)
subpass.flags |= VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT;
VkSubpassDescriptionDepthStencilResolve zsresolve;
subpass.sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2;
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;

View File

@ -399,6 +399,8 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_FBFETCH:
return 1;
case PIPE_CAP_FBFETCH_COHERENT:
return screen->info.have_EXT_rasterization_order_attachment_access;
case PIPE_CAP_MEMOBJ:
return screen->instance_info.have_KHR_external_memory_capabilities && (screen->info.have_KHR_external_memory_fd || screen->info.have_KHR_external_memory_win32);