mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
glsl_to_tgsi: don't rely on glsl types when visiting tex instructions
Instead add is_cube_shadow like is_cube_array. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
129fd58131
commit
43f5a2c915
1 changed files with 6 additions and 7 deletions
|
|
@ -4133,13 +4133,13 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
|
|||
const glsl_type *sampler_type = ir->sampler->type;
|
||||
unsigned sampler_array_size = 1, sampler_base = 0;
|
||||
uint16_t sampler_index = 0;
|
||||
bool is_cube_array = false;
|
||||
bool is_cube_array = false, is_cube_shadow = false;
|
||||
unsigned i;
|
||||
|
||||
/* if we are a cube array sampler */
|
||||
if ((sampler_type->sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE &&
|
||||
sampler_type->sampler_array)) {
|
||||
is_cube_array = true;
|
||||
/* if we are a cube array sampler or a cube shadow */
|
||||
if (sampler_type->sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE) {
|
||||
is_cube_array = sampler_type->sampler_array;
|
||||
is_cube_shadow = sampler_type->sampler_shadow;
|
||||
}
|
||||
|
||||
if (ir->coordinate) {
|
||||
|
|
@ -4177,8 +4177,7 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
|
|||
}
|
||||
break;
|
||||
case ir_txb:
|
||||
if (is_cube_array ||
|
||||
sampler_type == glsl_type::samplerCubeShadow_type) {
|
||||
if (is_cube_array || is_cube_shadow) {
|
||||
opcode = TGSI_OPCODE_TXB2;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue