st/mesa: fix samplerCubeShadow with bias
authorMarek Olšák <marek.olsak@amd.com>
Fri, 4 Jul 2014 01:19:58 +0000 (03:19 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 11 Jul 2014 17:36:29 +0000 (19:36 +0200)
It has 5 coordinates: (x,y,z,depth,lodbias)

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index f47cd7d53507362949ed840a9cca86de07ac2769..b5736b2a93555cf084e685d6cf063e5bfd54dd8b 100644 (file)
@@ -2820,7 +2820,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) {