Module: Mesa
Branch: master
Commit: f1622cfe9c0f37a9b452be1297f187cba8c46e6a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f1622cfe9c0f37a9b452be1297f187cba8c46e6a

Author: Kenneth Graunke <[email protected]>
Date:   Fri Jun 10 14:49:36 2011 -0700

i965/fs: Move sampler fetch to the top of the ir_texture visit function.

This makes it available earlier, which will soon be necessary.
(Separating code motion from actual changes.)

Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>

---

 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index a5479e1..ac24375 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -932,9 +932,11 @@ fs_visitor::emit_texture_gen7(ir_texture *ir, fs_reg dst, 
fs_reg coordinate,
 void
 fs_visitor::visit(ir_texture *ir)
 {
-   int sampler;
    fs_inst *inst = NULL;
 
+   int sampler = _mesa_get_sampler_uniform_value(ir->sampler, prog, &fp->Base);
+   sampler = fp->Base.SamplerUnits[sampler];
+
    this->result = reg_undef;
    ir->coordinate->accept(this);
    fs_reg coordinate = this->result;
@@ -973,11 +975,6 @@ fs_visitor::visit(ir_texture *ir)
    /* Should be lowered by do_lower_texture_projection */
    assert(!ir->projector);
 
-   sampler = _mesa_get_sampler_uniform_value(ir->sampler,
-                                            prog,
-                                            &fp->Base);
-   sampler = fp->Base.SamplerUnits[sampler];
-
    /* The 965 requires the EU to do the normalization of GL rectangle
     * texture coordinates.  We use the program parameter state
     * tracking to get the scaling factor.

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to