Vulkan: Frame Buffer Flipping #107743

Merged
Jeroen Bakker merged 2 commits from Jeroen-Bakker/blender:vulkan-framebuffer-flipping into main 2023-05-09 09:22:34 +02:00
2 changed files with 5 additions and 10 deletions
Showing only changes of commit c3663658ab - Show all commits

View File

@ -67,7 +67,6 @@ void VKContext::sync_backbuffer()
} }
if (ghost_context_) { if (ghost_context_) {
/* TODO deduplicate this with begin frame.*/
VkCommandBuffer command_buffer = VK_NULL_HANDLE; VkCommandBuffer command_buffer = VK_NULL_HANDLE;
GHOST_GetVulkanCommandBuffer(static_cast<GHOST_ContextHandle>(ghost_context_), GHOST_GetVulkanCommandBuffer(static_cast<GHOST_ContextHandle>(ghost_context_),
&command_buffer); &command_buffer);

View File

@ -84,9 +84,9 @@ VkViewport VKFrameBuffer::vk_viewport_get() const
viewport.maxDepth = 1.0f; viewport.maxDepth = 1.0f;
/* /*
* Vulkan has origin to the top left, Blender uses the origin at the bottom left. We counteract * Vulkan has origin to the top left, Blender bottom left. We counteract this by using a negative
* this by using a negative viewport (only when flip_viewport_ is set to true). This flips the * viewport when flip_viewport_ is set. This flips the viewport making any draw/blit use the
* viewport making any vkCmdDraw use the correct orientation. * correct orientation.
*/ */
if (flip_viewport_) { if (flip_viewport_) {
viewport.y = height_ - viewport_rect[1]; viewport.y = height_ - viewport_rect[1];
@ -257,8 +257,8 @@ void VKFrameBuffer::read(eGPUFrameBufferBits plane,
* TODO: * TODO:
* - Add support for area. * - Add support for area.
* - Add support for channel_len. * - Add support for channel_len.
* Best option would be to add this to a specific interface in VKTexture so we don't * Best option would be to add this to VKTexture so we don't over-allocate and reduce number of
* over-allocate and reduce number of times copies are made. * times copies are made.
*/ */
BLI_assert(format == GPU_DATA_FLOAT); BLI_assert(format == GPU_DATA_FLOAT);
BLI_assert(channel_len == 4); BLI_assert(channel_len == 4);
@ -382,10 +382,6 @@ void VKFrameBuffer::render_pass_create()
std::array<VkAttachmentDescription, GPU_FB_MAX_ATTACHMENT> attachment_descriptions; std::array<VkAttachmentDescription, GPU_FB_MAX_ATTACHMENT> attachment_descriptions;
std::array<VkImageView, GPU_FB_MAX_ATTACHMENT> image_views; std::array<VkImageView, GPU_FB_MAX_ATTACHMENT> image_views;
std::array<VkAttachmentReference, GPU_FB_MAX_ATTACHMENT> attachment_references; std::array<VkAttachmentReference, GPU_FB_MAX_ATTACHMENT> attachment_references;
#if 0
Vector<VkAttachmentReference> color_attachments;
VkAttachmentReference depth_attachment = {};
#endif
bool has_depth_attachment = false; bool has_depth_attachment = false;
bool found_attachment = false; bool found_attachment = false;
int depth_location = -1; int depth_location = -1;