From: Eric Anholt Date: Fri, 9 Jan 2009 03:00:10 +0000 (-0800) Subject: i965: Use _mesa_num_inst_src_regs() instead of keeping a copy of its contents. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=046e88fc0be37d5a3dfbfa9fb8033b549604c74c;p=mesa.git i965: Use _mesa_num_inst_src_regs() instead of keeping a copy of its contents. --- diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 5b4ee20ecb5..b8fbc8cdff8 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -40,62 +40,20 @@ GLuint brw_wm_nr_args( GLuint opcode ) { switch (opcode) { - case WM_PIXELXY: - case OPCODE_ABS: - case OPCODE_FLR: - case OPCODE_FRC: - case OPCODE_SWZ: - case OPCODE_MOV: - case OPCODE_COS: - case OPCODE_EX2: - case OPCODE_LG2: - case OPCODE_RCP: - case OPCODE_RSQ: - case OPCODE_SIN: - case OPCODE_SCS: - case OPCODE_TEX: - case OPCODE_TXB: - case OPCODE_TXP: - case OPCODE_KIL: - case OPCODE_LIT: - case OPCODE_NRM3: - case OPCODE_NRM4: - case WM_CINTERP: - case WM_WPOSXY: + case WM_CINTERP: + case WM_WPOSXY: return 1; - - case OPCODE_POW: - case OPCODE_SUB: - case OPCODE_SGE: - case OPCODE_SGT: - case OPCODE_SLE: - case OPCODE_SLT: - case OPCODE_SEQ: - case OPCODE_SNE: - case OPCODE_ADD: - case OPCODE_MAX: - case OPCODE_MIN: - case OPCODE_MUL: - case OPCODE_XPD: - case OPCODE_DP3: - case OPCODE_DP4: - case OPCODE_DPH: - case OPCODE_DST: - case WM_LINTERP: + case WM_LINTERP: case WM_DELTAXY: case WM_PIXELW: return 2; - case WM_FB_WRITE: - case WM_PINTERP: - case OPCODE_MAD: - case OPCODE_CMP: - case OPCODE_LRP: + case WM_PINTERP: return 3; - default: - return 0; + assert(opcode < MAX_OPCODE); + return _mesa_num_inst_src_regs(opcode); } }