return n_writes;
}
-void VulkanPipelineState::apply(VkCommandBuffer command_buffer) const
+void VulkanPipelineState::apply(VkCommandBuffer command_buffer, bool negative_viewport) const
{
const PipelineState &self = *static_cast<const PipelineState *>(this);
const VulkanFunctions &vk = device.get_functions();
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;
}
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);
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;
}