OSDN Git Service

svga: eliminiate unnecessary constant buffer updates
authorCharmaine Lee <charmainel@vmware.com>
Fri, 22 Apr 2016 23:06:32 +0000 (16:06 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 25 Apr 2016 18:59:29 +0000 (12:59 -0600)
commitc4cb879f00de89c300462e7b2d0f221d920c396f
tree8c6b251b6cdb626832ffa52de4b149a503300956
parent686cd3c606536cff3fe6d80f8ebeeca7afa1b37e
svga: eliminiate unnecessary constant buffer updates

Currently if the texture binding is changed, emit_fs_consts()
is triggered to update texture scaling factor for
rectangle texture or texture buffer size in the constant buffer.
But the update is only relevant if the texture binding includes
a rectangle texture or a texture buffer.

To eliminate the unnecessary constant buffer updates due to other texture
binding changes, a new flag SVGA_NEW_TEXTURE_CONSTS will be used
to trigger fragment shader constant buffer update when a rectangle texture
or a texture buffer is bound.

With this patch, the number of constant buffer updates in Lightsmark2008
reduces from hundreds per frame to about 28 per frame.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/svga/svga_context.h
src/gallium/drivers/svga/svga_pipe_sampler.c
src/gallium/drivers/svga/svga_state_constants.c