Don't use dynamic viewport for shadows
This commit is contained in:
parent
80deaf7142
commit
c92a62db3e
1 changed files with 11 additions and 13 deletions
|
@ -29,19 +29,6 @@ ShadowPass::~ShadowPass() {
|
|||
}
|
||||
|
||||
void ShadowPass::render(VkCommandBuffer commandBuffer, World& world) {
|
||||
VkViewport viewport = {};
|
||||
viewport.width = renderer_.getConfig().shadowResolution;
|
||||
viewport.height = renderer_.getConfig().shadowResolution;
|
||||
viewport.maxDepth = 1.0f;
|
||||
|
||||
vkCmdSetViewport(commandBuffer, 0, 1, &viewport);
|
||||
|
||||
VkRect2D scissor = {};
|
||||
scissor.extent.width = renderer_.getConfig().shadowResolution;
|
||||
scissor.extent.height = renderer_.getConfig().shadowResolution;
|
||||
|
||||
vkCmdSetScissor(commandBuffer, 0, 1, &scissor);
|
||||
|
||||
VkClearValue clearColor = {};
|
||||
clearColor.depthStencil.depth = 1.0f;
|
||||
|
||||
|
@ -197,10 +184,21 @@ void ShadowPass::createPipeline() {
|
|||
inputAssembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
|
||||
inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||
|
||||
VkViewport viewport = {};
|
||||
viewport.width = renderer_.getConfig().shadowResolution;
|
||||
viewport.height = renderer_.getConfig().shadowResolution;
|
||||
viewport.maxDepth = 1.0f;
|
||||
|
||||
VkRect2D scissor = {};
|
||||
scissor.extent.width = renderer_.getConfig().shadowResolution;
|
||||
scissor.extent.height = renderer_.getConfig().shadowResolution;
|
||||
|
||||
VkPipelineViewportStateCreateInfo viewportState = {};
|
||||
viewportState.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
|
||||
viewportState.viewportCount = 1;
|
||||
viewportState.pViewports = &viewport;
|
||||
viewportState.scissorCount = 1;
|
||||
viewportState.pScissors = &scissor;
|
||||
|
||||
VkPipelineRasterizationStateCreateInfo rasterizer = {};
|
||||
rasterizer.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
|
||||
|
|
Reference in a new issue