diff options
author | Keith Whitwell <[email protected]> | 2009-02-16 19:50:48 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-02-16 19:50:48 +0000 |
commit | 59d54334c96f44ed1d8bf660dc96221362a77d04 (patch) | |
tree | e9ab34e568256bcdc2a88602c47072ab769211e8 /src/mesa/drivers/dri/i965/brw_wm_pass1.c | |
parent | 7c8836e9ef49d938aa55a1c385b95c6371c301f1 (diff) | |
parent | c5c383596ddb26cd75e4b355918ad16915283b59 (diff) |
Merge branch 'master' into gallium-texture-transfer
Conflicts:
src/mesa/state_tracker/st_cb_accum.c
src/mesa/state_tracker/st_cb_drawpixels.c
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm_pass1.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_pass1.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass1.c b/src/mesa/drivers/dri/i965/brw_wm_pass1.c index f6f3a38e9e0..6eaed8a665b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass1.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass1.c @@ -58,7 +58,8 @@ static void unlink_ref(struct brw_wm_ref *ref) if (ref == value->lastuse) { value->lastuse = ref->prevuse; - } else { + } + else { struct brw_wm_ref *i = value->lastuse; while (i->prevuse != ref) i = i->prevuse; i->prevuse = ref->prevuse; @@ -75,8 +76,9 @@ static void track_arg(struct brw_wm_compile *c, for (i = 0; i < 4; i++) { struct brw_wm_ref *ref = inst->src[arg][i]; if (ref) { - if (readmask & (1<<i)) + if (readmask & (1<<i)) { ref->value->contributes_to_output = 1; + } else { unlink_ref(ref); inst->src[arg][i] = NULL; @@ -88,15 +90,21 @@ static void track_arg(struct brw_wm_compile *c, static GLuint get_texcoord_mask( GLuint tex_idx ) { switch (tex_idx) { - case TEXTURE_1D_INDEX: return WRITEMASK_X; - case TEXTURE_2D_INDEX: return WRITEMASK_XY; - case TEXTURE_3D_INDEX: return WRITEMASK_XYZ; - case TEXTURE_CUBE_INDEX: return WRITEMASK_XYZ; - case TEXTURE_RECT_INDEX: return WRITEMASK_XY; + case TEXTURE_1D_INDEX: + return WRITEMASK_X; + case TEXTURE_2D_INDEX: + return WRITEMASK_XY; + case TEXTURE_3D_INDEX: + return WRITEMASK_XYZ; + case TEXTURE_CUBE_INDEX: + return WRITEMASK_XYZ; + case TEXTURE_RECT_INDEX: + return WRITEMASK_XY; default: return 0; } } + /* Step two: Basically this is dead code elimination. * * Iterate backwards over instructions, noting which values @@ -273,6 +281,3 @@ void brw_wm_pass1( struct brw_wm_compile *c ) brw_wm_print_program(c, "pass1"); } } - - - |