Mesa (master): radv: replace an assertion with a conditional

Fredrik Höglund fredrik at kemper.freedesktop.org
Thu Apr 6 22:57:05 UTC 2017


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

Author: Fredrik Höglund <fredrik at kde.org>
Date:   Wed Mar 29 18:11:56 2017 +0200

radv: replace an assertion with a conditional

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 at kde.org>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_descriptor_set.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c
index aca5effef2..aefe0c3808 100644
--- a/src/amd/vulkan/radv_descriptor_set.c
+++ b/src/amd/vulkan/radv_descriptor_set.c
@@ -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");




More information about the mesa-commit mailing list