anv/meta2d: Don't declare an array sampler in the fragment shader
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 28 Mar 2016 22:25:47 +0000 (15:25 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 8 Apr 2016 22:57:28 +0000 (15:57 -0700)
With the new blit framework we aren't using array textures and, from
talking with Nanley, we don't think it's going to be useful in the future
either.  Just get rid of it for now.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
src/intel/vulkan/anv_meta_blit2d.c

index f40dc2f7828e96ea0b41d8ac4526640e693d6d66..10e9ba3befd2a577871f6193ae3de1b1f4ae23a9 100644 (file)
@@ -393,19 +393,19 @@ static nir_shader *
 build_nir_copy_fragment_shader()
 {
    const struct glsl_type *vec4 = glsl_vec4_type();
-   const struct glsl_type *vec3 = glsl_vector_type(GLSL_TYPE_FLOAT, 3);
+   const struct glsl_type *vec2 = glsl_vector_type(GLSL_TYPE_FLOAT, 2);
    nir_builder b;
 
    nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_FRAGMENT, NULL);
    b.shader->info.name = ralloc_strdup(b.shader, "meta_blit2d_fs");
 
    nir_variable *tex_pos_in = nir_variable_create(b.shader, nir_var_shader_in,
-                                                  vec3, "v_tex_pos");
+                                                  vec2, "v_tex_pos");
    tex_pos_in->data.location = VARYING_SLOT_VAR0;
    nir_ssa_def *const tex_pos = nir_f2i(&b, nir_load_var(&b, tex_pos_in));
 
    const struct glsl_type *sampler_type =
-      glsl_sampler_type(GLSL_SAMPLER_DIM_2D, false, true,
+      glsl_sampler_type(GLSL_SAMPLER_DIM_2D, false, false,
                         glsl_get_base_type(vec4));
    nir_variable *sampler = nir_variable_create(b.shader, nir_var_uniform,
                                                sampler_type, "s_tex");
@@ -420,7 +420,7 @@ build_nir_copy_fragment_shader()
    tex->src[1].src_type = nir_tex_src_lod;
    tex->src[1].src = nir_src_for_ssa(nir_imm_int(&b, 0));
    tex->dest_type = nir_type_float; /* TODO */
-   tex->is_array = glsl_sampler_type_is_array(sampler_type);
+   tex->is_array = false;
    tex->coord_components = tex_pos->num_components;
    tex->texture = nir_deref_var_create(tex, sampler);
    tex->sampler = NULL;