aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-07-07 08:14:48 -0600
committerTobin Ehlis <tobine@google.com>2016-07-07 13:43:00 -0600
commitc47591b3b0db616ef1c953bbe72cfdb93fc49257 (patch)
tree4158678d00d0cd685c09de3c1a340b0c4097ce15 /layers/core_validation.cpp
parentafcc59c24d2e42270b16999637cc1bdb29d39a34 (diff)
downloadusermoji-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.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp9
1 files changed, 4 insertions, 5 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