X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fpipelinestate_backend.cpp;h=a1a03d3d8fcb31d2646027036bb4936a237d4194;hp=419a7e4c149545b3de9ce19cd211da7bef5e563d;hb=b0db98d71aeb32d9e57315b8a06ff4068aeccbca;hpb=fd92cb5c68eefa4d32fbedbfa41fecc433a886a3 diff --git a/source/backends/vulkan/pipelinestate_backend.cpp b/source/backends/vulkan/pipelinestate_backend.cpp index 419a7e4c..a1a03d3d 100644 --- a/source/backends/vulkan/pipelinestate_backend.cpp +++ b/source/backends/vulkan/pipelinestate_backend.cpp @@ -356,7 +356,7 @@ unsigned VulkanPipelineState::fill_descriptor_writes(unsigned index, vector(this); const VulkanFunctions &vk = device.get_functions(); @@ -387,7 +387,7 @@ void VulkanPipelineState::apply(VkCommandBuffer command_buffer) const if(self.viewport) { viewport.x = self.viewport->left; - viewport.y = self.framebuffer->get_height()-(self.viewport->bottom+self.viewport->height); + viewport.y = self.viewport->bottom; viewport.width = self.viewport->width; viewport.height = self.viewport->height; } @@ -398,6 +398,11 @@ void VulkanPipelineState::apply(VkCommandBuffer command_buffer) const viewport.width = self.framebuffer->get_width(); viewport.height = self.framebuffer->get_height(); } + if(negative_viewport) + { + viewport.y += viewport.height; + viewport.height = -viewport.height; + } viewport.minDepth = 0.0f; viewport.maxDepth = 1.0f; vk.CmdSetViewport(command_buffer, 0, 1, &viewport); @@ -406,7 +411,7 @@ void VulkanPipelineState::apply(VkCommandBuffer command_buffer) const if(self.scissor) { scissor.offset.x = self.scissor->left; - scissor.offset.y = self.framebuffer->get_height()-(self.scissor->bottom+self.scissor->height); + scissor.offset.y = self.scissor->bottom; scissor.extent.width = self.scissor->width; scissor.extent.height = self.scissor->height; }