mirror of https://gitlab.freedesktop.org/mesa/mesa
svga: Fix instanced draw detection
The new GTK+ GL renderer is extensively using instanced rendering. SVGA
driver was incorrectly detecting the instanced draws by only checking
whether the instance count was greater than 1. Base instance has to
be also checked to make sure that the draw correctly offsets the vertex
buffer.
Fix instanced draw detection by checking both the instance count and
the base instance. Fixes the new GTK+ 4 GL renderer.
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Fixes: ccb4ea5a43
("svga: Add GL4.1(compatibility profile) support in svga driver")
Reviewed-by: Neha Bhende <neha.bhende@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28616>
This commit is contained in:
parent
96479794a5
commit
955444e068
|
@ -1006,6 +1006,7 @@ draw_vgpu10(struct svga_hwtnl *hwtnl,
|
|||
struct svga_context *svga = hwtnl->svga;
|
||||
struct svga_winsys_surface *indirect_handle;
|
||||
enum pipe_error ret;
|
||||
bool is_instanced_draw = instance_count > 1 || start_instance > 0;
|
||||
|
||||
assert(svga_have_vgpu10(svga));
|
||||
assert(hwtnl->cmd.prim_count == 0);
|
||||
|
@ -1096,7 +1097,7 @@ draw_vgpu10(struct svga_hwtnl *hwtnl,
|
|||
indirect_handle,
|
||||
indirect->offset);
|
||||
}
|
||||
else if (instance_count > 1) {
|
||||
else if (is_instanced_draw) {
|
||||
ret = SVGA3D_vgpu10_DrawIndexedInstanced(svga->swc,
|
||||
vcount,
|
||||
instance_count,
|
||||
|
@ -1139,7 +1140,7 @@ draw_vgpu10(struct svga_hwtnl *hwtnl,
|
|||
indirect_handle,
|
||||
indirect->offset);
|
||||
}
|
||||
else if (instance_count > 1) {
|
||||
else if (is_instanced_draw) {
|
||||
ret = SVGA3D_vgpu10_DrawInstanced(svga->swc,
|
||||
vcount,
|
||||
instance_count,
|
||||
|
|
Loading…
Reference in New Issue