From 03bea8fda790592685d33743a5c9ce36b2fa91f0 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Fri, 12 Feb 2016 11:27:19 -0800 Subject: [PATCH] anv/meta_blit: Remove references to clearing Long ago, the blit code used to handle clearing and blitting. - Fix any comments that refer to clearing. - Rename shader var 'attr' to 'tex_pos'. The name 'attr' is an artifact of the time when the shader was used for blitting as well as clearing. --- src/vulkan/anv_meta_blit.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/vulkan/anv_meta_blit.c b/src/vulkan/anv_meta_blit.c index 3a777705ef1..07ebcbc06b1 100644 --- a/src/vulkan/anv_meta_blit.c +++ b/src/vulkan/anv_meta_blit.c @@ -48,17 +48,14 @@ build_nir_vertex_shader(void) pos_out->data.location = VARYING_SLOT_POS; nir_copy_var(&b, pos_out, pos_in); - /* Add one more pass-through attribute. For clear shaders, this is used - * to store the color and for blit shaders it's the texture coordinate. - */ - nir_variable *attr_in = nir_variable_create(b.shader, nir_var_shader_in, - vec4, "a_attr"); - attr_in->data.location = VERT_ATTRIB_GENERIC1; - nir_variable *attr_out = nir_variable_create(b.shader, nir_var_shader_out, - vec4, "v_attr"); - attr_out->data.location = VARYING_SLOT_VAR0; - attr_out->data.interpolation = INTERP_QUALIFIER_SMOOTH; - nir_copy_var(&b, attr_out, attr_in); + nir_variable *tex_pos_in = nir_variable_create(b.shader, nir_var_shader_in, + vec4, "a_tex_pos"); + tex_pos_in->data.location = VERT_ATTRIB_GENERIC1; + nir_variable *tex_pos_out = nir_variable_create(b.shader, nir_var_shader_out, + vec4, "v_tex_pos"); + tex_pos_out->data.location = VARYING_SLOT_VAR0; + tex_pos_out->data.interpolation = INTERP_QUALIFIER_SMOOTH; + nir_copy_var(&b, tex_pos_out, tex_pos_in); return b.shader; } @@ -73,7 +70,7 @@ build_nir_copy_fragment_shader(enum glsl_sampler_dim tex_dim) b.shader->info.name = ralloc_strdup(b.shader, "meta_blit_fs"); nir_variable *tex_pos_in = nir_variable_create(b.shader, nir_var_shader_in, - vec4, "v_attr"); + vec4, "v_tex_pos"); tex_pos_in->data.location = VARYING_SLOT_VAR0; /* Swizzle the array index which comes in as Z coordinate into the right @@ -1205,7 +1202,7 @@ anv_device_init_meta_blit_state(struct anv_device *device) if (result != VK_SUCCESS) goto fail; - /* We don't use a vertex shader for clearing, but instead build and pass + /* We don't use a vertex shader for blitting, but instead build and pass * the VUEs directly to the rasterization backend. However, we do need * to provide GLSL source for the vertex shader so that the compiler * does not dead-code our inputs. -- 2.30.2