From: Jason Ekstrand Date: Sat, 21 Nov 2015 00:00:32 +0000 (-0800) Subject: anv/meta: Use array textures for 2D X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6a7c659c75c5b1ae16652ad9d86245000702484;p=mesa.git anv/meta: Use array textures for 2D This a total of 1 extra instruction in the shader and gives us a lot more flexibility in how we do blits. --- diff --git a/src/vulkan/anv_meta.c b/src/vulkan/anv_meta.c index 7cf60768158..5df33c0a8d1 100644 --- a/src/vulkan/anv_meta.c +++ b/src/vulkan/anv_meta.c @@ -95,16 +95,9 @@ build_nir_copy_fragment_shader(enum glsl_sampler_dim tex_dim) tex->src[0].src = nir_src_for_ssa(nir_load_var(&b, tex_pos_in)); tex->dest_type = nir_type_float; /* TODO */ - switch (tex_dim) { - case GLSL_SAMPLER_DIM_2D: - tex->coord_components = 2; - break; - case GLSL_SAMPLER_DIM_3D: - tex->coord_components = 3; - break; - default: - assert(!"Unsupported texture dimension"); - } + if (tex_dim == GLSL_SAMPLER_DIM_2D) + tex->is_array = true; + tex->coord_components = 3; tex->sampler = nir_deref_var_create(tex, sampler);