Cycles: Fix Metal API validation error (use uint instead of ushort) #105763

Merged
Michael Jones (Apple) merged 3 commits from Michael-Jones/blender:FixMetalValidationError into blender-v3.5-release 2023-03-14 22:06:05 +01:00

This PR fixes an error that is given when Metal API validation is enabled. The compute grid can exceed 65536 threads so ushort is not sufficient for metal_grid_id [[threadgroup_position_in_grid]].

This PR also fixes OS version warnings (Cycles Metal: Unguarded access to newer macOS features #105630)

This PR fixes an error that is given when Metal API validation is enabled. The compute grid can exceed 65536 threads so `ushort` is not sufficient for `metal_grid_id [[threadgroup_position_in_grid]]`. This PR also fixes OS version warnings ([Cycles Metal: Unguarded access to newer macOS features #105630](https://projects.blender.org/blender/blender/issues/105630))
Michael Jones (Apple) added 1 commit 2023-03-14 14:05:40 +01:00
1bd30a8b7b Cycles: Fix Metal API validation error (use uint instead of ushort)
This PR fixes an error that is given when Metal API validation is enabled. The compute grid can exceed 65536 threads so `ushort` is not sufficient for `metal_grid_id [[threadgroup_position_in_grid]]`.

This PR also fixes OS version warnings ([Cycles Metal: Unguarded access to newer macOS features #105630](#105630))
Michael Jones (Apple) requested review from Brecht Van Lommel 2023-03-14 14:05:52 +01:00
Brecht Van Lommel requested changes 2023-03-14 15:02:11 +01:00
@ -568,2 +568,4 @@
if (MetalDevice *instance = get_device_by_ID(device_id, lock)) {
if (mtlLibrary) {
if (error && [error localizedDescription]) {
print("MSL compilation messages:\n%s\n", [[error localizedDescription] UTF8String]);

Is this debug code accidentally left in?

Not sure how this even works since it's print instead of printf.

Is this debug code accidentally left in? Not sure how this even works since it's `print` instead of `printf`.
Michael-Jones marked this conversation as resolved
Michael Jones (Apple) added 1 commit 2023-03-14 15:10:13 +01:00
Author
Member

Weird - print does actually compile! The error string might contain useful information like warnings when the compilation succeeds.

Weird - `print` does actually compile! The error string might contain useful information like warnings when the compilation succeeds.

Can you use VLOG_WARNING instead of printf? In general we should not use printf even though there are a few places that do currently.

Can you use `VLOG_WARNING` instead of `printf`? In general we should not use `printf` even though there are a few places that do currently.
Brecht Van Lommel requested changes 2023-03-14 16:34:15 +01:00
Brecht Van Lommel left a comment
Owner

Request changes.

Request changes.
Michael Jones (Apple) added 1 commit 2023-03-14 17:27:23 +01:00
Michael Jones (Apple) requested review from Brecht Van Lommel 2023-03-14 17:27:42 +01:00
Brecht Van Lommel approved these changes 2023-03-14 17:40:48 +01:00
Michael Jones (Apple) merged commit 089e8a1887 into blender-v3.5-release 2023-03-14 22:06:05 +01:00
Michael Jones (Apple) deleted branch FixMetalValidationError 2023-03-14 22:06:06 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
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#105763
No description provided.