Added some code for the viewport
This commit is contained in:
parent
829e3fd3d8
commit
0a4cb972e2
1 changed files with 24 additions and 0 deletions
24
src/main.c
24
src/main.c
|
|
@ -713,6 +713,30 @@ void createGraphicsPipeline(Application *app) {
|
|||
vertexInputInfo.vertexAttributeDescriptionCount = 0;
|
||||
vertexInputInfo.pVertexAttributeDescriptions = NULL; // Optional
|
||||
|
||||
VkPipelineInputAssemblyStateCreateInfo inputAssembly = {0};
|
||||
inputAssembly.sType =
|
||||
VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
|
||||
inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||
inputAssembly.primitiveRestartEnable = VK_FALSE;
|
||||
|
||||
VkViewport viewport = {0};
|
||||
viewport.x = 0.0f;
|
||||
viewport.y = 0.0f;
|
||||
viewport.width = (float)app->swapChainExtent.width;
|
||||
viewport.height = (float)app->swapChainExtent.height;
|
||||
viewport.minDepth = 0.0f;
|
||||
viewport.maxDepth = 1.0f;
|
||||
|
||||
VkPipelineViewportStateCreateInfo viewportState = {0};
|
||||
viewportState.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
|
||||
viewportState.viewportCount = 1;
|
||||
viewportState.scissorCount = 1;
|
||||
|
||||
VkRect2D scissor = {0};
|
||||
scissor.offset.x = 0;
|
||||
scissor.offset.y = 0;
|
||||
scissor.extent = app->swapChainExtent;
|
||||
|
||||
vkDestroyShaderModule(app->device, fragShaderModule, NULL);
|
||||
vkDestroyShaderModule(app->device, vertShaderModule, NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue