// Validate that the shaders used by the given pipeline and store the active_slots
// that are actually used by the pipeline into pPipeline->active_slots
static bool validate_and_capture_pipeline_shader_state(layer_data *my_data, PIPELINE_NODE *pPipeline) {
- auto pCreateInfo = reinterpret_cast<VkGraphicsPipelineCreateInfo const *>(&pPipeline->graphicsPipelineCI);
+ auto pCreateInfo = pPipeline->graphicsPipelineCI.ptr();
int vertex_stage = get_shader_stage_id(VK_SHADER_STAGE_VERTEX_BIT);
int fragment_stage = get_shader_stage_id(VK_SHADER_STAGE_FRAGMENT_BIT);
auto pipelineLayout = pCreateInfo->layout != VK_NULL_HANDLE ? &my_data->pipelineLayoutMap[pCreateInfo->layout] : nullptr;
for (uint32_t i = 0; i < pCreateInfo->stageCount; i++) {
- VkPipelineShaderStageCreateInfo const *pStage =
- reinterpret_cast<VkPipelineShaderStageCreateInfo const *>(&pCreateInfo->pStages[i]);
+ auto pStage = &pCreateInfo->pStages[i];
auto stage_id = get_shader_stage_id(pStage->stage);
pass &= validate_pipeline_shader_stage(my_data, pStage, pPipeline, pipelineLayout,
&shaders[stage_id], &entrypoints[stage_id]);
}
static bool validate_compute_pipeline(layer_data *my_data, PIPELINE_NODE *pPipeline) {
- auto pCreateInfo = reinterpret_cast<VkComputePipelineCreateInfo const *>(&pPipeline->computePipelineCI);
+ auto pCreateInfo = pPipeline->computePipelineCI.ptr();
auto pipelineLayout = pCreateInfo->layout != VK_NULL_HANDLE ? &my_data->pipelineLayoutMap[pCreateInfo->layout] : nullptr;
VkDescriptorSetLayoutBinding const *DescriptorSetLayout::GetDescriptorSetLayoutBindingPtrFromBinding(const uint32_t binding) {
if (!binding_to_index_map_.count(binding))
return nullptr;
- return reinterpret_cast<VkDescriptorSetLayoutBinding const *>(bindings_[binding_to_index_map_[binding]]);
+ return bindings_[binding_to_index_map_[binding]]->ptr();
}
VkDescriptorSetLayoutBinding const *DescriptorSetLayout::GetDescriptorSetLayoutBindingPtrFromIndex(const uint32_t index) {
if (index >= bindings_.size())
return nullptr;
- return reinterpret_cast<VkDescriptorSetLayoutBinding const *>(bindings_[index]);
+ return bindings_[index]->ptr();
}
// Return descriptorCount for given binding, 0 if index is unavailable
uint32_t DescriptorSetLayout::GetDescriptorCountFromBinding(const uint32_t binding) {
}
return true;
}
-#endif // CORE_VALIDATION_DESCRIPTOR_SETS_H_
\ No newline at end of file
+#endif // CORE_VALIDATION_DESCRIPTOR_SETS_H_
ss_decls.append(" %s();" % (ss_name))
ss_decls.append(" ~%s();" % (ss_name))
ss_decls.append(" void initialize(const %s* pInStruct);" % (s))
+ ss_decls.append(" %s *ptr() { return reinterpret_cast<%s *>(this); }" % (s, s))
+ ss_decls.append(" %s const *ptr() const { return reinterpret_cast<%s const *>(this); }" % (s, s))
ss_decls.append("};")
if s in ifdef_dict:
ss_decls.append('#endif')