EEVEE-Next: Resolve compilation errors in Metal #106219
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#106219
Loading…
Reference in New Issue
No description provided.
Delete Branch "Jason-Fielder/blender:MetalEEVEENext_shaderCompilation"
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?
Shader source requires explicit conversions and shader address
space qualifers in certain places in order to compile for Metal.
We also require constructors for a number of default struct types.
Authored by Apple: Michael Parkin-White
Ref #96261
EEVEE-Next: Resolve compilation errors in Metal.to EEVEE-Next: Resolve compilation errors in MetalI'm fine with most of this. Just want to see 2 points fixed before accepting this.
@ -8,2 +8,4 @@
struct AABB {
vec3 min, max;
#ifdef GPU_METAL
Change caller to use the following syntax instead. Same for
Sphere()
@ -74,3 +71,1 @@
out vec4 top,
out vec4 near,
out vec4 far)
DEVICE_OUT(vec4, left),
We should avoid that. Change the caller to not pass device memory references (and do some copy instead, hoping the compiler optimizes it). This make the caller code uglier but it is better than having a function that can only take device memory as argument.
Yep, I can make this change for this case, I can't guarantee that it won't incur additional overhead, though most likely the device read needs to happen anyway, it's just a question of whether the read-write is more or less the same.
The slightly more awkward case here is that it is used in combination with the current
DEVICE_OUT_ARRAY
in:void frustum_culling_planes_calc(mat4 winmat, mat4 viewmat, DEVICE_OUT_ARRAY(vec4, planes, 6))
as this routine also then updates the planes stored in device memory.
I'm happy to refactor the code around this function to first pull the data, update locally and then update device memory if this is suitable, even if makes the code a little longer?
The proposed way implemented in the latest version of this PR is suitable.
@ -175,3 +175,4 @@
vec3 v001 = v000 - v_back * radius;
Box bbox = shape_box(v000, v100, v010, v001);
intersect_tile = intersect_tile && intersect(tile, bbox);
} break;
Codestyle: add break inside the code-block.
Have now addressed feedback, but given there are refactors to avoid passing device pointers directly to utility functions, and compaction of fixed size arrays into structs, the compilation needs verifying on other platforms. (This passes locally for Metal and OpenGL on macOS, though with the caveat that unsupported shaders were not tested for OpenGL, as these cannot compile on macOS anyway).
Thanks!
I tested on AMD + Linux (both Mesa & amdgpu-pro drivers) and it works.
I tested on Linux/NVIDIA and it works.