GPU subdivision improvements #94644

Open
opened 2022-01-04 19:28:00 +01:00 by Kévin Dietrich · 10 comments

This is a list of TODOs and ideas for improving GPU subdivision support (D12406).

TODOs

  • Investigate if read and write operations can be made more coherent.
  • Investigate if compute dispatch size can be improved, to avoid too many calls.
  • Remove some useless OpenGL initialization from OpenSubDiv
    • We use our own patch evaluation shader, however we are still forced to compile the one from OpenSubDiv. This will require to implement our own GLComputeEvaluator.
    • GLVertexBuffer also initializes the OpenGL library. We can avoid this by using our own vertex buffer wrapper.
  • Compressed data structures for reducing memory usage
    • Using compute shaders forces us to only deal with ints and floats. However, this is using more memory than necessary (e.g. for normals).
    • This requires to do manual bit packing in the shaders, we need to pay good attention to alignements and data types (int vs. uint).
  • Use multithreading for CPU tasks when applicable
    • We still process some data on the CPU (e.g. polygons to materials map, edit mode flags). Although they are based on the coarse mesh, we could use multithreading to speed things up if needed.

Ideas

  • Heuristic to disable GPU subdivision for small meshes, if they are hindering performance
  • The mesh wrapper used for on the CPU might not need all of the data to be subdivided (e.g. we do not need vertex colors for snapping), we could potentially speed up CPU subdivision by only subdividing what we need.
  • Potentially evaluate points on the GPU and copy back to the CPU side, this would require threads to have their own GL context.
  • See if OpenSubDiv data structures can be shared between the CPU and GPU code (e.g. the stencils buffers) so that we do not have to create duplicate versions when the CPU side mesh is requested.

Vulkan

This is a list of TODOs and ideas for improving GPU subdivision support ([D12406](https://archive.blender.org/developer/D12406)). **TODOs** - Investigate if read and write operations can be made more coherent. - Investigate if compute dispatch size can be improved, to avoid too many calls. - Remove some useless OpenGL initialization from OpenSubDiv - We use our own patch evaluation shader, however we are still forced to compile the one from OpenSubDiv. This will require to implement our own GLComputeEvaluator. - `GLVertexBuffer` also initializes the OpenGL library. We can avoid this by using our own vertex buffer wrapper. - Compressed data structures for reducing memory usage - Using compute shaders forces us to only deal with ints and floats. However, this is using more memory than necessary (e.g. for normals). - This requires to do manual bit packing in the shaders, we need to pay good attention to alignements and data types (int vs. uint). - Use multithreading for CPU tasks when applicable - We still process some data on the CPU (e.g. polygons to materials map, edit mode flags). Although they are based on the coarse mesh, we could use multithreading to speed things up if needed. **Ideas** - Heuristic to disable GPU subdivision for small meshes, if they are hindering performance - The mesh wrapper used for on the CPU might not need all of the data to be subdivided (e.g. we do not need vertex colors for snapping), we could potentially speed up CPU subdivision by only subdividing what we need. - Potentially evaluate points on the GPU and copy back to the CPU side, this would require threads to have their own GL context. - See if OpenSubDiv data structures can be shared between the CPU and GPU code (e.g. the stencils buffers) so that we do not have to create duplicate versions when the CPU side mesh is requested. **Vulkan** - OpenSubDiv does not yet officially support Vulkan. The Pixar team seem to already have something working internally (https://github.com/PixarAnimationStudios/OpenSubdiv/issues/1153). It is not clear when this will be released.
Author
Member

Added subscriber: @kevindietrich

Added subscriber: @kevindietrich

Added subscriber: @JacobMerrill-1

Added subscriber: @JacobMerrill-1

Added subscriber: @Garek

Added subscriber: @Garek

Added subscriber: @Confabulatori

Added subscriber: @Confabulatori
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

Added subscriber: @zanqdo

Added subscriber: @zanqdo

Added subscriber: @SamGreen

Added subscriber: @SamGreen

Added subscriber: @sozap

Added subscriber: @sozap

Added subscriber: @lrevardel

Added subscriber: @lrevardel
Member

Added subscriber: @EAW

Added subscriber: @EAW
Philipp Oeser removed the
Interest
EEVEE & Viewport
label 2023-02-09 15:13:00 +01:00
Iliya Katushenock removed the
Status
Needs Triage
label 2024-04-21 16:36:04 +02:00
Sign in to join this conversation.
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
10 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#94644
No description provided.