begin_buffer(render_pass);
StructureBuilder sb(pass_begin_info, 2);
- VkRenderPassBeginInfo *&begin_info = sb.add<VkRenderPassBeginInfo>(1);
- VkClearValue *&vk_clear_values = sb.add<VkClearValue>(FrameFormat::MAX_ATTACHMENTS);
+ VkRenderPassBeginInfo *const &begin_info = sb.add<VkRenderPassBeginInfo>(1);
+ VkClearValue *const &vk_clear_values = sb.add<VkClearValue>(FrameFormat::MAX_ATTACHMENTS);
begin_info->sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
begin_info->renderPass = handle_cast<::VkRenderPass>(render_pass);
}
StructureBuilder sb(buffer, 10);
- VkGraphicsPipelineCreateInfo *&pipeline_info = sb.add<VkGraphicsPipelineCreateInfo>();
- VkPipelineInputAssemblyStateCreateInfo *&input_assembly_info = sb.add<VkPipelineInputAssemblyStateCreateInfo>();
- VkPipelineViewportStateCreateInfo *&viewport_info = sb.add<VkPipelineViewportStateCreateInfo>();
- VkPipelineRasterizationStateCreateInfo *&raster_info = sb.add<VkPipelineRasterizationStateCreateInfo>();
- VkPipelineMultisampleStateCreateInfo *&multisample_info = sb.add<VkPipelineMultisampleStateCreateInfo>();
- VkPipelineDepthStencilStateCreateInfo *&depth_stencil_info = sb.add<VkPipelineDepthStencilStateCreateInfo>();
- VkPipelineColorBlendStateCreateInfo *&blend_info = sb.add<VkPipelineColorBlendStateCreateInfo>();
- VkPipelineColorBlendAttachmentState *&blend_attachments = sb.add<VkPipelineColorBlendAttachmentState>(n_color_attachments);
- VkPipelineDynamicStateCreateInfo *&dynamic_info = sb.add<VkPipelineDynamicStateCreateInfo>();
- VkDynamicState *&dynamic_states = sb.add<VkDynamicState>(2);
+ VkGraphicsPipelineCreateInfo *const &pipeline_info = sb.add<VkGraphicsPipelineCreateInfo>();
+ VkPipelineInputAssemblyStateCreateInfo *const &input_assembly_info = sb.add<VkPipelineInputAssemblyStateCreateInfo>();
+ VkPipelineViewportStateCreateInfo *const &viewport_info = sb.add<VkPipelineViewportStateCreateInfo>();
+ VkPipelineRasterizationStateCreateInfo *const &raster_info = sb.add<VkPipelineRasterizationStateCreateInfo>();
+ VkPipelineMultisampleStateCreateInfo *const &multisample_info = sb.add<VkPipelineMultisampleStateCreateInfo>();
+ VkPipelineDepthStencilStateCreateInfo *const &depth_stencil_info = sb.add<VkPipelineDepthStencilStateCreateInfo>();
+ VkPipelineColorBlendStateCreateInfo *const &blend_info = sb.add<VkPipelineColorBlendStateCreateInfo>();
+ VkPipelineColorBlendAttachmentState *const &blend_attachments = sb.add<VkPipelineColorBlendAttachmentState>(n_color_attachments);
+ VkPipelineDynamicStateCreateInfo *const &dynamic_info = sb.add<VkPipelineDynamicStateCreateInfo>();
+ VkDynamicState *const &dynamic_states = sb.add<VkDynamicState>(2);
input_assembly_info->sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
input_assembly_info->topology = static_cast<VkPrimitiveTopology>(get_vulkan_primitive_type(self.primitive_type));
unsigned n_writes = n_buffers+n_images;
StructureBuilder sb(buffer, 3);
- VkWriteDescriptorSet *&writes = sb.add<VkWriteDescriptorSet>(n_writes);
- VkDescriptorBufferInfo *&buffers = sb.add<VkDescriptorBufferInfo>(n_buffers);
- VkDescriptorImageInfo *&images = sb.add<VkDescriptorImageInfo>(n_images);
+ VkWriteDescriptorSet *const &writes = sb.add<VkWriteDescriptorSet>(n_writes);
+ VkDescriptorBufferInfo *const &buffers = sb.add<VkDescriptorBufferInfo>(n_buffers);
+ VkDescriptorImageInfo *const &images = sb.add<VkDescriptorImageInfo>(n_images);
VkWriteDescriptorSet *write_ptr = writes;
VkDescriptorBufferInfo *buffer_ptr = buffers;
entry_names_size += e.name.size()+1;
StructureBuilder sb(creation_info, 5);
- VkPipelineShaderStageCreateInfo *&stage_infos = sb.add<VkPipelineShaderStageCreateInfo>(n_stages);
- char *&name_table = sb.add<char>(entry_names_size);
- VkSpecializationInfo *&spec_info = sb.add<VkSpecializationInfo>();
- VkSpecializationMapEntry *&spec_map = sb.add<VkSpecializationMapEntry>(spec_values.size());
- int *&spec_data = sb.add<int>(spec_values.size());
+ VkPipelineShaderStageCreateInfo *const &stage_infos = sb.add<VkPipelineShaderStageCreateInfo>(n_stages);
+ char *const &name_table = sb.add<char>(entry_names_size);
+ VkSpecializationInfo *const &spec_info = sb.add<VkSpecializationInfo>();
+ VkSpecializationMapEntry *const &spec_map = sb.add<VkSpecializationMapEntry>(spec_values.size());
+ int *const &spec_data = sb.add<int>(spec_values.size());
unsigned i = 0;
for(const SpirVModule::Constant &c: mod.get_spec_constants())
parts.reserve(max_parts);
}
-void *&StructureBuilder::add(std::size_t size, std::size_t align)
+void *const &StructureBuilder::add(std::size_t size, std::size_t align)
{
if(parts.size()>=parts.capacity())
throw invalid_operation("StructureBuilder::add");
StructureBuilder(std::vector<char> &, unsigned);
template<typename T>
- T *&add(std::size_t count = 1)
- { return reinterpret_cast<T *&>(add(sizeof(T)*count, alignof(T))); }
+ T *const &add(std::size_t count = 1)
+ { return reinterpret_cast<T *const &>(add(sizeof(T)*count, alignof(T))); }
private:
- void *&add(std::size_t, std::size_t);
+ void *const &add(std::size_t, std::size_t);
};
} // namespace GL
n_attribs += !is_padding(a);
StructureBuilder sb(creation_info, 3);
- VkPipelineVertexInputStateCreateInfo *&input_state = sb.add<VkPipelineVertexInputStateCreateInfo>();
- VkVertexInputBindingDescription *&bindings = sb.add<VkVertexInputBindingDescription>(n_bindings);
- VkVertexInputAttributeDescription *&attribs = sb.add<VkVertexInputAttributeDescription>(n_attribs);
+ VkPipelineVertexInputStateCreateInfo *const &input_state = sb.add<VkPipelineVertexInputStateCreateInfo>();
+ VkVertexInputBindingDescription *const &bindings = sb.add<VkVertexInputBindingDescription>(n_bindings);
+ VkVertexInputAttributeDescription *const &attribs = sb.add<VkVertexInputAttributeDescription>(n_attribs);
bindings[0].binding = 0;
bindings[0].stride = self.vertex_format.stride();