svga: fix stride used in vertex declaration
The stride for each vertex buffer should come from the corresponding
vertex element structure.
Fixes piglit/glretrace regressions running on svga vgpu9 device.
Fixes: 7672545223 ("gallium: move vertex stride to CSO")
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24841>
This commit is contained in:
@@ -79,8 +79,8 @@ emit_hw_vs_vdecl(struct svga_context *svga, uint64_t dirty)
|
||||
buffer = svga_buffer(vb->buffer.resource);
|
||||
if (buffer->uploaded.start > offset) {
|
||||
tmp_neg_bias = buffer->uploaded.start - offset;
|
||||
if (ve->src_stride)
|
||||
tmp_neg_bias = (tmp_neg_bias + ve->src_stride - 1) / ve->src_stride;
|
||||
if (ve[i].src_stride)
|
||||
tmp_neg_bias = (tmp_neg_bias + ve[i].src_stride - 1) / ve[i].src_stride;
|
||||
neg_bias = MAX2(neg_bias, tmp_neg_bias);
|
||||
}
|
||||
}
|
||||
@@ -103,14 +103,14 @@ emit_hw_vs_vdecl(struct svga_context *svga, uint64_t dirty)
|
||||
decls[i].identity.method = SVGA3D_DECLMETHOD_DEFAULT;
|
||||
decls[i].identity.usage = usage;
|
||||
decls[i].identity.usageIndex = index;
|
||||
decls[i].array.stride = ve->src_stride;
|
||||
decls[i].array.stride = ve[i].src_stride;
|
||||
|
||||
/* Compensate for partially uploaded vbo, and
|
||||
* for the negative index bias.
|
||||
*/
|
||||
decls[i].array.offset = (vb->buffer_offset
|
||||
+ ve[i].src_offset
|
||||
+ neg_bias * ve->src_stride
|
||||
+ neg_bias * ve[i].src_stride
|
||||
- buffer->uploaded.start);
|
||||
|
||||
assert(decls[i].array.offset >= 0);
|
||||
|
||||
Reference in New Issue
Block a user