Use dynamic viewport sizes
This commit is contained in:
@@ -100,8 +100,14 @@ namespace OpenVulkano::Vulkan
|
||||
|
||||
CreatePipelineLayout();
|
||||
|
||||
vk::GraphicsPipelineCreateInfo pipelineCreateInfo = { {}, static_cast<uint32_t>(shaderStageCreateInfo.size()), shaderStageCreateInfo.data(), &pipelineVertexInputStateCreateInfo, &inputAssembly,
|
||||
nullptr, &viewportStateCreateInfo, &rasterizer, &msaa, &depth, &colorInfo, nullptr, pipelineLayout, context->swapChainRenderPass.renderPass };
|
||||
const auto dynSates = Utils::MakeStdArray<vk::DynamicState>( vk::DynamicState::eViewport, vk::DynamicState::eScissor );
|
||||
vk::PipelineDynamicStateCreateInfo dynStateInfo { {}, dynSates.size(), dynSates.data() };
|
||||
|
||||
vk::GraphicsPipelineCreateInfo pipelineCreateInfo = { {}, static_cast<uint32_t>(shaderStageCreateInfo.size()),
|
||||
shaderStageCreateInfo.data(), &pipelineVertexInputStateCreateInfo,
|
||||
&inputAssembly, nullptr, &viewportStateCreateInfo, &rasterizer,
|
||||
&msaa, &depth, &colorInfo, shader->dynamicViewport ? &dynStateInfo : nullptr, pipelineLayout,
|
||||
context->swapChainRenderPass.renderPass };
|
||||
pipeline = this->device.createGraphicsPipeline({}, pipelineCreateInfo).value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user