GPU: Add Texture Usage Parameter to GPUOffscreen. #106899

Merged
Jeroen Bakker merged 5 commits from Jeroen-Bakker/blender:gpu-offscreen-texture-usage into main 2023-04-14 22:03:03 +02:00
Member

Currently the Textures used for offscreen rendering don't have
the GPU_TEXTURE_USAGE_HOST_READ flag. But some cases it is
needed. This PR adds a parameter when creating an offscreen
buffer.

Other solution could be to add this flag to all textures, but
we chose not to do this as that reduces the amount of fine-tuning
options for Metal/Vulkan backends. GPU can store textures
differently based on its actual usage.

This option isn't available in the python API as we don't expect
add-on developers to fine-tune texture usages to this extent.

For convenience GPU_TEXTURE_USAGE_ATTACHMENT is by default
always added.

Currently the Textures used for offscreen rendering don't have the `GPU_TEXTURE_USAGE_HOST_READ` flag. But some cases it is needed. This PR adds a parameter when creating an offscreen buffer. Other solution could be to add this flag to all textures, but we chose not to do this as that reduces the amount of fine-tuning options for Metal/Vulkan backends. GPU can store textures differently based on its actual usage. This option isn't available in the python API as we don't expect add-on developers to fine-tune texture usages to this extent. For convenience `GPU_TEXTURE_USAGE_ATTACHMENT` is by default always added.
Jeroen Bakker added 1 commit 2023-04-13 12:45:07 +02:00
Currently the Textures used for offscreen rendering don't have
the `GPU_TEXTURE_USAGE_HOST_READ` flag. But some cases it is
needed. This PR adds a parameter when creating an offscreen
buffer.

Other solution could be to add this flag to all textures, but
we chose not to do this as that reduces the amount of fine-tuning
options for Metal/Vulkan backends. GPU can store textures
differently based on its actual usage.

This option isn't available in the python API as we don't expect
add-on developers to fine-tune texture usages to this extent.
Jeroen Bakker requested review from Clément Foucault 2023-04-13 12:45:14 +02:00
Jeroen Bakker added the
Module
Viewport & EEVEE
label 2023-04-13 12:45:25 +02:00
Jeroen Bakker added this to the 3.6 LTS milestone 2023-04-13 12:45:28 +02:00
Jeroen Bakker added this to the Viewport & EEVEE project 2023-04-13 12:45:31 +02:00
Jeroen Bakker self-assigned this 2023-04-13 12:45:36 +02:00
Author
Member

I checked the actual usages around the areas where the offscreen buffers where created and updated them accordingly. There were some areas already that needed
the host visibility flags.

Depending on the actual platform this could have been an issue. I came across this issue during development of the Vulkan graphics pipeline. Where Vulkan mentioned incorrect usage flags.

I checked the actual usages around the areas where the offscreen buffers where created and updated them accordingly. There were some areas already that needed the host visibility flags. Depending on the actual platform this could have been an issue. I came across this issue during development of the Vulkan graphics pipeline. Where Vulkan mentioned incorrect usage flags.
Jeroen Bakker added the
Interest
Metal
Interest
Vulkan
labels 2023-04-13 12:48:36 +02:00
Jeroen Bakker added a new dependency 2023-04-13 13:46:18 +02:00
Clément Foucault requested changes 2023-04-13 14:11:48 +02:00
Clément Foucault left a comment
Member

I think the flag GPU_TEXTURE_USAGE_ATTACHMENT should be added inside GPU_offscreen_create to avoid forgetting it. Also this should be mentioned on the header documentation of the function.

I think the flag `GPU_TEXTURE_USAGE_ATTACHMENT` should be added inside `GPU_offscreen_create` to avoid forgetting it. Also this should be mentioned on the header documentation of the function.
Jeroen Bakker added 1 commit 2023-04-13 15:40:37 +02:00
Jeroen Bakker added 1 commit 2023-04-13 15:42:37 +02:00
Jeroen Bakker requested review from Clément Foucault 2023-04-13 15:43:07 +02:00
Jeroen Bakker added 1 commit 2023-04-14 16:16:57 +02:00
Jeroen Bakker added 1 commit 2023-04-14 16:23:27 +02:00
Clément Foucault approved these changes 2023-04-14 16:36:58 +02:00
Jeroen Bakker merged commit db47f82626 into main 2023-04-14 22:03:03 +02:00
Jeroen Bakker deleted branch gpu-offscreen-texture-usage 2023-04-14 22:03:04 +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
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.

Reference: blender/blender#106899
No description provided.