I am writing a multi-platform application for macOS and iOS for rendering vector graphics using Metal. In my shader, the vertex identifier is used as an offset into an array of structures (const in the program area, located in a constant address space):
constant const WrapperStruct directionVectors[] =
{
{ float2(-1, -1) },
{ float2(1, -1) },
{ float2(-1, 1) },
{ float2(1, 1) }
};
vertex Vertex vertexShader(const InstanceAttributes attr [[ stage_in ]], const ushort vid [[ vertex_id ]])
{
Vertex vert;
vert.position = float4(attr.position + (attr.size * directionVectors[vid].value), 0, 1);
vert.color = attr.color;
return vert;
}
This works well:
- iOS devices
- MacBook with dedicated GPUs.
But on a particular MacBook Pro (13-inch, 2017, High Sierra, Intel integrated graphics processor) there is a big problem: graphics are not drawn, I get only pure color in the background. No errors are logged, I also do not experience glitches.
"" - float2, . , , ( Intel?).
macOS: .
, instancing. Intel-GPU .
- ? Metal Intel? - / undefined ?
!
gfxCardStatus . , , , Intel: