Flip vulkan viewport
This commit is contained in:
parent
505934fae8
commit
525f5aa7f6
1 changed files with 4 additions and 3 deletions
|
@ -86,7 +86,6 @@ VkBlendFactor toVkFactor(GFXBlendFactor factor) {
|
||||||
return VK_BLEND_FACTOR_ONE;
|
return VK_BLEND_FACTOR_ONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback(
|
VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback(
|
||||||
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
|
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
|
||||||
VkDebugUtilsMessageTypeFlagsEXT messageType,
|
VkDebugUtilsMessageTypeFlagsEXT messageType,
|
||||||
|
@ -835,8 +834,9 @@ void GFXVulkan::submit(GFXCommandBuffer* command_buffer, const int identifier) {
|
||||||
renderPassInfo.framebuffer = framebuffer->handle;
|
renderPassInfo.framebuffer = framebuffer->handle;
|
||||||
|
|
||||||
VkViewport viewport = {};
|
VkViewport viewport = {};
|
||||||
|
viewport.y = static_cast<float>(framebuffer->height);
|
||||||
viewport.width = static_cast<float>(framebuffer->width);
|
viewport.width = static_cast<float>(framebuffer->width);
|
||||||
viewport.height = static_cast<float>(framebuffer->height);
|
viewport.height = -static_cast<float>(framebuffer->height);
|
||||||
viewport.maxDepth = 1.0f;
|
viewport.maxDepth = 1.0f;
|
||||||
|
|
||||||
vkCmdSetViewport(commandBuffers[imageIndex], 0, 1, &viewport);
|
vkCmdSetViewport(commandBuffers[imageIndex], 0, 1, &viewport);
|
||||||
|
@ -851,8 +851,9 @@ void GFXVulkan::submit(GFXCommandBuffer* command_buffer, const int identifier) {
|
||||||
renderPassInfo.framebuffer = swapchainFramebuffers[imageIndex];
|
renderPassInfo.framebuffer = swapchainFramebuffers[imageIndex];
|
||||||
|
|
||||||
VkViewport viewport = {};
|
VkViewport viewport = {};
|
||||||
|
viewport.y = static_cast<float>(surfaceHeight);
|
||||||
viewport.width = static_cast<float>(surfaceWidth);
|
viewport.width = static_cast<float>(surfaceWidth);
|
||||||
viewport.height = static_cast<float>(surfaceHeight);
|
viewport.height = -static_cast<float>(surfaceHeight);
|
||||||
viewport.maxDepth = 1.0f;
|
viewport.maxDepth = 1.0f;
|
||||||
|
|
||||||
vkCmdSetViewport(commandBuffers[imageIndex], 0, 1, &viewport);
|
vkCmdSetViewport(commandBuffers[imageIndex], 0, 1, &viewport);
|
||||||
|
|
Reference in a new issue