tu: Pass firstIndex directly to CP_DRAW_INDX_OFFSET

Saves some minor overhead, cleans things up a bit, and removes one more
unknown. We now program the internal registers in the same way between
direct/indirect draws.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5644>
This commit is contained in:
Connor Abbott 2020-06-25 12:23:49 +02:00 committed by Marge Bot
parent 259d07a2ff
commit ba5e1c5310
2 changed files with 4 additions and 5 deletions

View File

@ -1799,7 +1799,6 @@ tu_CmdBindIndexBuffer(VkCommandBuffer commandBuffer,
cmd->state.index_va = buf->bo->iova + buf->bo_offset + offset;
cmd->state.max_index_count = (buf->size - offset) >> index_shift;
cmd->state.index_size = index_size;
cmd->state.index_shift = index_shift;
tu_bo_list_add(&cmd->bo_list, buf->bo, MSM_SUBMIT_BO_READ);
}
@ -3401,9 +3400,9 @@ tu_CmdDrawIndexed(VkCommandBuffer commandBuffer,
tu_cs_emit(cs, tu_draw_initiator(cmd, DI_SRC_SEL_DMA));
tu_cs_emit(cs, instanceCount);
tu_cs_emit(cs, indexCount);
tu_cs_emit(cs, 0x0); /* XXX */
tu_cs_emit_qw(cs, cmd->state.index_va + (firstIndex << cmd->state.index_shift));
tu_cs_emit(cs, indexCount << cmd->state.index_shift);
tu_cs_emit(cs, firstIndex);
tu_cs_emit_qw(cs, cmd->state.index_va);
tu_cs_emit(cs, cmd->state.max_index_count);
}
void

View File

@ -820,7 +820,7 @@ struct tu_cmd_state
/* Index buffer */
uint64_t index_va;
uint32_t max_index_count;
uint8_t index_size, index_shift;
uint8_t index_size;
/* because streamout base has to be 32-byte aligned
* there is an extra offset to deal with when it is