From d6a7c659c75c5b1ae16652ad9d86245000702484 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 20 Nov 2015 16:00:32 -0800 Subject: [PATCH] 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. --- src/vulkan/anv_meta.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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); -- 2.30.2