Cleanup: Consolidate draw attribute extraction #114340

Merged
Hans Goudey merged 12 commits from HooglyBoogly/blender:cleanup-color-extract into main 2023-11-07 10:05:20 +01:00
Member

Use the same attribute conversion class for PBVH and regular
mesh attribute extraction. This makes the GPU formats we use
for each attribute type more explicit and centralizes the conversions
from the attribute types to the GPU types. It's also a bit more aligned
to how we could use implicit sharing for GPU vertex buffer data.

Unfortunately it isn't possible to use this same code for curves
and point clouds because they use textures for their evaluated data,
and 3-wide vectors (e.g. float3) aren't supported on GPUs with our
current texture abstraction. For generic attributes, the long term
approach will probably be to use an SSBO instead.

Use the same attribute conversion class for PBVH and regular mesh attribute extraction. This makes the GPU formats we use for each attribute type more explicit and centralizes the conversions from the attribute types to the GPU types. It's also a bit more aligned to how we could use implicit sharing for GPU vertex buffer data. Unfortunately it isn't possible to use this same code for curves and point clouds because they use textures for their evaluated data, and 3-wide vectors (e.g. `float3`) aren't supported on GPUs with our current texture abstraction. For generic attributes, the long term approach will probably be to use an SSBO instead.
Hans Goudey added 1 commit 2023-10-31 20:16:13 +01:00
Hans Goudey added the
Interest
EEVEE & Viewport
label 2023-10-31 20:16:24 +01:00
Hans Goudey added 2 commits 2023-10-31 23:26:34 +01:00
Hans Goudey added 1 commit 2023-11-01 08:30:21 +01:00
Hans Goudey added 1 commit 2023-11-01 09:36:15 +01:00
Hans Goudey added 2 commits 2023-11-01 15:38:00 +01:00
Hans Goudey added 1 commit 2023-11-01 16:00:02 +01:00
Hans Goudey added 1 commit 2023-11-01 17:25:04 +01:00
Hans Goudey requested review from Clément Foucault 2023-11-01 17:30:04 +01:00
Hans Goudey changed title from WIP: Cleanup: Consolidate draw attribute extraction to Cleanup: Consolidate draw attribute extraction 2023-11-01 17:30:11 +01:00
Hans Goudey added 1 commit 2023-11-01 17:31:23 +01:00
Clément Foucault approved these changes 2023-11-03 11:25:25 +01:00
@ -0,0 +33,4 @@
};
template<> struct AttributeConverter<bool> {
using VBOT = VecBase<int, COMPONENT_LEN_SCALAR>;

Maybe it's just me, but VBOT is a bit ambiguous. I would prefer VBO_T.

Maybe it's just me, but `VBOT` is a bit ambiguous. I would prefer `VBO_T`.
@ -1121,3 +989,1 @@
Converter::gpu_component_len,
Converter::gpu_fetch_mode);
});
format = draw::init_format_for_attribute(eCustomDataType(type), "data");

You think it's good to have it returned? I guess this is optimized in most cases.

You think it's good to have it returned? I guess this is optimized in most cases.
Hans Goudey added 2 commits 2023-11-07 10:00:57 +01:00
Hans Goudey merged commit ae1b4a6a28 into main 2023-11-07 10:05:20 +01:00
Hans Goudey deleted branch cleanup-color-extract 2023-11-07 10:05:22 +01:00
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 project
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.

Dependencies

No dependencies set.

Reference: blender/blender#114340
No description provided.