【发布时间】:2020-02-16 17:06:19
【问题描述】:
我尝试在 metal 和我的 swift 项目之间共享我在头文件中定义的枚举:
#ifndef SharedIndizes_h
#define SharedIndizes_h
#import <Foundation/Foundation.h>
#endif /* SharedIndizes_h */
typedef NS_ENUM(NSInteger, VertexAttribute)
{
VertexAttributePosition = 0,
VertexAttributeNormal = 1,
};
#include <metal_stdlib>
#import "ExchangeTypes/SharedIndizes.h"
using namespace metal;
struct VertexIn {
float3 position [[ attribute(VertexAttributePosition) ]];
float3 normal [[ attribute(VertexAttributeNormal) ]];
};
vertexDescriptor.attributes[VertexAttribute.position.rawValue]
vertexDescriptor.attributes[VertexAttribute.normal.rawValue]
但我得到的只是一些意想不到的错误:
不支持的架构
未知类型名称'_int64_t'
未知类型名称'_int32_t'
...
从我的金属文件中删除 #import "ExchangeTypes/SharedIndizes.h" 也会删除错误。
【问题讨论】: