Vulkan: Layer tracking during render scope #124407

Merged
Jeroen Bakker merged 11 commits from Jeroen-Bakker/blender:vulkan/layered-subresource-tracking into main 2024-07-16 16:39:41 +02:00
Member

EEVEE can bind layers of a texture that is also used as an attachment. When binding
the image layout of these specific layers can be different that the image layout of
the whole image.

This fixes the known synchronization issues inside EEVEE. wasp_bot, tree_creature and
wanderer scenes can be rendered without any synchronization issue reported by the
Vulkan validation layers.

Design task: #124214

When beginning to render the attachments are being evaluated. If there is an arrayed
texture (with multiple layers) the individual layers of that texture can be tracked
during until the rendering is ended.

When the same texture is bound to a shader it will be a different layer (otherwise
there is a feedback loop, which isn't allowed). The bound layers will typically need
a different layout the transition to the new layout is executed and recorded. When
the rendering ends, the layers are transitioned back to the layout the texture is
expected in.

It can happen that a layer is used multiple times during the same rendering. In
that case the rendering should be suspended to perform the transition. Image layout
transitions are not allowed during rendering.

There is one place where a layer needs to be transited multiple times that is when
EEVEE wants to extract the thickness from the shadow. The thickness is stored inside
the gbuffer_normal which is also used as an attachment. Eval then samples the thickness
from the gbuffer_normal as a sampler. To work around this issue we suspend the rendering
when a GPU_BARRIER_SHADER_IMAGE_ACCESS is signaled.

EEVEE can bind layers of a texture that is also used as an attachment. When binding the image layout of these specific layers can be different that the image layout of the whole image. This fixes the known synchronization issues inside EEVEE. wasp_bot, tree_creature and wanderer scenes can be rendered without any synchronization issue reported by the Vulkan validation layers. Design task: #124214 When beginning to render the attachments are being evaluated. If there is an arrayed texture (with multiple layers) the individual layers of that texture can be tracked during until the rendering is ended. When the same texture is bound to a shader it will be a different layer (otherwise there is a feedback loop, which isn't allowed). The bound layers will typically need a different layout the transition to the new layout is executed and recorded. When the rendering ends, the layers are transitioned back to the layout the texture is expected in. It can happen that a layer is used multiple times during the same rendering. In that case the rendering should be suspended to perform the transition. Image layout transitions are not allowed during rendering. There is one place where a layer needs to be transited multiple times that is when EEVEE wants to extract the thickness from the shadow. The thickness is stored inside the gbuffer_normal which is also used as an attachment. Eval then samples the thickness from the gbuffer_normal as a sampler. To work around this issue we suspend the rendering when a `GPU_BARRIER_SHADER_IMAGE_ACCESS` is signaled.
Jeroen Bakker added this to the 4.3 milestone 2024-07-09 13:35:43 +02:00
Jeroen Bakker added the
Interest
Vulkan
label 2024-07-09 13:35:43 +02:00
Jeroen Bakker self-assigned this 2024-07-09 13:35:43 +02:00
Jeroen Bakker added this to the Viewport & EEVEE project 2024-07-09 13:35:53 +02:00
Jeroen Bakker force-pushed vulkan/layered-subresource-tracking from f6c33c1a5b to 5b3b082c15 2024-07-11 10:20:45 +02:00 Compare
Jeroen Bakker force-pushed vulkan/layered-subresource-tracking from 5b3b082c15 to 62a958d5b4 2024-07-11 15:27:51 +02:00 Compare
Jeroen Bakker force-pushed vulkan/layered-subresource-tracking from 62a958d5b4 to fae3494e12 2024-07-12 08:03:34 +02:00 Compare
Jeroen Bakker force-pushed vulkan/layered-subresource-tracking from fae3494e12 to e76b827074 2024-07-16 12:40:16 +02:00 Compare
Jeroen Bakker changed title from WIP: Vulkan: Layered subresource tracking during command building to Vulkan: Layered subresource tracking during command building 2024-07-16 13:51:35 +02:00
Author
Member

@blender-bot build

@blender-bot build
Jeroen Bakker changed title from Vulkan: Layered subresource tracking during command building to Vulkan: Layer tracking during render scope 2024-07-16 16:04:00 +02:00
Jeroen Bakker force-pushed vulkan/layered-subresource-tracking from 3871e6fbde to 2e5a56e896 2024-07-16 16:09:50 +02:00 Compare
Author
Member

@blender-bot build

@blender-bot build
Jeroen Bakker merged commit ca0e1d696a into main 2024-07-16 16:39:41 +02:00
Jeroen Bakker deleted branch vulkan/layered-subresource-tracking 2024-07-16 16:39:45 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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.

Dependencies

No dependencies set.

Reference: blender/blender#124407
No description provided.