Fix #108500: Resolve Metal line loop emulation for armature limits #108512

Merged
Jeroen Bakker merged 1 commits from Jason-Fielder/blender:Fix_108500 into blender-v3.6-release 2023-06-01 15:41:30 +02:00
Member

Authored by Apple: Michael Parkin-White

Authored by Apple: Michael Parkin-White
Jason Fielder added 1 commit 2023-06-01 13:01:00 +02:00
Jason Fielder requested review from Jeroen Bakker 2023-06-01 13:01:31 +02:00
Iliya Katushenock added this to the EEVEE & Viewport project 2023-06-01 14:21:55 +02:00
Iliya Katushenock added the
Interest
Animation & Rigging
label 2023-06-01 14:22:03 +02:00
Member

@Jason-Fielder Thanks for the quick fix!!! I just copied the fix into my local blender and it worked for me. One thing: In the code the final line is treated differently. With the fix it looks to me like all lines could be treated in the same way, so the loop could go over all lines... no?

@Jason-Fielder Thanks for the quick fix!!! I just copied the fix into my local blender and it worked for me. One thing: In the code the final line is treated differently. With the fix it looks to me like all lines could be treated in the same way, so the loop could go over all lines... no?
First-time contributor

@GaiaClary The purpose of the code is to emulate a LineLoop primitive type using LineList, as Metal does not support LineLoop natively.
This is achieved by using an index buffer to re-use existing vertex buffer data. The final line is different as it needs to create an additional line primitive between the last and first vertex. The other lines create a unique primitive between each two vertices.

For a LineLoop primitive, there is only one item of data specified for each "point" connecting lines, whereas a LineList has an explicit start and end for each line. So the index buffer repeats data points to specify two indices per primitive, which map to the original list of single points.

So if you have a line loop with 5 points (v0, v1, v2, v3, v4), you get 6 line segments. To represent this with a line list, you need to specify two points for each segment:

v0- > v1
v1 -> v2
v2 -> v3
v3 -> v4
v4 -> v5
and the closing line (which is handled slightly differently):
v5 -> v0.

@GaiaClary The purpose of the code is to emulate a LineLoop primitive type using LineList, as Metal does not support LineLoop natively. This is achieved by using an index buffer to re-use existing vertex buffer data. The final line is different as it needs to create an additional line primitive between the last and first vertex. The other lines create a unique primitive between each two vertices. For a LineLoop primitive, there is only one item of data specified for each "point" connecting lines, whereas a LineList has an explicit start and end for each line. So the index buffer repeats data points to specify two indices per primitive, which map to the original list of single points. So if you have a line loop with 5 points (v0, v1, v2, v3, v4), you get 6 line segments. To represent this with a line list, you need to specify two points for each segment: v0- > v1 v1 -> v2 v2 -> v3 v3 -> v4 v4 -> v5 and the closing line (which is handled slightly differently): v5 -> v0.
Jeroen Bakker approved these changes 2023-06-01 15:40:57 +02:00
Jeroen Bakker merged commit c3f7b723b2 into blender-v3.6-release 2023-06-01 15:41:30 +02:00
Jeroen Bakker added this to the 3.6 LTS milestone 2023-06-01 15:41:39 +02: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 Assignees
4 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#108512
No description provided.