55 lines
1.0 KiB
Objective-C
55 lines
1.0 KiB
Objective-C
//
|
|
// ShaderTypes.h
|
|
// CxLLM-SPA-RNDR
|
|
//
|
|
// Created by Stephen Carter on 4/22/26.
|
|
//
|
|
|
|
//
|
|
// Header containing types and enum constants shared between Metal shaders and Swift/ObjC source
|
|
//
|
|
#ifndef ShaderTypes_h
|
|
#define ShaderTypes_h
|
|
|
|
#ifdef __METAL_VERSION__
|
|
#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
|
|
typedef metal::int32_t EnumBackingType;
|
|
#else
|
|
#import <Foundation/Foundation.h>
|
|
typedef NSInteger EnumBackingType;
|
|
#endif
|
|
|
|
#include <simd/simd.h>
|
|
|
|
typedef NS_ENUM(EnumBackingType, BufferIndex)
|
|
{
|
|
BufferIndexMeshPositions = 0,
|
|
BufferIndexMeshGenerics = 1,
|
|
BufferIndexUniforms = 2,
|
|
BufferIndexViewProjection = 3,
|
|
};
|
|
|
|
typedef NS_ENUM(EnumBackingType, VertexAttribute)
|
|
{
|
|
VertexAttributePosition = 0,
|
|
VertexAttributeTexcoord = 1,
|
|
};
|
|
|
|
typedef NS_ENUM(EnumBackingType, TextureIndex)
|
|
{
|
|
TextureIndexColor = 0,
|
|
};
|
|
|
|
typedef struct
|
|
{
|
|
matrix_float4x4 viewProjectionMatrix[2];
|
|
} ViewProjectionArray;
|
|
|
|
typedef struct
|
|
{
|
|
matrix_float4x4 modelMatrix;
|
|
} Uniforms;
|
|
|
|
#endif /* ShaderTypes_h */
|
|
|