tu: pCounterBuffers can be NULL in vkCmd*TransformFeedbackEXT()
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Thu, 17 Dec 2020 12:41:52 +0000 (14:41 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 17 Dec 2020 16:33:33 +0000 (16:33 +0000)
commitb34bc3db67448e54c239e933faa268e2bff63346
treeef9f9138e0367bef190271e9728db5431580f065
parent6aec3c9a2340474d4c8a9243b5c7732f0aeb7149
tu: pCounterBuffers can be NULL in vkCmd*TransformFeedbackEXT()

According to the spec:

"pCounterBuffers is an optional array of buffer handles [...]
 If pCounterBuffers is NULL, then transform feedback will start
 capturing vertex data to byte offset zero in all bound transform
 feedback buffers."

"If counterBufferCount is not 0, and pCounterBuffers is not NULL,
 pCounterBuffers must be a valid pointer to an array [...]"

So counterBufferCount could be non-zero with pCounterBuffers
being NULL.

Fixes crash in RenderDoc when inspecting draw call with tesselation
or geometry shader present.

Fixes: 98b0d900 "turnip: rework streamout state and add missing counter buffer read/writes"
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8140>
src/freedreno/vulkan/tu_cmd_buffer.c