svga: avoid emitting redundant SetShaderResources and SetVertexBuffers
authorCharmaine Lee <charmainel@vmware.com>
Tue, 1 Aug 2017 22:58:50 +0000 (15:58 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 5 Sep 2017 16:31:18 +0000 (10:31 -0600)
commit98badd7f6eaa0ac3ad3d5375f084b84172bb7582
tree257747cde945988df07ab8d27aef1d1a4c6d577c
parente439908af9665b50443f1196cb55388c69d0c7d7
svga: avoid emitting redundant SetShaderResources and SetVertexBuffers

Minor performance improvement in avoiding binding the same shader resource
or the same vertex buffer for the same slot.

Tested with MTT glretrace.

v2: Per Brian's suggestion, add a helper function to do vertex buffer
    comparision.
v3: Change the helper function to vertex_buffers_equal().

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/svga/svga_draw.c
src/gallium/drivers/svga/svga_state_sampler.c