Home Marmoset

Gradient layer doesn't work

Offline / Send Message
Pinned
Hello! 

I have a problem with gradient from procedural layers. It doesn't work. When I am creating this layer I have an ERROR (Error: CPR ERROR: 000|#include <metal_stdlib> ).

Marmoset Toolbag 4 v.4.02 (4020), macOS Big Sur 11.2.3

Message from console when I am creating procedural gradient:

CPR ERROR: Compilation failed: 

program_source:1176:12: error: call to 'clamp' is ambiguous
                result = clamp(coord.y, 0, 1)*2;
           ^~~~~
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_common:184:18: note: candidate function
METAL_FUNC float clamp(float x, float minval, float maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:2441:16: note: candidate function
METAL_FUNC int clamp(int x, int minval, int maxval)
               ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_common:132:17: note: candidate function
METAL_FUNC half clamp(half x, half minval, half maxval)
                ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:25:17: note: candidate function
METAL_FUNC char clamp(char x, char minval, char maxval)
                ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:629:18: note: candidate function
METAL_FUNC uchar clamp(uchar x, uchar minval, uchar maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:1233:18: note: candidate function
METAL_FUNC short clamp(short x, short minval, short maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:1837:19: note: candidate function
METAL_FUNC ushort clamp(ushort x, ushort minval, ushort maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:3045:17: note: candidate function
METAL_FUNC uint clamp(uint x, uint minval, uint maxval)
                ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:3650:17: note: candidate function
METAL_FUNC long clamp(long x, long minval, long maxval)
                ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:4266:18: note: candidate function
METAL_FUNC ulong clamp(ulong x, ulong minval, ulong maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_common:140:18: note: candidate function
METAL_FUNC half2 clamp(half2 x, half2 minval, half2 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_common:148:18: note: candidate function
METAL_FUNC half3 clamp(half3 x, half3 minval, half3 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_common:156:18: note: candidate function
METAL_FUNC half4 clamp(half4 x, half4 minval, half4 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_common:192:19: note: candidate function
METAL_FUNC float2 clamp(float2 x, float2 minval, float2 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_common:200:19: note: candidate function
METAL_FUNC float3 clamp(float3 x, float3 minval, float3 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_common:208:19: note: candidate function
METAL_FUNC float4 clamp(float4 x, float4 minval, float4 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:125:18: note: candidate function
METAL_FUNC char2 clamp(char2 x, char2 minval, char2 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:225:18: note: candidate function
METAL_FUNC char3 clamp(char3 x, char3 minval, char3 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:325:18: note: candidate function
METAL_FUNC char4 clamp(char4 x, char4 minval, char4 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:729:19: note: candidate function
METAL_FUNC uchar2 clamp(uchar2 x, uchar2 minval, uchar2 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:829:19: note: candidate function
METAL_FUNC uchar3 clamp(uchar3 x, uchar3 minval, uchar3 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:929:19: note: candidate function
METAL_FUNC uchar4 clamp(uchar4 x, uchar4 minval, uchar4 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:1333:19: note: candidate function
METAL_FUNC short2 clamp(short2 x, short2 minval, short2 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:1433:19: note: candidate function
METAL_FUNC short3 clamp(short3 x, short3 minval, short3 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:1533:19: note: candidate function
METAL_FUNC short4 clamp(short4 x, short4 minval, short4 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:1937:20: note: candidate function
METAL_FUNC ushort2 clamp(ushort2 x, ushort2 minval, ushort2 maxval)
                   ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:2037:20: note: candidate function
METAL_FUNC ushort3 clamp(ushort3 x, ushort3 minval, ushort3 maxval)
                   ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:2137:20: note: candidate function
METAL_FUNC ushort4 clamp(ushort4 x, ushort4 minval, ushort4 maxval)
                   ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:2541:17: note: candidate function
METAL_FUNC int2 clamp(int2 x, int2 minval, int2 maxval)
                ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:2641:17: note: candidate function
METAL_FUNC int3 clamp(int3 x, int3 minval, int3 maxval)
                ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:2741:17: note: candidate function
METAL_FUNC int4 clamp(int4 x, int4 minval, int4 maxval)
                ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:3145:18: note: candidate function
METAL_FUNC uint2 clamp(uint2 x, uint2 minval, uint2 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:3245:18: note: candidate function
METAL_FUNC uint3 clamp(uint3 x, uint3 minval, uint3 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:3345:18: note: candidate function
METAL_FUNC uint4 clamp(uint4 x, uint4 minval, uint4 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:3752:18: note: candidate function
METAL_FUNC long2 clamp(long2 x, long2 minval, long2 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:3854:18: note: candidate function
METAL_FUNC long3 clamp(long3 x, long3 minval, long3 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:3956:18: note: candidate function
METAL_FUNC long4 clamp(long4 x, long4 minval, long4 maxval)
                 ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:4368:19: note: candidate function
METAL_FUNC ulong2 clamp(ulong2 x, ulong2 minval, ulong2 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:4470:19: note: candidate function
METAL_FUNC ulong3 clamp(ulong3 x, ulong3 minval, ulong3 maxval)
                  ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang/31001.161/include/metal/metal_integer:4572:19: note: candidate function
METAL_FUNC ulong4 clamp(ulong4 x, ulong4 minval, ulong4 maxval)
                  ^
 (onCreate, line 104)
CPR ERROR: 000|#include <metal_stdlib>
001|#pragma clang diagnostic ignored "-Wmissing-prototypes"
002|#pragma clang diagnostic ignored "-Wunused-variable"
003|#pragma clang diagnostic ignored "-Wparentheses"
004|using namespace metal;
005|#define CPR_OSX
006|#define CPR_METAL
007|#define HINT_UNROLL
008|#define HINT_UNROLL_COUNT(n)
009|#define HINT_FASTOPT
010|#define HINT_LOOP
011|#define HINT_BRANCH
012|#define HINT_FLATTEN
013|#define HINT_EARLYDEPTHSTENCIL

...

Replies

Sign In or Register to comment.