Commit e8bf15d1 authored by Samuel Iglesias Gonsálvez's avatar Samuel Iglesias Gonsálvez Committed by Marge Bot

turnip: pCounterBufferOffsets can be NULL on vkCmd*TransformFeedbackEXT()

According to the spec for both vkCmd{Begin,End}TransformFeedbackEXT(),
if pCounterBufferOffsets is NULL, then it is assumed the offsets are
zero.

Fixes crash on dEQP-VK.transform_feedback.simple.backward_dependency_no_offset_array
Signed-off-by: Samuel Iglesias Gonsálvez's avatarSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Connor Abbott's avatarConnor Abbott <cwabbott0@gmail.com>
Part-of: <!8057>
parent c0e7a2cd
Pipeline #242702 waiting for manual action with stages
......@@ -1921,6 +1921,7 @@ tu_CmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer,
for (uint32_t i = 0; i < counterBufferCount; i++) {
uint32_t idx = firstCounterBuffer + i;
uint32_t offset = cmd->state.streamout_offset[idx];
uint64_t counter_buffer_offset = pCounterBufferOffsets ? pCounterBufferOffsets[i] : 0u;
if (!pCounterBuffers[i])
continue;
......@@ -1931,7 +1932,7 @@ tu_CmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer,
tu_cs_emit(cs, CP_MEM_TO_REG_0_REG(REG_A6XX_VPC_SO_BUFFER_OFFSET(idx)) |
CP_MEM_TO_REG_0_UNK31 |
CP_MEM_TO_REG_0_CNT(1));
tu_cs_emit_qw(cs, buf->bo->iova + pCounterBufferOffsets[i]);
tu_cs_emit_qw(cs, buf->bo->iova + counter_buffer_offset);
if (offset) {
tu_cs_emit_pkt7(cs, CP_REG_RMW, 3);
......@@ -1969,6 +1970,7 @@ void tu_CmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer,
for (uint32_t i = 0; i < counterBufferCount; i++) {
uint32_t idx = firstCounterBuffer + i;
uint32_t offset = cmd->state.streamout_offset[idx];
uint64_t counter_buffer_offset = pCounterBufferOffsets ? pCounterBufferOffsets[i] : 0u;
if (!pCounterBuffers[i])
continue;
......@@ -1995,7 +1997,7 @@ void tu_CmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer,
tu_cs_emit_pkt7(cs, CP_REG_TO_MEM, 3);
tu_cs_emit(cs, CP_REG_TO_MEM_0_REG(REG_A6XX_CP_SCRATCH_REG(0)) |
CP_REG_TO_MEM_0_CNT(1));
tu_cs_emit_qw(cs, buf->bo->iova + pCounterBufferOffsets[i]);
tu_cs_emit_qw(cs, buf->bo->iova + counter_buffer_offset);
}
tu_cond_exec_end(cs);
......
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