summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_context.h
diff options
context:
space:
mode:
authorCharmaine Lee <[email protected]>2016-04-22 16:06:32 -0700
committerBrian Paul <[email protected]>2016-04-25 12:59:29 -0600
commitc4cb879f00de89c300462e7b2d0f221d920c396f (patch)
tree8c6b251b6cdb626832ffa52de4b149a503300956 /src/gallium/drivers/svga/svga_context.h
parent686cd3c606536cff3fe6d80f8ebeeca7afa1b37e (diff)
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_context.h')
-rw-r--r--src/gallium/drivers/svga/svga_context.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index b485485f0be..007d5bc3b51 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -291,6 +291,8 @@ struct svga_state
struct {
unsigned flag_1d;
unsigned flag_srgb;
+ unsigned flag_rect; /* sampler views with rectangular texture target */
+ unsigned flag_buf; /* sampler views with texture buffer target */
} tex_flags;
unsigned sample_mask;
@@ -586,6 +588,7 @@ struct svga_context
#define SVGA_NEW_GS 0x10000000
#define SVGA_NEW_GS_CONST_BUFFER 0x20000000
#define SVGA_NEW_GS_VARIANT 0x40000000
+#define SVGA_NEW_TEXTURE_CONSTS 0x80000000