aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_draw.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_draw.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index fd80f67b6a1..fe9612c38e4 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -388,9 +388,13 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
* to perform the relocation in the IB packet (without
* emitting to the actual HW).
*/
- cl_u8(&bcl, VC4_PACKET_GEM_HANDLES);
- cl_u32(&bcl, vc4_gem_hindex(job, rsc->bo));
- cl_u32(&bcl, 0);
+ uint32_t hindex = vc4_gem_hindex(job, rsc->bo);
+ if (job->last_gem_handle_hindex != hindex) {
+ cl_u8(&bcl, VC4_PACKET_GEM_HANDLES);
+ cl_u32(&bcl, hindex);
+ cl_u32(&bcl, 0);
+ job->last_gem_handle_hindex = hindex;
+ }
cl_u8(&bcl, VC4_PACKET_GL_INDEXED_PRIMITIVE);
cl_u8(&bcl,