anv/blit: Use CLAMP_TO_EDGE for scaled blits
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 2 Jun 2016 23:34:11 +0000 (16:34 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 4 Jun 2016 02:29:28 +0000 (19:29 -0700)
When upscaling you can end up interpolating between the edge pixel and one
past the edge.  Using CLAMP_TO_EDGE seems like the most reasonable thing to
do in this case.  This fixes two of the new Vulkan CTS tests in
dEQP-VK.api.copy_and_blit.blit_image.*

Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/intel/vulkan/anv_meta_blit.c

index 3c54ef4bafbef5dc6881e2d0e2a7ab5270937923..dc098efca39315def7987c1ac4717cd059b3b140 100644 (file)
@@ -211,6 +211,9 @@ meta_emit_blit(struct anv_cmd_buffer *cmd_buffer,
          .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
          .magFilter = blit_filter,
          .minFilter = blit_filter,
+         .addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
+         .addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
+         .addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
       }, &cmd_buffer->pool->alloc, &sampler);
 
    VkDescriptorPool desc_pool;