summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanylo Piliaiev <dpiliaiev@igalia.com>2020-12-17 13:50:04 +0200
committerDylan Baker <dylan.c.baker@intel.com>2020-12-17 13:21:37 -0800
commit81421b7dd4ed6d20ce3bfc9a5bfc138152002c22 (patch)
treea2e91ee164aba4006f13d0bf76d1e84899bf90b8
parentabfbaa8476fe3fdec1250315e97b402355795668 (diff)
downloadmesa-81421b7dd4ed6d20ce3bfc9a5bfc138152002c22.tar.gz
tu: Ignore pTessellationState if there is no tesselation shaders
According to the spec: "pTessellationState [...] is ignored if the pipeline does not include a tessellation control shader stage and tessellation evaluation shader stage." Fixes crash in RenderDoc when inspecting draw call with geometry shader but without tesselation shaders. Fixes: eefdca2e "turnip: Parse tess state and support PATCH primtype" Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8140> (cherry picked from commit 6aec3c9a2340474d4c8a9243b5c7732f0aeb7149)
-rw-r--r--.pick_status.json2
-rw-r--r--src/freedreno/vulkan/tu_pipeline.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/.pick_status.json b/.pick_status.json
index b5b09c655fe..d24b696a9da 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -103,7 +103,7 @@
"description": "tu: Ignore pTessellationState if there is no tesselation shaders",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "eefdca2e2f5a558e02102c1f6e1736b61acc67b2"
},
diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c
index 19f22cdf0a7..32bab4fdca8 100644
--- a/src/freedreno/vulkan/tu_pipeline.c
+++ b/src/freedreno/vulkan/tu_pipeline.c
@@ -2335,12 +2335,13 @@ static void
tu_pipeline_builder_parse_tessellation(struct tu_pipeline_builder *builder,
struct tu_pipeline *pipeline)
{
+ if (!(pipeline->active_stages & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) ||
+ !(pipeline->active_stages & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT))
+ return;
+
const VkPipelineTessellationStateCreateInfo *tess_info =
builder->create_info->pTessellationState;
- if (!tess_info)
- return;
-
assert(!(pipeline->dynamic_state_mask & BIT(TU_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY)));
assert(pipeline->ia.primtype == DI_PT_PATCHES0);