separate shader uniforms structures

This commit is contained in:
2024-08-18 01:20:19 +10:00
parent f7255c473c
commit 94ed59055a
3 changed files with 31 additions and 27 deletions

View File

@ -10,10 +10,10 @@
#include <simd/simd.h>
typedef NS_ENUM(NSInteger, ShaderInputIdx) {
ShaderInputIdxVertices = 0,
ShaderInputIdxInstance = 1,
ShaderInputIdxUniforms = 2
typedef NS_ENUM(NSInteger, VertexShaderInputIdx) {
VertexShaderInputIdxVertices = 0,
VertexShaderInputIdxInstance = 1,
VertexShaderInputIdxUniforms = 2
};
typedef struct {
@ -26,11 +26,18 @@ typedef struct {
matrix_float4x4 model;
matrix_float4x4 normalModel;
vector_uchar4 color;
} ShaderInstance;
} VertexShaderInstance;
typedef struct {
matrix_float4x4 projView;
} VertexShaderUniforms;
typedef NS_ENUM(NSInteger, FragmentShaderInputIdx) {
FragmentShaderInputIdxUniforms = 0
};
typedef struct {
vector_float3 directionalLight;
} ShaderUniforms;
} FragmentShaderUniforms;
#endif//SHADERTYPES_H