From: Marek Olšák Date: Fri, 4 Jul 2014 01:19:58 +0000 (+0200) Subject: st/mesa: fix samplerCubeShadow with bias X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a11fff329ea0b236ee5d2d7ad563af49770c04c7;p=mesa.git st/mesa: fix samplerCubeShadow with bias It has 5 coordinates: (x,y,z,depth,lodbias) Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Ilia Mirkin --- diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index f47cd7d5350..b5736b2a935 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -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) {