Metal backend shows everything in pink #103635
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#103635
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Opening any demo file shows all "pink" shaders / textures.
Files I did try is the "wanderer.blend" and "tree_creature.blend".
Deleting the shader folder generated by the Metal backend does not fix things.
Switching the backend to OpenGL resolves the issue.
Operating system: Mac OS Ventura 13.1
Graphics card: M1 Max
Broken: 3.5 alpha build
03abc38624
and build1beaec46b8
Worked:
c8741a3c03
default cube with a basic principled shader seems fine.
also quite interesting, here is mr elephant
It looks like everything that has an image texture does not work.
Linking does work to the image texture but only if I drag it from the Principled BSDF to the image texture and not the other way around (which always worked till now).
And suddenly the node connecting works "both ways" something is funky...
Ok seems a but and not sure if it needs another ticket:
Start Blender = node connection broken
Connect if from right to left works.
Disconnect
Connect fron left to right works now too.
Restart blender or switch to the next object and make a new material and it is broken again.
Added subscriber: @Steve-Hanff
Added subscriber: @blenderrocket
I can confirm, I get the same results.
System Information
Operating system: macOS-13.1-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 Max 1.2
Blender Version
Broken: version: 3.5.0 Alpha, branch: master, commit date: 2023-01-04 23:36, hash:
a7cc6e015c
Here are the errors it gives in the console:
/* return 2 / (1 + sqrt(1 + a2 * (1 - NXNX) / (NXNX) ) ); /* Reference function */
^
/* bsdf = D * G / (4.0 * NL * NV); /* Reference function */
^
color.rgb = MAT3(vec3(1.164), 0.0, -0.392, 2.017, 1.596, -0.813, 0.0) * ycca.xyz;
^~~~
^
^
^
^
^
color.rgb = MAT3(vec3(1.164), 0.0, -0.213, 2.115, 1.793, -0.534, 0.0) * ycca.xyz;
^~~~
^
^
^
^
^
color.rgb = MAT3(vec3(1.0), 0.0, -0.34414, 1.772, 1.402, -0.71414, 0.0) * ycca.xyz;
^~~~
^
^
^
^
^
color.rgb = MAT3(vec3(1.0), 0.0, -0.21482, 2.12798, 1.28033, -0.38059, 0.0) * yuva.xyz;
^~~~
^
^
^
^
^
float gloss = -2 + 2 / (r * r);
^
vec3 avg_dir = vec3(0.0);
^
float avg_apperture = 0.0;
^
vec2 uv = get_uvs_from_view(vP);
^
float A_a = 1.0;
^
float A_d = D;
^
vec3 vV = viewCameraVec(vP);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t1 eval_##t1##1 = closure##t1##eval_init(in##t1##1, cl_common, out##t1##_1);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t1 eval_##t1##1 = closure##t1##eval_init(in##t1##1, cl_common, out##t1##_1);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t1 eval_##t1##1 = closure##t1##eval_init(in##t1##1, cl_common, out##t1##_1);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t1 eval_##t1##1 = closure##t1##eval_init(in##t1##1, cl_common, out##t1##_1);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, t2, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
/* return 2 / (1 + sqrt(1 + a2 * (1 - NXNX) / (NXNX) ) ); /* Reference function */
^
/* bsdf = D * G / (4.0 * NL * NV); /* Reference function */
^
color.rgb = MAT3(vec3(1.164), 0.0, -0.392, 2.017, 1.596, -0.813, 0.0) * ycca.xyz;
^~~~
^
^
^
^
^
color.rgb = MAT3(vec3(1.164), 0.0, -0.213, 2.115, 1.793, -0.534, 0.0) * ycca.xyz;
^~~~
^
^
^
^
^
color.rgb = MAT3(vec3(1.0), 0.0, -0.34414, 1.772, 1.402, -0.71414, 0.0) * ycca.xyz;
^~~~
^
^
^
^
^
color.rgb = MAT3(vec3(1.0), 0.0, -0.21482, 2.12798, 1.28033, -0.38059, 0.0) * yuva.xyz;
^~~~
^
^
^
^
^
float gloss = -2 + 2 / (r * r);
^
vec3 avg_dir = vec3(0.0);
^
float avg_apperture = 0.0;
^
vec2 uv = get_uvs_from_view(vP);
^
float A_a = 1.0;
^
float A_d = D;
^
vec3 vV = viewCameraVec(vP);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t1 eval_##t1##1 = closure##t1##eval_init(in##t1##1, cl_common, out##t1##_1);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t1 eval_##t1##1 = closure##t1##eval_init(in##t1##1, cl_common, out##t1##_1);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t1 eval_##t1##1 = closure##t1##eval_init(in##t1##1, cl_common, out##t1##_1);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t1 eval_##t1##1 = closure##t1##eval_init(in##t1##1, cl_common, out##t1##_1);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, Dummy, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, t2, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t3 eval_##t3##3 = closure##t3##eval_init(in##t3##3, cl_common, out##t3##_3);
^
CLOSURE_EVAL_FUNCTION_DECLARE(name, t0, t1, Dummy, Dummy)
^
ClosureEval##t2 eval_##t2##2 = closure##t2##eval_init(in##t2##2, cl_common, out##t2##_2);
^
Might be fixed with d7598c808116?
I can confirm that, same errors here in the console.
I get those as soon as I connect the image texture to the base color node.
"Left to right" node connection is fixed in build
a7cc6e015c
however, which was broken in 2 other builds mentioned above.Also if it helps it broke between build
aad8f1a41b
and03abc38624
Could it be related to one of these ?
https://developer.blender.org/rBecd45336156b7b0c172023f3915617e6841b7389
or
https://developer.blender.org/rBa6355a4542db6689b269b51b11aaaa6425471a0a
Added subscriber: @Michael-Parkin-White-Apple
Changed status from 'Needs Triage' to: 'Confirmed'
Looks like build
bc5337a05a
fixes itYes, confirmed fixed here as well.
I believe one of Jeroen's patches
d7598c8081168b45bda70bee41003d8e5b622bed
will have fixed this after re-adding mat3 constructor overloads which had been removed in a refactor. The DIFF submitted above (D16923) addresses the secondary cause of the issue by removing cases where floats and vec3's are used simultaneously in the constructor. This was a simplification for the API suggested by Clément.The other patch also contains a few secondary compilation failures which may not be hitting in all cases, but will affect situations where tone mapping is used, so while this issue may be fixed, it will still be important for the above DIFF to land as well :)
Ah ok thanks for the info.
Question: I noticed that the shaders are compiled on the CPU at the moment (can see it well with the PartyTug demo file). Will that always stay on CPU or be moved to the GPU at some point.
Other thing is it normal that CPU load is only like 50% when shaders are compiled?
Shaders are generally always compiled on the CPU (via system drivers), this is the same for both OpenGL, Metal and other APIs. However, once the Metal viewport has stabilised, shader compiler performance is something that I'm very keen on improving. As per some of the tasks outlined in:
https://developer.blender.org/T96261
, we're looking to improve this on multiple levels.As shader compilations are split into front-end and backend (Front-end compilations are source translation to some intermediate representation, which is platform agnostic and can also happen at build time for static shaders. Backend is generation of final GPU instructions which is unique per driver and GPU Hardware combination.), we aim to make as many compilations non-blocking as possible.
This means that while Front-end compilations in EEVEE are currently non-blocking when editing materials, as they happen on a separate thread, PSO compilations can incur stalls when materials are updated, so this would be good to improve. However, for export renders, the render does indeed need to wait until shaders have finished, as they are needed immediately to produce the final image.
Secondly, as Metal gives us a great deal of control over multithreading and shader compilation, I want to aim to ensure shader compilation is as efficient as it can be. At the same time, also making sure we are not performing any redundant re-compilations, and ensuring work is effectively cached between runs of Blender.
Awesome, thanks for the detailed answer.
Out of curiosity, why are they not saved in the blender file and need to be recompiled each time you reopen the project?
Added subscriber: @PratikPB2123
This issue was referenced by
0ba5954bb2
It seems like this can be fully closed now?