Changeset 5b02676 in opengl-game for vulkan-ref.cpp
- Timestamp:
- Oct 4, 2019, 8:10:09 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 83b5b4b
- Parents:
- ee75487
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-ref.cpp
ree75487 r5b02676 61 61 vector<VkPresentModeKHR> presentModes; 62 62 }; 63 /*** END OF REFACTORED CODE ***/64 63 65 64 struct Vertex { … … 73 72 glm::vec2 texCoord; 74 73 }; 74 /*** END OF REFACTORED CODE ***/ 75 75 76 76 struct UniformBufferObject { … … 174 174 vector<VkImage> swapChainImages; 175 175 VkFormat swapChainImageFormat; 176 VkExtent2D swapChainExtent; 176 /*** END OF REFACTORED CODE ***/ 177 VkExtent2D swapChainExtent; // (This was taken out of vulkan-game for now and replaced with Viewport) 178 /*** START OF REFACTORED CODE ***/ 177 179 vector<VkImageView> swapChainImageViews; 178 180 /*** END OF REFACTORED CODE ***/ … … 369 371 sceneIndices.data(), sizeof(uint16_t), sceneIndices.size()); 370 372 373 /*** START OF REFACTORED CODE ***/ 371 374 addAttributeDescription(scenePipeline, VK_FORMAT_R32G32B32_SFLOAT, offset_of(&Vertex::pos)); 372 375 addAttributeDescription(scenePipeline, VK_FORMAT_R32G32B32_SFLOAT, offset_of(&Vertex::color)); 373 376 addAttributeDescription(scenePipeline, VK_FORMAT_R32G32_SFLOAT, offset_of(&Vertex::texCoord)); 377 /*** END OF REFACTORED CODE ***/ 374 378 375 379 addDescriptorInfo(scenePipeline, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT, &uniformBufferInfoList, nullptr); … … 394 398 overlayIndices.data(), sizeof(uint16_t), overlayIndices.size()); 395 399 400 /*** START OF REFACTORED CODE ***/ 396 401 addAttributeDescription(overlayPipeline, VK_FORMAT_R32G32B32_SFLOAT, offset_of(&OverlayVertex::pos)); 397 402 addAttributeDescription(overlayPipeline, VK_FORMAT_R32G32_SFLOAT, offset_of(&OverlayVertex::texCoord)); 403 /*** END OF REFACTORED CODE ***/ 398 404 399 405 addDescriptorInfo(overlayPipeline, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, nullptr, &overlayImageInfo); … … 809 815 const void* vertexData, int vertexSize, size_t numVertices, 810 816 const void* indexData, int indexSize, size_t numIndices) { 817 /*** START OF REFACTORED CODE ***/ 811 818 // Since there is only one array of vertex data, we use binding = 0 812 819 // I'll probably do that for the foreseeable future … … 816 823 info.bindingDescription.stride = vertexSize; 817 824 info.bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX; 825 /*** END OF REFACTORED CODE ***/ 818 826 819 827 info.numVertices = numVertices; … … 886 894 VkPipelineVertexInputStateCreateInfo vertexInputInfo = {}; 887 895 vertexInputInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; 888 /*** END OF REFACTORED CODE ***/889 896 890 897 vertexInputInfo.vertexBindingDescriptionCount = 1; … … 968 975 pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; 969 976 pipelineLayoutInfo.setLayoutCount = 1; 977 /*** END OF REFACTORED CODE ***/ 970 978 pipelineLayoutInfo.pSetLayouts = &info.descriptorSetLayout; 971 979 pipelineLayoutInfo.pushConstantRangeCount = 0;
Note:
See TracChangeset
for help on using the changeset viewer.