radv: store pipeline stages that need push constants
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 18 Dec 2017 18:38:56 +0000 (19:38 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 19 Dec 2017 20:22:14 +0000 (21:22 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_descriptor_set.c
src/amd/vulkan/radv_descriptor_set.h

index 382fc9330aa76a71cef0042998d1e81172163674..e815939a67ca7b7f1638a807fc5232bfc36af4d9 100644 (file)
@@ -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);
index 7fa79186a17197da2b752e6060f3df8d8afd44dc..083a61fd99a7618eb58b5d83445a5ec4b632df4c 100644 (file)
@@ -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];