Fix #111504: Regression: Mesh draw corruption in sculpt mode #111521
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#111521
Loading…
Reference in New Issue
No description provided.
Delete Branch "Sergey/blender:fix_111504"
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?
The commit
f10965dcb8
introduced a regression in the way how the VBOsare filled by assuming the requested VBO attribute type has the same
alignment as the CPU and is the same on different platforms.
Unfortunately, this turned out to not be the case.
Switch the mask attribute to be float on the GPU, which has a downside
of increased bandwidth to be transferred, but a benefit of less compute
power needed to update the VBO.
The fix is suggested by Clement.
The casts for the other PBVH types need to be updated too
@ -513,3 +513,3 @@
float *mask = CCG_elem_mask(&args.ccg_key, elems[i]);
*static_cast<uchar *>(GPU_vertbuf_raw_step(&access)) = uchar(*mask * 255.0f);
*static_cast<uchar *>(GPU_vertbuf_raw_step(&access)) = *mask;
static_cast<float *>
now.Could even use indices or raw pointer increment now though, to avoid the overhead of
GPU_vertbuf_raw_step
, (which I measured to be significant actually!). That could be done later too though.@ -815,3 +815,3 @@
float mask = BM_ELEM_CD_GET_FLOAT(l->v, cd_mask);
*static_cast<uchar *>(GPU_vertbuf_raw_step(&access)) = uchar(mask * 255.0f);
*static_cast<uchar *>(GPU_vertbuf_raw_step(&access)) = mask;
static_cast<float *>
@HooglyBoogly That's a good catch!
I agree we can use indices instead of
access
, but it feels like I'd prefer a smaller change first.Hmm, can they really be removed? I thought they'd have to be changed to float. On my phone at the moment so I might be missing something.
@HooglyBoogly Something went wrong with my previous update. I guess I forgot to save before recompiling or something.
But you're right -- the cast is needed, but to a proper type now.