mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
panvk: fix gl_VertexIndex
According to pandecode, r32 is global attribute offset and r36 is vertex
offset. Follow panfrost to use r36 instead of r32 for both non-indexed
firstVertex and indexed vertexOffset.
With this, gl_VertexIndex stops being zero-based which is incorrect.
Fixes: 5544d39f44 ("panvk: Add a CSF backend for panvk_queue/cmd_buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31810>
This commit is contained in:
parent
b79950fc1f
commit
029b8b11a0
1 changed files with 3 additions and 4 deletions
|
|
@ -45,7 +45,6 @@ struct panvk_draw_info {
|
|||
struct {
|
||||
uint32_t size;
|
||||
uint32_t offset;
|
||||
int32_t vertex_offset;
|
||||
} index;
|
||||
|
||||
struct {
|
||||
|
|
@ -1469,11 +1468,11 @@ panvk_cmd_draw(struct panvk_cmd_buffer *cmdbuf, struct panvk_draw_info *draw)
|
|||
return;
|
||||
|
||||
cs_update_vt_ctx(b) {
|
||||
cs_move32_to(b, cs_sr_reg32(b, 32), draw->vertex.base);
|
||||
cs_move32_to(b, cs_sr_reg32(b, 32), 0);
|
||||
cs_move32_to(b, cs_sr_reg32(b, 33), draw->vertex.count);
|
||||
cs_move32_to(b, cs_sr_reg32(b, 34), draw->instance.count);
|
||||
cs_move32_to(b, cs_sr_reg32(b, 35), draw->index.offset);
|
||||
cs_move32_to(b, cs_sr_reg32(b, 36), draw->index.vertex_offset);
|
||||
cs_move32_to(b, cs_sr_reg32(b, 36), draw->vertex.base);
|
||||
cs_move32_to(b, cs_sr_reg32(b, 37), draw->instance.base);
|
||||
}
|
||||
|
||||
|
|
@ -1567,7 +1566,7 @@ panvk_per_arch(CmdDrawIndexed)(VkCommandBuffer commandBuffer,
|
|||
struct panvk_draw_info draw = {
|
||||
.index.size = cmdbuf->state.gfx.ib.index_size,
|
||||
.index.offset = firstIndex,
|
||||
.index.vertex_offset = vertexOffset,
|
||||
.vertex.base = (uint32_t)vertexOffset,
|
||||
.vertex.count = indexCount,
|
||||
.instance.count = instanceCount,
|
||||
.instance.base = firstInstance,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue