added metal keyworld: "level" (#1501)
* added metal keyworld: "level" * added more metal keywords * updated test case.
This commit is contained in:
parent
78c6d2d628
commit
c8a43876c7
@ -56,8 +56,8 @@ float lod_factor(thread const float2& pos_, constant UBO& v_41)
|
||||
{
|
||||
float2 pos = pos_ * v_41.uScale.xy;
|
||||
float3 dist_to_cam = v_41.uCamPos - float3(pos.x, 0.0, pos.y);
|
||||
float level = log2((length(dist_to_cam) + 9.9999997473787516355514526367188e-05) * v_41.uDistanceMod);
|
||||
return fast::clamp(level, 0.0, v_41.uMaxTessLevel.x);
|
||||
float level0 = log2((length(dist_to_cam) + 9.9999997473787516355514526367188e-05) * v_41.uDistanceMod);
|
||||
return fast::clamp(level0, 0.0, v_41.uMaxTessLevel.x);
|
||||
}
|
||||
|
||||
static inline __attribute__((always_inline))
|
||||
|
@ -55,8 +55,8 @@ float lod_factor(thread const float2& pos_, constant UBO& v_41)
|
||||
{
|
||||
float2 pos = pos_ * v_41.uScale.xy;
|
||||
float3 dist_to_cam = v_41.uCamPos - float3(pos.x, 0.0, pos.y);
|
||||
float level = log2((length(dist_to_cam) + 9.9999997473787516355514526367188e-05) * v_41.uDistanceMod);
|
||||
return fast::clamp(level, 0.0, v_41.uMaxTessLevel.x);
|
||||
float level0 = log2((length(dist_to_cam) + 9.9999997473787516355514526367188e-05) * v_41.uDistanceMod);
|
||||
return fast::clamp(level0, 0.0, v_41.uMaxTessLevel.x);
|
||||
}
|
||||
|
||||
static inline __attribute__((always_inline))
|
||||
|
@ -38,9 +38,9 @@ static inline __attribute__((always_inline))
|
||||
float2 lod_factor(thread const float2& tess_coord, thread float4& vPatchLods)
|
||||
{
|
||||
float2 x = mix(vPatchLods.yx, vPatchLods.zw, float2(tess_coord.x));
|
||||
float level = mix(x.x, x.y, tess_coord.y);
|
||||
float floor_level = floor(level);
|
||||
float fract_level = level - floor_level;
|
||||
float level0 = mix(x.x, x.y, tess_coord.y);
|
||||
float floor_level = floor(level0);
|
||||
float fract_level = level0 - floor_level;
|
||||
return float2(floor_level, fract_level);
|
||||
}
|
||||
|
||||
|
@ -11326,6 +11326,11 @@ void CompilerMSL::replace_illegal_names()
|
||||
"fragment",
|
||||
"compute",
|
||||
"bias",
|
||||
"level",
|
||||
"gradient2d",
|
||||
"gradientcube",
|
||||
"gradient3d",
|
||||
"min_lod_clamp",
|
||||
"assert",
|
||||
"VARIABLE_TRACEPOINT",
|
||||
"STATIC_DATA_TRACEPOINT",
|
||||
|
Loading…
Reference in New Issue
Block a user