summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-12-18 19:38:56 +0100
committerSamuel Pitoiset <[email protected]>2017-12-19 21:22:14 +0100
commitca8f3a8d558e5d7ff0d27edeaf226222b500cead (patch)
treeeaf6337ed869f2177abcc79f2ba0f3d29a295199
parent1cecaa9174a0d3c14163ca276e39ac6771f81601 (diff)
radv: store pipeline stages that need push constants
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r--src/amd/vulkan/radv_descriptor_set.c3
-rw-r--r--src/amd/vulkan/radv_descriptor_set.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c
index 382fc9330aa..e815939a67c 100644
--- a/src/amd/vulkan/radv_descriptor_set.c
+++ b/src/amd/vulkan/radv_descriptor_set.c
@@ -228,10 +228,13 @@ VkResult radv_CreatePipelineLayout(
layout->dynamic_offset_count = dynamic_offset_count;
layout->push_constant_size = 0;
+ layout->push_constant_stages = 0;
+
for (unsigned i = 0; i < pCreateInfo->pushConstantRangeCount; ++i) {
const VkPushConstantRange *range = pCreateInfo->pPushConstantRanges + i;
layout->push_constant_size = MAX2(layout->push_constant_size,
range->offset + range->size);
+ layout->push_constant_stages |= range->stageFlags;
}
layout->push_constant_size = align(layout->push_constant_size, 16);
diff --git a/src/amd/vulkan/radv_descriptor_set.h b/src/amd/vulkan/radv_descriptor_set.h
index 7fa79186a17..083a61fd99a 100644
--- a/src/amd/vulkan/radv_descriptor_set.h
+++ b/src/amd/vulkan/radv_descriptor_set.h
@@ -83,6 +83,7 @@ struct radv_pipeline_layout {
uint32_t num_sets;
uint32_t push_constant_size;
+ VkShaderStageFlags push_constant_stages;
uint32_t dynamic_offset_count;
unsigned char sha1[20];