float4 position [[position]];
は次のスニペットで何をしますか?メタル言語の "位置"の前後にある二重角括弧は何を意味しますか?
#include <metal_stdlib>
using namespace metal;
struct Vertex
{
float4 position [[position]];
float4 color;
};
vertex Vertex vertex_main(device Vertex *vertices [[buffer(0)]], uint vid [[vertex_id]])
{
return vertices[vid];
}
私は、特に機能定義での部分的な使用と同様の使用法で混乱しています。
私はあなたに答えがありませんが、Objective-Cではなく金属シェーダーの構文を調べるべきだと思います。 –
これはObjective-CではなくC++構文です。 MSLはC++に基づいています。 – Marius