Mesa (master): radv: fix depth format in blit2d.
Dave Airlie
airlied at kemper.freedesktop.org
Mon Feb 27 20:12:11 UTC 2017
Module: Mesa
Branch: master
Commit: 800b82ea1315d68fccd8b1f218d614d26e7b6478
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=800b82ea1315d68fccd8b1f218d614d26e7b6478
Author: Dave Airlie <airlied at redhat.com>
Date: Mon Feb 27 16:59:06 2017 +1000
radv: fix depth format in blit2d.
For blitting we need to use the depth or stencil format, never
the combined.
This fixes:
dEQP-VK.texture.shadow.2d.nearest.less_or_equal_d32_sfloat_s8_uint
and a few others.
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Cc: "13.0 17.0" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/amd/vulkan/radv_meta_blit2d.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/amd/vulkan/radv_meta_blit2d.c b/src/amd/vulkan/radv_meta_blit2d.c
index 6b622e7..225b4b2 100644
--- a/src/amd/vulkan/radv_meta_blit2d.c
+++ b/src/amd/vulkan/radv_meta_blit2d.c
@@ -26,6 +26,7 @@
#include "radv_meta.h"
#include "nir/nir_builder.h"
+#include "vk_format.h"
enum blit2d_dst_type {
/* We can bind this destination as a "normal" render target and render
@@ -283,8 +284,10 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
for (unsigned r = 0; r < num_rects; ++r) {
VkFormat depth_format = 0;
- if (dst->aspect_mask != VK_IMAGE_ASPECT_COLOR_BIT)
- depth_format = dst->image->vk_format;
+ if (dst->aspect_mask == VK_IMAGE_ASPECT_STENCIL_BIT)
+ depth_format = vk_format_stencil_only(dst->image->vk_format);
+ else if (dst->aspect_mask == VK_IMAGE_ASPECT_DEPTH_BIT)
+ depth_format = vk_format_depth_only(dst->image->vk_format);
struct blit2d_src_temps src_temps;
blit2d_bind_src(cmd_buffer, src_img, src_buf, &src_temps, src_type, depth_format);
More information about the mesa-commit
mailing list