zink: require KHR_maintenance2 for tessellation and set bottom-left origin

this makes tessellation work as expected in apps but has no impact on unit tests

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8274>
This commit is contained in:
Mike Blumenkrantz 2020-12-30 16:14:54 -05:00 committed by Marge Bot
parent 435de835cd
commit b9c2a0b4c6
3 changed files with 8 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import sys
EXTENSIONS = [
Extension("VK_EXT_debug_utils"),
Extension("VK_KHR_maintenance2"),
Extension("VK_KHR_get_physical_device_properties2"),
Extension("VK_KHR_external_memory_capabilities"),
Extension("VK_MVK_moltenvk"),

View File

@ -148,10 +148,14 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
pci.pDynamicState = &pipelineDynamicStateCreateInfo;
VkPipelineTessellationStateCreateInfo tci = {};
VkPipelineTessellationDomainOriginStateCreateInfo tdci = {};
if (prog->shaders[PIPE_SHADER_TESS_CTRL] && prog->shaders[PIPE_SHADER_TESS_EVAL]) {
tci.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO;
tci.patchControlPoints = state->vertices_per_patch;
pci.pTessellationState = &tci;
tci.pNext = &tdci;
tdci.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO;
tdci.domainOrigin = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT;
}
VkPipelineShaderStageCreateInfo shader_stages[ZINK_SHADER_COUNT];

View File

@ -394,7 +394,9 @@ zink_get_shader_param(struct pipe_screen *pscreen,
return INT_MAX;
case PIPE_SHADER_TESS_CTRL:
case PIPE_SHADER_TESS_EVAL:
if (screen->info.feats.features.tessellationShader)
if (screen->info.feats.features.tessellationShader &&
(screen->instance_info.have_KHR_maintenance2 ||
VK_MAKE_VERSION(1,1,0) <= screen->loader_version))
return INT_MAX;
break;