summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_descriptor_set.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2017-02-27 09:44:48 +0100
committerBas Nieuwenhuizen <[email protected]>2017-02-28 20:48:10 +0100
commit500e6e40f683fbad09f38360bb79f8a12442c408 (patch)
tree68451576e44852a950286ef7e4947893fc5751b7 /src/amd/vulkan/radv_descriptor_set.c
parentdd2a0c7aef0887554a36134fc2fa762afa90287b (diff)
radv: Detect if all immutable samplers for a binding are equal.
We can then use constants for indexed loads. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_descriptor_set.c')
-rw-r--r--src/amd/vulkan/radv_descriptor_set.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c
index b24ff91d3ed..d8399574f2a 100644
--- a/src/amd/vulkan/radv_descriptor_set.c
+++ b/src/amd/vulkan/radv_descriptor_set.c
@@ -132,10 +132,15 @@ VkResult radv_CreateDescriptorSetLayout(
if (binding->pImmutableSamplers) {
set_layout->binding[b].immutable_samplers = samplers;
+ set_layout->binding[b].immutable_samplers_equal = true;
samplers += 4 * binding->descriptorCount;
for (uint32_t i = 0; i < binding->descriptorCount; i++)
memcpy(set_layout->binding[b].immutable_samplers + 4 * i, &radv_sampler_from_handle(binding->pImmutableSamplers[i])->state, 16);
+ for (uint32_t i = 1; i < binding->descriptorCount; i++)
+ if (memcmp(set_layout->binding[b].immutable_samplers + 4 * i,
+ set_layout->binding[b].immutable_samplers, 16) != 0)
+ set_layout->binding[b].immutable_samplers_equal = false;
} else {
set_layout->binding[b].immutable_samplers = NULL;
}