panfrost: Fix collision in the indirect draw shader table

Min/max index search shaders are different for the !primitive_restart
and primitive_restart. We need to add entries for the primitive restart
cases otherwise we might retrieve a wrong shader from the cache.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12589>
This commit is contained in:
Boris Brezillon
2021-09-20 13:51:10 +02:00
committed by Marge Bot
parent 43760a7b2f
commit 3c2d7cb0d6
3 changed files with 6 additions and 2 deletions
@@ -1,5 +1,4 @@
# The shader assisted indirect draw path is buggy. The shader assisted indirect
# draw path is disabled outside of CI due to these conformance issues.
KHR-GLES31.core.draw_indirect.advanced-primitiveRestart-elements,Fail
KHR-GLES31.core.draw_indirect.advanced-twoPass-transformFeedback-arrays,Fail
KHR-GLES31.core.draw_indirect.advanced-twoPass-transformFeedback-elements,Fail
+3
View File
@@ -93,6 +93,9 @@ enum pan_indirect_draw_flags {
PAN_INDIRECT_DRAW_MIN_MAX_SEARCH_1B_INDEX = PAN_INDIRECT_DRAW_LAST_FLAG << 1,
PAN_INDIRECT_DRAW_MIN_MAX_SEARCH_2B_INDEX,
PAN_INDIRECT_DRAW_MIN_MAX_SEARCH_4B_INDEX,
PAN_INDIRECT_DRAW_MIN_MAX_SEARCH_1B_INDEX_PRIM_RESTART,
PAN_INDIRECT_DRAW_MIN_MAX_SEARCH_2B_INDEX_PRIM_RESTART,
PAN_INDIRECT_DRAW_MIN_MAX_SEARCH_3B_INDEX_PRIM_RESTART,
PAN_INDIRECT_DRAW_NUM_SHADERS,
};
+3 -1
View File
@@ -1076,7 +1076,9 @@ get_shader_id(unsigned flags, unsigned index_size, bool index_min_max_search)
return flags;
}
return PAN_INDIRECT_DRAW_MIN_MAX_SEARCH_1B_INDEX +
return ((flags & PAN_INDIRECT_DRAW_PRIMITIVE_RESTART) ?
PAN_INDIRECT_DRAW_MIN_MAX_SEARCH_1B_INDEX_PRIM_RESTART :
PAN_INDIRECT_DRAW_MIN_MAX_SEARCH_1B_INDEX) +
util_logbase2(index_size);
}