[Mesa-dev] [PATCH 20/23] i965: Drop sizeof(struct brw_sampler_state) from estimated prim size.

Kenneth Graunke kenneth at whitecape.org
Tue Jul 29 16:29:25 PDT 2014


This is the last user of the structure.  Hardcoding 16 is poor style,
but this code is already a senseless mess, so it's not that much worse.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_draw.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index ac21656..16f6f6a 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -444,9 +444,8 @@ static bool brw_try_draw_prims( struct gl_context *ctx,
       int estimated_max_prim_size;
 
       estimated_max_prim_size = 512; /* batchbuffer commands */
-      estimated_max_prim_size += (BRW_MAX_TEX_UNIT *
-				  (sizeof(struct brw_sampler_state) +
-				   sizeof(struct gen5_sampler_default_color)));
+      estimated_max_prim_size +=
+         (BRW_MAX_TEX_UNIT * (16 + sizeof(struct gen5_sampler_default_color)));
       estimated_max_prim_size += 1024; /* gen6 VS push constants */
       estimated_max_prim_size += 1024; /* gen6 WM push constants */
       estimated_max_prim_size += 512; /* misc. pad */
-- 
2.0.2



More information about the mesa-dev mailing list