From 4813946d366a0d61e0be1dacec6d3077bc939b48 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Thu, 14 Feb 2008 13:24:27 +0800 Subject: [PATCH] i965: use setup attributes as inputs when allocating registers for WM payload. fix #10767 --- src/mesa/drivers/dri/i965/brw_context.h | 2 ++ src/mesa/drivers/dri/i965/brw_sf.c | 2 -- src/mesa/drivers/dri/i965/brw_wm_pass2.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 6bdb8342aa3..a6c60aa4593 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -688,5 +688,7 @@ brw_context( GLcontext *ctx ) return (struct brw_context *)ctx; } +#define DO_SETUP_BITS ((1<<(FRAG_ATTRIB_MAX)) - 1) + #endif diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c index 9250dc36e6d..18285bef66c 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.c +++ b/src/mesa/drivers/dri/i965/brw_sf.c @@ -43,8 +43,6 @@ #include "brw_sf.h" #include "brw_state.h" -#define DO_SETUP_BITS ((1<<(FRAG_ATTRIB_MAX)) - 1) - static void compile_sf_prog( struct brw_context *brw, struct brw_sf_prog_key *key ) { diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass2.c b/src/mesa/drivers/dri/i965/brw_wm_pass2.c index c1ce6a9b6b5..8541cbcbec0 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass2.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass2.c @@ -69,7 +69,8 @@ static void prealloc_reg(struct brw_wm_compile *c, */ static void init_registers( struct brw_wm_compile *c ) { - GLuint inputs = FRAG_BIT_WPOS | c->fp_interp_emitted; + struct brw_context *brw = c->func.brw; + GLuint inputs = (brw->vs.prog_data->outputs_written & DO_SETUP_BITS); GLuint nr_interp_regs = 0; GLuint i = 0; GLuint j; -- 2.30.2