Renaming things
This commit is contained in:
parent
483671815f
commit
4e6b4fe021
1 changed files with 46 additions and 52 deletions
|
|
@ -293,16 +293,15 @@ public:
|
||||||
VkPipelineVertexInputStateCreateInfo vertexInputState = *vkglTF::Vertex::getPipelineVertexInputState({ vkglTF::VertexComponent::Position, vkglTF::VertexComponent::Normal, vkglTF::VertexComponent::Color });
|
VkPipelineVertexInputStateCreateInfo vertexInputState = *vkglTF::Vertex::getPipelineVertexInputState({ vkglTF::VertexComponent::Position, vkglTF::VertexComponent::Normal, vkglTF::VertexComponent::Color });
|
||||||
VkPipelineInputAssemblyStateCreateInfo inputAssemblyState = vks::initializers::pipelineInputAssemblyStateCreateInfo(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 0, VK_FALSE);
|
VkPipelineInputAssemblyStateCreateInfo inputAssemblyState = vks::initializers::pipelineInputAssemblyStateCreateInfo(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 0, VK_FALSE);
|
||||||
|
|
||||||
VkGraphicsPipelineCreateInfo vertexShaderCreateInfo{};
|
VkGraphicsPipelineCreateInfo pipelineCI{};
|
||||||
vertexShaderCreateInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
|
pipelineCI.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
|
||||||
vertexShaderCreateInfo.pNext = &libraryInfo;
|
pipelineCI.pNext = &libraryInfo;
|
||||||
vertexShaderCreateInfo.pInputAssemblyState = &inputAssemblyState;
|
pipelineCI.pInputAssemblyState = &inputAssemblyState;
|
||||||
vertexShaderCreateInfo.pVertexInputState = &vertexInputState;
|
pipelineCI.pVertexInputState = &vertexInputState;
|
||||||
|
|
||||||
VkPipeline vertexInputStateP;
|
VkPipeline library = VK_NULL_HANDLE;
|
||||||
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, vertexShaderCache, 1, &vertexShaderCreateInfo, nullptr, &vertexInputStateP));
|
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, vertexShaderCache, 1, &pipelineCI, nullptr, &library));
|
||||||
|
return library;
|
||||||
return vertexInputStateP;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VkPipeline createVertexShader(VkDevice device, const ShaderInfo shaderInfo, VkPipelineCache vertexShaderCache, VkPipelineLayout layout)
|
VkPipeline createVertexShader(VkDevice device, const ShaderInfo shaderInfo, VkPipelineCache vertexShaderCache, VkPipelineLayout layout)
|
||||||
|
|
@ -338,22 +337,21 @@ public:
|
||||||
shaderStageCreateInfo.stage = VK_SHADER_STAGE_VERTEX_BIT;
|
shaderStageCreateInfo.stage = VK_SHADER_STAGE_VERTEX_BIT;
|
||||||
shaderStageCreateInfo.pName = "main";
|
shaderStageCreateInfo.pName = "main";
|
||||||
|
|
||||||
VkGraphicsPipelineCreateInfo vertexShaderCreateInfo{};
|
VkGraphicsPipelineCreateInfo pipelineCI{};
|
||||||
vertexShaderCreateInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
|
pipelineCI.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
|
||||||
vertexShaderCreateInfo.pNext = &libraryInfo;
|
pipelineCI.pNext = &libraryInfo;
|
||||||
vertexShaderCreateInfo.renderPass = renderPass;
|
pipelineCI.renderPass = renderPass;
|
||||||
vertexShaderCreateInfo.flags = VK_PIPELINE_CREATE_LIBRARY_BIT_KHR | VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT;
|
pipelineCI.flags = VK_PIPELINE_CREATE_LIBRARY_BIT_KHR | VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT;
|
||||||
vertexShaderCreateInfo.stageCount = 1;
|
pipelineCI.stageCount = 1;
|
||||||
vertexShaderCreateInfo.pStages = &shaderStageCreateInfo;
|
pipelineCI.pStages = &shaderStageCreateInfo;
|
||||||
vertexShaderCreateInfo.layout = layout;
|
pipelineCI.layout = layout;
|
||||||
vertexShaderCreateInfo.pDynamicState = &dynamicInfo;
|
pipelineCI.pDynamicState = &dynamicInfo;
|
||||||
vertexShaderCreateInfo.pViewportState = &viewportState;
|
pipelineCI.pViewportState = &viewportState;
|
||||||
vertexShaderCreateInfo.pRasterizationState = &rasterizationState;
|
pipelineCI.pRasterizationState = &rasterizationState;
|
||||||
|
|
||||||
VkPipeline vertexShader;
|
VkPipeline library = VK_NULL_HANDLE;
|
||||||
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, vertexShaderCache, 1, &vertexShaderCreateInfo, nullptr, &vertexShader));
|
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, vertexShaderCache, 1, &pipelineCI, nullptr, &library));
|
||||||
|
return library;
|
||||||
return vertexShader;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VkPipeline createFragmentShader(VkDevice device, const ShaderInfo shaderInfo, VkPipelineCache vertexShaderCache, VkPipelineLayout layout)
|
VkPipeline createFragmentShader(VkDevice device, const ShaderInfo shaderInfo, VkPipelineCache vertexShaderCache, VkPipelineLayout layout)
|
||||||
|
|
@ -376,21 +374,20 @@ public:
|
||||||
shaderStageCreateInfo.stage = VK_SHADER_STAGE_FRAGMENT_BIT;
|
shaderStageCreateInfo.stage = VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||||
shaderStageCreateInfo.pName = "main";
|
shaderStageCreateInfo.pName = "main";
|
||||||
|
|
||||||
VkGraphicsPipelineCreateInfo fragmentShaderCreateInfo{};
|
VkGraphicsPipelineCreateInfo pipelineCI{};
|
||||||
fragmentShaderCreateInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
|
pipelineCI.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
|
||||||
fragmentShaderCreateInfo.pNext = &libraryInfo;
|
pipelineCI.pNext = &libraryInfo;
|
||||||
fragmentShaderCreateInfo.flags = VK_PIPELINE_CREATE_LIBRARY_BIT_KHR | VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT;
|
pipelineCI.flags = VK_PIPELINE_CREATE_LIBRARY_BIT_KHR | VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT;
|
||||||
fragmentShaderCreateInfo.stageCount = 1;
|
pipelineCI.stageCount = 1;
|
||||||
fragmentShaderCreateInfo.pStages = &shaderStageCreateInfo;
|
pipelineCI.pStages = &shaderStageCreateInfo;
|
||||||
fragmentShaderCreateInfo.layout = layout;
|
pipelineCI.layout = layout;
|
||||||
fragmentShaderCreateInfo.renderPass = renderPass;
|
pipelineCI.renderPass = renderPass;
|
||||||
fragmentShaderCreateInfo.pDepthStencilState = &depthStencilState;
|
pipelineCI.pDepthStencilState = &depthStencilState;
|
||||||
fragmentShaderCreateInfo.pMultisampleState = &multisampleState;
|
pipelineCI.pMultisampleState = &multisampleState;
|
||||||
|
|
||||||
VkPipeline fragmentShader;
|
VkPipeline library = VK_NULL_HANDLE;
|
||||||
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, vertexShaderCache, 1, &fragmentShaderCreateInfo, nullptr, &fragmentShader));
|
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, vertexShaderCache, 1, &pipelineCI, nullptr, &library));
|
||||||
|
return library;
|
||||||
return fragmentShader;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VkPipeline createFragmentOutputState(VkDevice device, VkPipelineCache vertexShaderCache, VkPipelineLayout layout)
|
VkPipeline createFragmentOutputState(VkDevice device, VkPipelineCache vertexShaderCache, VkPipelineLayout layout)
|
||||||
|
|
@ -403,19 +400,18 @@ public:
|
||||||
VkPipelineColorBlendStateCreateInfo colorBlendState = vks::initializers::pipelineColorBlendStateCreateInfo(1, &blendAttachmentState);
|
VkPipelineColorBlendStateCreateInfo colorBlendState = vks::initializers::pipelineColorBlendStateCreateInfo(1, &blendAttachmentState);
|
||||||
VkPipelineMultisampleStateCreateInfo multisampleState = vks::initializers::pipelineMultisampleStateCreateInfo(VK_SAMPLE_COUNT_1_BIT);
|
VkPipelineMultisampleStateCreateInfo multisampleState = vks::initializers::pipelineMultisampleStateCreateInfo(VK_SAMPLE_COUNT_1_BIT);
|
||||||
|
|
||||||
VkGraphicsPipelineCreateInfo fragmentShaderCreateInfo{};
|
VkGraphicsPipelineCreateInfo pipelineCI{};
|
||||||
fragmentShaderCreateInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
|
pipelineCI.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
|
||||||
fragmentShaderCreateInfo.pNext = &libraryInfo;
|
pipelineCI.pNext = &libraryInfo;
|
||||||
fragmentShaderCreateInfo.flags = VK_PIPELINE_CREATE_LIBRARY_BIT_KHR | VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT;
|
pipelineCI.flags = VK_PIPELINE_CREATE_LIBRARY_BIT_KHR | VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT;
|
||||||
fragmentShaderCreateInfo.layout = layout;
|
pipelineCI.layout = layout;
|
||||||
fragmentShaderCreateInfo.renderPass = renderPass;
|
pipelineCI.renderPass = renderPass;
|
||||||
fragmentShaderCreateInfo.pColorBlendState = &colorBlendState;
|
pipelineCI.pColorBlendState = &colorBlendState;
|
||||||
fragmentShaderCreateInfo.pMultisampleState = &multisampleState;
|
pipelineCI.pMultisampleState = &multisampleState;
|
||||||
|
|
||||||
VkPipeline fragmentShader;
|
VkPipeline library = VK_NULL_HANDLE;
|
||||||
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, vertexShaderCache, 1, &fragmentShaderCreateInfo, nullptr, &fragmentShader));
|
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, vertexShaderCache, 1, &pipelineCI, nullptr, &library));
|
||||||
|
return library;
|
||||||
return fragmentShader;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VkPipeline linkExecutable(VkDevice device, const std::vector<VkPipeline> libraries, VkPipelineCache executableCache, bool optimized)
|
VkPipeline linkExecutable(VkDevice device, const std::vector<VkPipeline> libraries, VkPipelineCache executableCache, bool optimized)
|
||||||
|
|
@ -431,9 +427,7 @@ public:
|
||||||
executablePipelineCreateInfo.flags |= optimized ? VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT : 0;
|
executablePipelineCreateInfo.flags |= optimized ? VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT : 0;
|
||||||
|
|
||||||
VkPipeline executable = VK_NULL_HANDLE;
|
VkPipeline executable = VK_NULL_HANDLE;
|
||||||
|
|
||||||
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, executableCache, 1, &executablePipelineCreateInfo, nullptr, &executable));
|
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, executableCache, 1, &executablePipelineCreateInfo, nullptr, &executable));
|
||||||
|
|
||||||
return executable;
|
return executable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue