WIP: Vulkan: Prototype Rendergraph #118963

Closed
Jeroen Bakker wants to merge 138 commits from Jeroen-Bakker:vulkan/render-graph into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

This is a render graph implementation for optimizing GPU tasks based on resource usage
and task similarity.

Current State: Early Development
Currently has some black box test cases and GPU_storage_buffer_clear/read_back is in the making.
When ready this rework will be split in several smaller patches.
I expect this to land after 1 month of active development and 1 month of testing and platform validation.

classDiagram
    class VKNode {
        set_data(node, data)
        free_data(data)
        build_resource_dependencies
        build_commands
    }

    class VKResources
    class VKResourceDependencies
    class VKCommandBufferInterface

References

  • #118330 - Vulkan Rendergraph design to solve synchronization issues.

TODO:

  • Use single .hh file per node.
  • Add Super class for node.
  • Split render graph and resources. render graph will become a context owned instance.
  • VKTexture/Buffer will contain a render graph resource handle.
  • Move some generics to a GPU super class.
  • Missing render graph nodes
    • VKIndirectDispatchNode
    • VkCopyBufferToImageNode
    • VkCopyImageToBufferNode
    • VkCopyImageNode
    • VkBlitNode
    • VkDrawNode
    • VkDrawInstancedNode
    • VkDrawIndirectNode
    • VkDrawInstancedIndirectNode
  • Image resources are not automatically tracked.
  • Add support for push constants
  • Use a code generator for debugging and command wrappers
  • Add header documentation about scope, responsibility usage.
  • Adding Debug groups Perhaps per pipeline like metal does.
  • What to document
    • Resource life cycle management.
classDiagram
    class VKRenderGraph
    class VKRenderGraphResources
    class VKRenderGraphNodes
    class VKRenderGraphCommandBuilder
    class VKRenderGraphCommandBuffer
    class VKRenderGraphScheduler
    class VKPipelines {
        get_or_create_compute_pipeline(): VkPipeline
    }

    VKRenderGraph *--> VKRenderGraphResources: resources
    VKRenderGraph *--> VKRenderGraphNodes: nodes
    VKRenderGraph *--> VKRenderGraphCommandBuilder: command_builder
    VKRenderGraph *--> VKRenderGraphCommandBuffer: command_buffer
    VKRenderGraph *--> VKRenderGraphScheduler: scheduler
    VKDevice *--> VKRenderGraph: render_graph
    VKDevice *--> VKPipelines: pipelines

Commit Split

  • Rendergraph base classes + test cases
  • rest?

Cleanups

Some areas that can be committed to main as they are clean ups and might break other patches in development. Also makes reviewing the essential parts of this PR easier.

  • vk_to_string
  • MoltenVK - is mentioned as a cleanup as we used to support it, but was disabled due to lacking support from MoltenVK.
  • introduce AddToDescriptorSetData
  • VKDescriptorSetLayouts
This is a render graph implementation for optimizing GPU tasks based on resource usage and task similarity. **Current State**: *Early Development* Currently has some black box test cases and GPU_storage_buffer_clear/read_back is in the making. When ready this rework will be split in several smaller patches. I expect this to land after 1 month of active development and 1 month of testing and platform validation. ```mermaid classDiagram class VKNode { set_data(node, data) free_data(data) build_resource_dependencies build_commands } class VKResources class VKResourceDependencies class VKCommandBufferInterface ``` ## References - #118330 - Vulkan Rendergraph design to solve synchronization issues. **TODO:** - [x] Use single .hh file per node. - [ ] Add Super class for node. - [x] Split render graph and resources. render graph will become a context owned instance. - [ ] VKTexture/Buffer will contain a render graph resource handle. - [ ] Move some generics to a GPU super class. - [ ] Missing render graph nodes - [ ] `VKIndirectDispatchNode` - [x] `VkCopyBufferToImageNode` - [x] `VkCopyImageToBufferNode` - [x] `VkCopyImageNode` - [x] `VkBlitNode` - [ ] `VkDrawNode` - [ ] `VkDrawInstancedNode` - [ ] `VkDrawIndirectNode` - [ ] `VkDrawInstancedIndirectNode` - [x] Image resources are not automatically tracked. - [x] Add support for push constants - [x] Use a code generator for debugging and command wrappers - [ ] Add header documentation about scope, responsibility usage. - [ ] Adding Debug groups Perhaps per pipeline like metal does. - [ ] What to document - [ ] Resource life cycle management. ```mermaid classDiagram class VKRenderGraph class VKRenderGraphResources class VKRenderGraphNodes class VKRenderGraphCommandBuilder class VKRenderGraphCommandBuffer class VKRenderGraphScheduler class VKPipelines { get_or_create_compute_pipeline(): VkPipeline } VKRenderGraph *--> VKRenderGraphResources: resources VKRenderGraph *--> VKRenderGraphNodes: nodes VKRenderGraph *--> VKRenderGraphCommandBuilder: command_builder VKRenderGraph *--> VKRenderGraphCommandBuffer: command_buffer VKRenderGraph *--> VKRenderGraphScheduler: scheduler VKDevice *--> VKRenderGraph: render_graph VKDevice *--> VKPipelines: pipelines ``` **Commit Split** - [ ] Rendergraph base classes + test cases - [ ] rest? **Cleanups** Some areas that can be committed to main as they are clean ups and might break other patches in development. Also makes reviewing the essential parts of this PR easier. - [x] vk_to_string - [ ] MoltenVK - is mentioned as a cleanup as we used to support it, but was disabled due to lacking support from MoltenVK. - [ ] introduce `AddToDescriptorSetData` - [ ] `VKDescriptorSetLayouts`
Jeroen Bakker added this to the 4.3 milestone 2024-03-01 14:05:40 +01:00
Jeroen Bakker added the
Interest
Vulkan
label 2024-03-01 14:05:40 +01:00
Jeroen Bakker self-assigned this 2024-03-01 14:05:41 +01:00
Jeroen Bakker added 5 commits 2024-03-01 14:05:49 +01:00
Jeroen Bakker added this to the EEVEE & Viewport project 2024-03-01 14:05:52 +01:00
Jeroen Bakker added 1 commit 2024-03-01 14:15:29 +01:00
Jeroen Bakker added 1 commit 2024-03-01 14:40:02 +01:00
Jeroen Bakker added 1 commit 2024-03-01 14:53:10 +01:00
Jeroen Bakker added 1 commit 2024-03-04 09:15:20 +01:00
Jeroen Bakker added 1 commit 2024-03-04 11:36:57 +01:00
Jeroen Bakker added a new dependency 2024-03-04 12:33:45 +01:00
Jeroen Bakker added 13 commits 2024-03-04 12:38:59 +01:00
1223f44040 Vulkan: Developers MoltenVK Support
MoltenVK original intent was to let developers work on a mac system developing
for the vulkan eco-system. MoltenVK doesn't support all the features that we
require and would require additional workarounds to be actually supported.

