Module: Mesa
Branch: staging/20.0
Commit: d13c6c251e49e6f196f8646d334bc9d98c4e448c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d13c6c251e49e6f196f8646d334bc9d98c4e448c

Author: Samuel Pitoiset <[email protected]>
Date:   Wed Apr 15 18:08:10 2020 +0200

radv: do not abort with unknown/unimplemented descriptor types

To workaround a crash with Wolfeinstein Younglood because the
games creates one descriptor with
VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV...

I reported the problem to Machine Games, but still no answer, so
let's remove the unreachable calls (which are technically not
unreachable for buggy apps) to help gamers.

Note that AMDVLK and AMDGPU-PRO don't crash because they ignore
unsupported descriptor types.

Cc: <[email protected]>
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4571>
(cherry picked from commit 35b396392880871b8cc06172dafff238e67c44cc)

---

 .pick_status.json                    | 2 +-
 src/amd/vulkan/radv_descriptor_set.c | 7 +------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 86dcc07d10a..51c4acce413 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1966,7 +1966,7 @@
         "description": "radv: do not abort with unknown/unimplemented 
descriptor types",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/amd/vulkan/radv_descriptor_set.c 
b/src/amd/vulkan/radv_descriptor_set.c
index 33947ea3726..ea3d733ba61 100644
--- a/src/amd/vulkan/radv_descriptor_set.c
+++ b/src/amd/vulkan/radv_descriptor_set.c
@@ -150,7 +150,7 @@ VkResult radv_CreateDescriptorSetLayout(
        for (uint32_t j = 0; j < pCreateInfo->bindingCount; j++) {
                const VkDescriptorSetLayoutBinding *binding = bindings + j;
                uint32_t b = binding->binding;
-               uint32_t alignment;
+               uint32_t alignment = 0;
                unsigned binding_buffer_count = 0;
                uint32_t descriptor_count = binding->descriptorCount;
                bool has_ycbcr_sampler = false;
@@ -214,7 +214,6 @@ VkResult radv_CreateDescriptorSetLayout(
                        descriptor_count = 1;
                        break;
                default:
-                       unreachable("unknown descriptor type\n");
                        break;
                }
 
@@ -363,7 +362,6 @@ void radv_GetDescriptorSetLayoutSupport(VkDevice device,
                        descriptor_count = 1;
                        break;
                default:
-                       unreachable("unknown descriptor type\n");
                        break;
                }
 
@@ -673,7 +671,6 @@ VkResult radv_CreateDescriptorPool(
                        bo_size += pCreateInfo->pPoolSizes[i].descriptorCount;
                        break;
                default:
-                       unreachable("unknown descriptor type\n");
                        break;
                }
        }
@@ -1050,7 +1047,6 @@ void radv_update_descriptor_sets(
                                }
                                break;
                        default:
-                               unreachable("unimplemented descriptor type");
                                break;
                        }
                        ptr += binding_layout->size / 4;
@@ -1303,7 +1299,6 @@ void radv_update_descriptor_set_with_template(struct 
radv_device *device,
                                        memcpy(pDst, 
templ->entry[i].immutable_samplers + 4 * j, 16);
                                break;
                        default:
-                               unreachable("unimplemented descriptor type");
                                break;
                        }
                        pSrc += templ->entry[i].src_stride;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to