radv: replace an assertion with a conditional
authorFredrik Höglund <fredrik@kde.org>
Wed, 29 Mar 2017 16:11:56 +0000 (18:11 +0200)
committerFredrik Höglund <fredrik@kde.org>
Thu, 6 Apr 2017 22:54:46 +0000 (00:54 +0200)
Replace the !binding_layout->immutable_samplers assertion in
radv_update_descriptor_sets with a conditional.

The Vulkan specification does not say that it is illegal to update
a sampler descriptor when it is immutable; only that pImageInfo is
ignored.

This change is also needed for push descriptors, because valid
descriptors must be pushed for all bindings accessed by shaders,
including immutable sampler descriptors.

Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_descriptor_set.c

index aca5effef2e8308225261236af3eb27b9a86ac0d..aefe0c38081885c762cfee84b8eb54bdf5ff3766 100644 (file)
@@ -693,9 +693,9 @@ void radv_update_descriptor_sets(
                                                                        !binding_layout->immutable_samplers);
                                break;
                        case VK_DESCRIPTOR_TYPE_SAMPLER:
-                               assert(!binding_layout->immutable_samplers);
-                               write_sampler_descriptor(device, ptr,
-                                                        writeset->pImageInfo + j);
+                               if (!binding_layout->immutable_samplers)
+                                       write_sampler_descriptor(device, ptr,
+                                                                writeset->pImageInfo + j);
                                break;
                        default:
                                unreachable("unimplemented descriptor type");