You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When cross-compiling to MSL via spirv-cross, the float myLod[6] member in the MaterialParameters struct is converted from a float[6] to a float4[6], but accessed without adding a required .x suffix. As a result, the Metal compiler fails due to mismatched types.
shader.metal:19:67: error: no matching conversion for functional-style cast from 'const constant float4' (vector of 4 'float' values) to 'metal::level'
out.fragColor = mySampler.sample(mySamplerSmplr, float2(0.0), level(materialParams.myLod[0]));
Normally the .x suffix is added, but there appears to be a bug when using it as an argument to textureLod.
When cross-compiling to MSL via spirv-cross, the
float myLod[6]
member in theMaterialParameters
struct is converted from afloat[6]
to afloat4[6]
, but accessed without adding a required.x
suffix. As a result, the Metal compiler fails due to mismatched types.Normally the
.x
suffix is added, but there appears to be a bug when using it as an argument totextureLod
.See the attached input.frag.txt.
Repro steps:
The intermediate SPIR-V looks correct:
spirv-cross version:
The text was updated successfully, but these errors were encountered: