Commit b9c2a0b4 authored by Mike Blumenkrantz's avatar Mike Blumenkrantz 🏋 Committed by Marge Bot
Browse files

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: default avatarDave Airlie <airlied@redhat.com>
Reviewed-by: default avatarWitold Baryluk <witold.baryluk@gmail.com>
Tested-by: default avatarWitold Baryluk <witold.baryluk@gmail.com>
Part-of: <mesa/mesa!8274>
parent 435de835
......@@ -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"),
......
......@@ -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];
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment