glx: Sync <GL/glxext.h> with Khronos
[mesa.git] / src / mesa / state_tracker / st_nir_lower_builtin.c
index a68966c333918ff404682db84c648a4eb0934ef0..f6f9bf15278cc5d21460b2a18b5ec53aaff9c94a 100644 (file)
@@ -107,10 +107,6 @@ get_variable(lower_builtin_state *state, nir_deref_path *path,
    memcpy(tokens, element->tokens, sizeof(tokens));
 
    if (path->path[idx]->deref_type == nir_deref_type_array) {
-      nir_const_value *c = nir_src_as_const_value(path->path[idx]->arr.index);
-
-      assert(c);
-
       /* we need to fixup the array index slot: */
       switch (tokens[0]) {
       case STATE_MODELVIEW_MATRIX:
@@ -123,7 +119,7 @@ get_variable(lower_builtin_state *state, nir_deref_path *path,
       case STATE_TEXGEN:
       case STATE_TEXENV_COLOR:
       case STATE_CLIPPLANE:
-         tokens[1] = c->u32[0];
+         tokens[1] = nir_src_as_uint(path->path[idx]->arr.index);
          break;
       }
    }
@@ -213,7 +209,7 @@ lower_builtin_block(lower_builtin_state *state, nir_block *block)
          swiz[i] = GET_SWZ(element->swizzle, i);
          assert(swiz[i] <= SWIZZLE_W);
       }
-      def = nir_swizzle(b, def, swiz, intrin->num_components, true);
+      def = nir_swizzle(b, def, swiz, intrin->num_components);
 
       /* and rewrite uses of original instruction: */
       assert(intrin->dest.is_ssa);
@@ -253,7 +249,6 @@ lower_builtin_impl(lower_builtin_state *state, nir_function_impl *impl)
 void
 st_nir_lower_builtin(nir_shader *shader)
 {
-   nir_assert_unlowered_derefs(shader, nir_lower_load_store_derefs);
    lower_builtin_state state;
    state.shader = shader;
    nir_foreach_function(function, shader) {