diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-07-07 08:14:48 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-07-07 13:43:00 -0600 |
| commit | c47591b3b0db616ef1c953bbe72cfdb93fc49257 (patch) | |
| tree | 4158678d00d0cd685c09de3c1a340b0c4097ce15 | |
| parent | afcc59c24d2e42270b16999637cc1bdb29d39a34 (diff) | |
| download | usermoji-c47591b3b0db616ef1c953bbe72cfdb93fc49257.tar.xz | |
layers: Store PIPELINE_LAYOUT_NODE directly in PIPELINE_NODE
The layout and its associated node may be deleted after pipeline is
created so store a copy of the PIPELINE_LAYOUT_NODE in the
PIPELINE_NODE to make sure data is available when it's needed.
| -rw-r--r-- | layers/core_validation.cpp | 9 | ||||
| -rw-r--r-- | layers/core_validation.h | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 7f00c91c..53bb7183 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -2614,8 +2614,7 @@ static bool validate_pipeline_shader_stage(debug_report_data *report_data, auto pipelineLayout = pipeline->pipeline_layout; /* validate push constant usage */ - pass &= validate_push_constant_usage(report_data, &pipelineLayout->pushConstantRanges, - module, accessible_ids, pStage->stage); + pass &= validate_push_constant_usage(report_data, &pipelineLayout.pushConstantRanges, module, accessible_ids, pStage->stage); /* validate descriptor use */ for (auto use : descriptor_uses) { @@ -2623,7 +2622,7 @@ static bool validate_pipeline_shader_stage(debug_report_data *report_data, pipeline->active_slots[use.first.first].insert(use.first.second); /* verify given pipelineLayout has requested setLayout with requested binding */ - const auto & binding = get_descriptor_binding(pipelineLayout, use.first); + const auto &binding = get_descriptor_binding(&pipelineLayout, use.first); unsigned required_descriptor_count; if (!binding) { @@ -5859,7 +5858,7 @@ CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t pPipeNode[i] = new PIPELINE_NODE; pPipeNode[i]->initGraphicsPipeline(&pCreateInfos[i]); pPipeNode[i]->render_pass_ci.initialize(getRenderPass(dev_data, pCreateInfos[i].renderPass)->pCreateInfo); - pPipeNode[i]->pipeline_layout = getPipelineLayout(dev_data, pCreateInfos[i].layout); + pPipeNode[i]->pipeline_layout = *getPipelineLayout(dev_data, pCreateInfos[i].layout); skip_call |= verifyPipelineCreateState(dev_data, device, pPipeNode, i); } @@ -5903,7 +5902,7 @@ CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t // Create and initialize internal tracking data structure pPipeNode[i] = new PIPELINE_NODE; pPipeNode[i]->initComputePipeline(&pCreateInfos[i]); - pPipeNode[i]->pipeline_layout = getPipelineLayout(dev_data, pCreateInfos[i].layout); + pPipeNode[i]->pipeline_layout = *getPipelineLayout(dev_data, pCreateInfos[i].layout); // memcpy(&pPipeNode[i]->computePipelineCI, (const void *)&pCreateInfos[i], sizeof(VkComputePipelineCreateInfo)); // TODO: Add Compute Pipeline Verification diff --git a/layers/core_validation.h b/layers/core_validation.h index 91cfc06d..6e7d0775 100644 --- a/layers/core_validation.h +++ b/layers/core_validation.h @@ -149,13 +149,13 @@ class PIPELINE_NODE { bool blendConstantsEnabled; // Blend constants enabled for any attachments // Store RPCI b/c renderPass may be destroyed after Pipeline creation safe_VkRenderPassCreateInfo render_pass_ci; - PIPELINE_LAYOUT_NODE const *pipeline_layout; + PIPELINE_LAYOUT_NODE pipeline_layout; // Default constructor PIPELINE_NODE() : pipeline{}, graphicsPipelineCI{}, computePipelineCI{}, active_shaders(0), duplicate_shaders(0), active_slots(), vertexBindingDescriptions(), vertexAttributeDescriptions(), attachments(), blendConstantsEnabled(false), render_pass_ci(), - pipeline_layout(nullptr) {} + pipeline_layout() {} void initGraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateInfo) { graphicsPipelineCI.initialize(pCreateInfo); |
