Mesa (10.2): st/mesa: fix samplerCubeShadow with bias

Carl Worth cworth at kemper.freedesktop.org
Mon Jul 14 20:58:37 UTC 2014


Module: Mesa
Branch: 10.2
Commit: 906727dccb60e6a5e11198eaa6fd1b5d266203d5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=906727dccb60e6a5e11198eaa6fd1b5d266203d5

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Fri Jul  4 03:19:58 2014 +0200

st/mesa: fix samplerCubeShadow with bias

It has 5 coordinates: (x,y,z,depth,lodbias)

Cc: mesa-stable at lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
(cherry picked from commit a11fff329ea0b236ee5d2d7ad563af49770c04c7)

---

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index adc9312..162864f 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2776,7 +2776,13 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
       }
       break;
    case ir_txb:
-      opcode = is_cube_array ? TGSI_OPCODE_TXB2 : TGSI_OPCODE_TXB;
+      if (is_cube_array ||
+          sampler_type == glsl_type::samplerCubeShadow_type) {
+         opcode = TGSI_OPCODE_TXB2;
+      }
+      else {
+         opcode = TGSI_OPCODE_TXB;
+      }
       ir->lod_info.bias->accept(this);
       lod_info = this->result;
       if (ir->offset) {




More information about the mesa-commit mailing list