GL: Add subpass input emulation #112051
No reviewers
Labels
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 project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#112051
Loading…
Reference in New Issue
No description provided.
Delete Branch "fclem/blender:gl-subpass-emulation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds basic emulation of the subpass input feature
of vulkan and to a lower extend Raster Order Group on Metal.
This help test paths that might use this feature in the future
(like shadow rendering) on all platform and or simplify higher
level code for supporting older hardware.
This add clear description to the load/store ops and to the
new
GPUAttachementState
.The OpenGL backend will correctly mask un-writable
attachments and will bind as texture readable attachments.
Even if possible by the vulkan standard, the GPU API prohibit
the read and write to the same attachment inside the same
subpass.
In the GL backend, this is implemented using
glTextureBarrier
and
texelFetch
as it is described in the ARB_texture_barrierextension.
https://registry.khronos.org/OpenGL/extensions/ARB/ARB_texture_barrier.txt
@ -19,2 +19,4 @@
} eGPULoadOp;
typedef enum GPUAttachmentLayout {
GPU_LAYOUT_GENERAL = 0,
Different name, layout tells more about the order of data on the GPU inside the image. Perhaps GPUAttachmentUsage
WIP: GL: Add subpass input emulationto GL: Add subpass input emulation@ -22,0 +39,4 @@
*/
typedef enum eGPUStoreOp {
/**
* Do not care about the content of the attachment when the render pass starts.
when the render pass ends
@ -22,0 +64,4 @@
typedef enum GPUAttachmentState {
/** Attachment will not be written during rendering. */
GPU_ATTACHEMENT_IGNORE = 0,
/** Attachment will be written during geometry passes. This also works with blending. */
geometry passes?
@ -116,0 +238,4 @@
case Type::SHORT3:
case Type::SHORT4:
case Type::VEC3_101010I2:
/* TODO(fclem): This could add support for lower bit depth formats. */
This need to be supported for more versatility. However, this will not work with
imageLoad
because we need to know the format of the image upfront. So I'll change the workaround to usesampler
instead ofimage
.@ -56,2 +56,4 @@
void attachment_set_loadstore_op(GPUAttachmentType type, GPULoadStore /*ls*/) override;
void subpass_transition(const GPUAttachmentState depth_attachment_state,
Span<GPUAttachmentState> color_attachment_states) override{};
When run on Intel ARC/Mesa
Might be that the extension is supported on OpenGL ES, but not on OpenGL...
Perhaps disable the extension for intel GPUs
I validated that it worked using the same Mesa, but with AMD card.
@buildbot package windows
@blender-bot package windows
Package build started. Download here when ready.
Note directly related to this task, but noteworthy mention that it is possible to implement the
GPU_STOREACTION_DONT_CARE
usingARB_invalidate_subdata
in OpenGL.Reading a bit more and it seems that the current approach without framebuffer fetch is still undefined behavior and that the only option is either to modify the framebuffer or use
glTextureBarrier
(which is 4.5 core and widely implemented). That's what I'm going to implement.https://www.khronos.org/opengl/wiki/Memory_Model#Texture_barrier
I think i'll scrap the framebuffer fetch implementation if it still doesnt work on ARC. It isn't supported by the older hardware and will not help much anyway.
@blender-bot build