diff options
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index dc3e822308b..baaa3affed9 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -1940,6 +1940,15 @@ nir_visitor::visit(ir_expression *ir) unreachable("not reached"); } break; + case ir_binop_vector_extract: { + result = nir_channel(&b, srcs[0], 0); + for (unsigned i = 1; i < ir->operands[0]->type->vector_elements; i++) { + nir_ssa_def *swizzled = nir_channel(&b, srcs[0], i); + result = nir_bcsel(&b, nir_ieq(&b, srcs[1], nir_imm_int(&b, i)), + swizzled, result); + } + break; + } case ir_binop_ldexp: result = nir_ldexp(&b, srcs[0], srcs[1]); break; case ir_triop_fma: |