Vulkan: Rewrite GHOST_ContextVK #111473

Merged
Jeroen Bakker merged 21 commits from Jeroen-Bakker/blender:vulkan/swap-chain-callbacks into main 2023-08-29 15:05:16 +02:00
Member

This is a rewrite of GHOST_ContextVK to align with Metal backend as described
in #111389 - solution 3 with the adaptation that GHOST is still responsible
for presenting the swap chain image and a post callback is still needed in
case the swapchain needed to be recreated.

Technical documentation: https://developer.blender.org/docs/eevee_and_viewport/gpu/vulkan/swap_chain/

  • Renderpasses and framebuffers are not owned anymore by GHOST_ContextVK
  • VKFramebuffer doesn't contain a swap chain image.
  • Swapchain images can only be used as a blit destination or present source.
    Not as an attachment.
  • GHOST_ContextVK::swapBuffers would call a callback with the image the
    GPU module needs to blit the results to.
  • Clearing of depth/stencil attachments when no depth write state is set.
  • Enable VK_KHR_maintenance4 to relax the stage interface mapping.
  • Removes most vulkan validation warnings/errors.
  • Detection of frame buffer changes that needs to be applied before
    performing a command requiring render pass (draw/clear attachment)

Benefits

  • Late retrieval of a swap chain image results in better overall performance as
    Blender doesn't need to wait until the image is presented on the screen.
  • Easier API and clearer state (transitions)
  • More control over Image layouts and command buffer states. (Better alignment with
    Vulkan API)
This is a rewrite of GHOST_ContextVK to align with Metal backend as described in #111389 - solution 3 with the adaptation that GHOST is still responsible for presenting the swap chain image and a post callback is still needed in case the swapchain needed to be recreated. Technical documentation: https://developer.blender.org/docs/eevee_and_viewport/gpu/vulkan/swap_chain/ * Renderpasses and framebuffers are not owned anymore by GHOST_ContextVK * VKFramebuffer doesn't contain a swap chain image. * Swapchain images can only be used as a blit destination or present source. Not as an attachment. * GHOST_ContextVK::swapBuffers would call a callback with the image the GPU module needs to blit the results to. * Clearing of depth/stencil attachments when no depth write state is set. * Enable VK_KHR_maintenance4 to relax the stage interface mapping. * Removes most vulkan validation warnings/errors. * Detection of frame buffer changes that needs to be applied before performing a command requiring render pass (draw/clear attachment) **Benefits** * Late retrieval of a swap chain image results in better overall performance as Blender doesn't need to wait until the image is presented on the screen. * Easier API and clearer state (transitions) * More control over Image layouts and command buffer states. (Better alignment with Vulkan API)
Jeroen Bakker added this to the 4.0 milestone 2023-08-24 15:42:36 +02:00
Jeroen Bakker added the
Interest
Vulkan
label 2023-08-24 15:42:36 +02:00
Jeroen Bakker self-assigned this 2023-08-24 15:42:36 +02:00
Jeroen Bakker added 1 commit 2023-08-24 15:42:49 +02:00
Jeroen Bakker added 4 commits 2023-08-25 09:26:09 +02:00
Jeroen Bakker added 1 commit 2023-08-25 11:11:52 +02:00
Jeroen Bakker added 1 commit 2023-08-25 11:35:47 +02:00
Jeroen Bakker added 1 commit 2023-08-25 14:00:37 +02:00
Jeroen Bakker added 2 commits 2023-08-28 13:00:26 +02:00
Jeroen Bakker added 1 commit 2023-08-28 13:36:08 +02:00
Jeroen Bakker added 6 commits 2023-08-29 09:57:28 +02:00
Jeroen Bakker added 4 commits 2023-08-29 12:57:21 +02:00
Jeroen Bakker added this to the EEVEE & Viewport project 2023-08-29 13:31:20 +02:00
Jeroen Bakker changed title from WIP: Vulkan: Rewrite GHOST_ContextVK to Vulkan: Rewrite GHOST_ContextVK 2023-08-29 13:31:26 +02:00
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR111473) when ready.
Jeroen Bakker merged commit bee3f645d8 into main 2023-08-29 15:05:16 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111473
No description provided.