It is not expected that we will release Blender with MoltenVK for this reason.
But it still has value for shader developers to validate shaders on metal and
vulkan in a single action.
Jeroen Bakker added 1 commit 2024-03-04 15:47:37 +01:00
Jeroen Bakker added 1 commit 2024-03-04 15:51:50 +01:00
Jeroen Bakker added 1 commit 2024-03-04 20:27:49 +01:00
Jeroen Bakker added 6 commits 2024-03-05 17:08:12 +01:00
Jeroen Bakker added 1 commit 2024-03-05 22:29:43 +01:00
Jeroen Bakker added 1 commit 2024-03-06 10:56:20 +01:00
Jeroen Bakker added 1 commit 2024-03-06 13:49:48 +01:00
Jeroen Bakker added 1 commit 2024-03-06 16:15:27 +01:00
Jeroen Bakker added 3 commits 2024-03-06 18:51:36 +01:00
Jeroen Bakker added 1 commit 2024-03-06 23:24:37 +01:00
Jeroen Bakker added 1 commit 2024-03-07 11:16:16 +01:00
Jeroen Bakker added 1 commit 2024-03-07 21:23:17 +01:00
Jeroen Bakker added 1 commit 2024-03-07 22:33:49 +01:00
Jeroen Bakker added 1 commit 2024-03-08 17:45:11 +01:00
Jeroen Bakker added 1 commit 2024-03-14 10:37:46 +01:00
Jeroen Bakker added 1 commit 2024-03-14 11:49:52 +01:00
Jeroen Bakker added 3 commits 2024-03-14 16:14:26 +01:00
Jeroen Bakker added 5 commits 2024-03-19 16:10:37 +01:00
Jeroen Bakker added 7 commits 2024-03-22 14:49:29 +01:00
Jeroen Bakker added 1 commit 2024-03-22 15:17:34 +01:00
Jeroen Bakker added 2 commits 2024-03-25 15:20:45 +01:00
Jeroen Bakker added a new dependency 2024-03-25 15:43:55 +01:00
Jeroen Bakker added 1 commit 2024-03-26 12:30:09 +01:00
Jeroen Bakker added 1 commit 2024-03-26 15:03:08 +01:00
Jeroen Bakker added 3 commits 2024-03-28 15:42:20 +01:00
Jeroen Bakker added 1 commit 2024-03-29 15:04:07 +01:00
Jeroen Bakker changed title from WIP: Vulkan: Basic Rendergraph to WIP: Vulkan: Prototype Rendergraph 2024-04-04 08:48:11 +02:00
Jeroen Bakker added 7 commits 2024-04-04 11:32:46 +02:00
Jeroen Bakker added 1 commit 2024-04-04 11:40:30 +02:00
Jeroen Bakker added 1 commit 2024-04-04 13:59:45 +02:00
Jeroen Bakker added 2 commits 2024-04-04 16:01:11 +02:00
Jeroen Bakker added 4 commits 2024-04-05 14:59:01 +02:00
Jeroen Bakker added 3 commits 2024-04-05 15:53:27 +02:00
Jeroen Bakker added 1 commit 2024-04-05 15:56:00 +02:00
Jeroen Bakker added 2 commits 2024-04-08 10:55:26 +02:00
Jeroen Bakker added 1 commit 2024-04-08 12:41:04 +02:00
Jeroen Bakker added 4 commits 2024-04-08 14:47:28 +02:00
Jeroen Bakker added 1 commit 2024-04-08 14:49:45 +02:00
Jeroen Bakker added 3 commits 2024-04-09 10:07:31 +02:00
Jeroen Bakker added 5 commits 2024-04-09 12:55:23 +02:00
Jeroen Bakker added 8 commits 2024-04-12 10:23:06 +02:00
Jeroen Bakker added 25 commits 2024-04-18 10:41:50 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
4a91b165a6
make format
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
5556f18185
Remove compilation warning in release builds.
Jeroen Bakker closed this pull request 2024-04-23 15:30:52 +02:00

Pull request closed

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
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: blender/blender#118963
No description provided.