diff options
author | Brian Paul <[email protected]> | 2016-08-31 18:28:00 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-09-17 10:09:00 -0600 |
commit | 581292a78c67335814a3ffb33409f7a62ecedd79 (patch) | |
tree | 87a0a6dee430a41713431a752d44624ec6f0d035 /src/gallium/drivers/svga/svga_cmd.h | |
parent | ee5f5e226906ff4e18f34d0e7d41aa82dcf51f70 (diff) |
svga: try to emit fewer buffer rebind commands
If a consecutive sequence of drawing commands references the same
vertex/index buffers, there should be no need to rebind the surfaces
for the second and subsequent drawing commands.
Apps that use multiple display lists benefit from this since the vertex
data for several display lists is often stored in one buffer.
In the case of the legacy E&S Glaze demo, this reduces the size of our
command buffers from 91KB to 44KB. One WSI Fusion trace shows a 33%
reduction in command buffer sizes.
Tested with full piglit run.
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_cmd.h')
-rw-r--r-- | src/gallium/drivers/svga/svga_cmd.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_cmd.h b/src/gallium/drivers/svga/svga_cmd.h index 06e1b4a3253..47a33ec3932 100644 --- a/src/gallium/drivers/svga/svga_cmd.h +++ b/src/gallium/drivers/svga/svga_cmd.h @@ -35,6 +35,7 @@ #include "svga_types.h" +#include "svga_winsys.h" #include "svga_reg.h" #include "svga3d_reg.h" @@ -60,6 +61,25 @@ SVGA3D_FIFOReserve(struct svga_winsys_context *swc, uint32 cmd, uint32 cmdSize, void SVGA_FIFOCommitAll(struct svga_winsys_context *swc); +/** + * Return the last command id put in the command buffer. + */ +static inline SVGAFifo3dCmdId +SVGA3D_GetLastCommand(const struct svga_winsys_context *swc) +{ + return swc->last_command; +} + +/** + * Reset/clear the last command put in the command buffer. + * To be called when buffer is flushed. + */ +static inline void +SVGA3D_ResetLastCommand(struct svga_winsys_context *swc) +{ + swc->last_command = 0; +} + /* * Context Management |