Mesa (master): zink: reject invalid sample-counts

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 29 08:12:37 UTC 2019


Module: Mesa
Branch: master
Commit: 655b9aa711d78c685866b7956d0de7b2d0db52a2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=655b9aa711d78c685866b7956d0de7b2d0db52a2

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Thu Nov 28 18:41:30 2019 +0100

zink: reject invalid sample-counts

Vulkan only allows power-of-two sample counts. We already kinda checked
for this, but forgot to validate the result in the end. Let's check the
result and error properly.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/drivers/zink/zink_screen.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index cff37b9b37b..fa92424a6a6 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -490,6 +490,8 @@ zink_is_format_supported(struct pipe_screen *pscreen,
 
    if (sample_count >= 1) {
       VkSampleCountFlagBits sample_mask = vk_sample_count_flags(sample_count);
+      if (!sample_mask)
+         return false;
       const struct util_format_description *desc = util_format_description(format);
       if (util_format_is_depth_or_stencil(format)) {
          if (util_format_has_depth(desc)) {




More information about the mesa-commit mailing list