glsl: lower bindless sampler/image packed varyings
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 21 Apr 2017 12:37:24 +0000 (14:37 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sat, 6 May 2017 14:40:19 +0000 (16:40 +0200)
v3: - rebase (and remove (sampler) ? 1 : vector_elements)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/lower_packed_varyings.cpp

index b1a3b49b1d57e9436c24d902482a16454bf0d02e..1aec7ee7dc2303a984d0a3a0d7e7d0dcfb0bf911 100644 (file)
@@ -383,6 +383,12 @@ lower_packed_varyings_visitor::bitwise_assign_pack(ir_rvalue *lhs,
             rhs = u2i(expr(ir_unop_unpack_uint_2x32, rhs));
          }
          break;
+      case GLSL_TYPE_SAMPLER:
+         rhs = u2i(expr(ir_unop_unpack_sampler_2x32, rhs));
+         break;
+      case GLSL_TYPE_IMAGE:
+         rhs = u2i(expr(ir_unop_unpack_image_2x32, rhs));
+         break;
       default:
          assert(!"Unexpected type conversion while lowering varyings");
          break;
@@ -462,6 +468,14 @@ lower_packed_varyings_visitor::bitwise_assign_unpack(ir_rvalue *lhs,
             rhs = expr(ir_unop_pack_uint_2x32, i2u(rhs));
          }
          break;
+      case GLSL_TYPE_SAMPLER:
+         rhs = new(mem_ctx)
+            ir_expression(ir_unop_pack_sampler_2x32, lhs->type, i2u(rhs));
+         break;
+      case GLSL_TYPE_IMAGE:
+         rhs = new(mem_ctx)
+            ir_expression(ir_unop_pack_image_2x32, lhs->type, i2u(rhs));
+         break;
       default:
          assert(!"Unexpected type conversion while lowering varyings");
          break;