Small code refactoring.

This commit is contained in:
Pawel Lapinski
2018-03-20 10:25:34 +01:00
parent e903d62731
commit 40f5a89f05
11 changed files with 66 additions and 62 deletions

View File

@@ -210,7 +210,7 @@ namespace ApiWithoutSecrets {
return false;
}
if( !CopyTextureData( &texture_data[0], data_size, width, height ) ) {
if( !CopyTextureData( texture_data.data(), data_size, width, height ) ) {
std::cout << "Could not upload texture data to device memory!" << std::endl;
return false;
}
@@ -753,7 +753,7 @@ namespace ApiWithoutSecrets {
nullptr, // const void *pNext
0, // VkPipelineCreateFlags flags
static_cast<uint32_t>(shader_stage_create_infos.size()), // uint32_t stageCount
&shader_stage_create_infos[0], // const VkPipelineShaderStageCreateInfo *pStages
shader_stage_create_infos.data(), // const VkPipelineShaderStageCreateInfo *pStages
&vertex_input_state_create_info, // const VkPipelineVertexInputStateCreateInfo *pVertexInputState;
&input_assembly_state_create_info, // const VkPipelineInputAssemblyStateCreateInfo *pInputAssemblyState
nullptr, // const VkPipelineTessellationStateCreateInfo *pTessellationState
@@ -788,7 +788,7 @@ namespace ApiWithoutSecrets {
nullptr, // const void *pNext
0, // VkShaderModuleCreateFlags flags
code.size(), // size_t codeSize
reinterpret_cast<const uint32_t*>(&code[0]) // const uint32_t *pCode
reinterpret_cast<const uint32_t*>(code.data()) // const uint32_t *pCode
};
VkShaderModule shader_module;
@@ -844,7 +844,7 @@ namespace ApiWithoutSecrets {
return false;
}
memcpy( staging_buffer_memory_pointer, &vertex_data[0], Vulkan.VertexBuffer.Size );
memcpy( staging_buffer_memory_pointer, vertex_data.data(), Vulkan.VertexBuffer.Size );
VkMappedMemoryRange flush_range = {
VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, // VkStructureType sType