forked from H-uru/Plasma
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55ff113
commit 512e938
Showing
15 changed files
with
85 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#include <simd/simd.h> | ||
|
||
#ifndef __METAL_VERSION__ | ||
#include <type_traits> | ||
|
||
typedef _Float16 half; | ||
typedef __attribute__((__ext_vector_type__(2))) half half2; | ||
typedef __attribute__((__ext_vector_type__(3))) half half3; | ||
|
@@ -120,10 +122,16 @@ enum plMetalLayerPassType: uint8_t | |
struct plMetalFragmentShaderArgumentBuffer { | ||
__fp16 alphaThreshold; | ||
}; | ||
#ifndef __METAL_VERSION__ | ||
static_assert(std::is_trivial_v<plMetalFragmentShaderArgumentBuffer>, "plMetalFragmentShaderArgumentBuffer must be a trivial type!"); | ||
#endif | ||
|
||
struct plMetalShadowCastFragmentShaderArgumentBuffer { | ||
bool pointLightCast; | ||
}; | ||
#ifndef __METAL_VERSION__ | ||
static_assert(std::is_trivial_v<plMetalShadowCastFragmentShaderArgumentBuffer>, "plMetalShadowCastFragmentShaderArgumentBuffer must be a trivial type!"); | ||
#endif | ||
|
||
enum plMetalFragmentShaderTextures { | ||
FragmentShaderArgumentAttributeTextures = 0, | ||
|
@@ -143,12 +151,18 @@ struct plMetalShaderLightSource { | |
__fp16 quadAtten; | ||
__fp16 scale; | ||
}; | ||
#ifndef __METAL_VERSION__ | ||
static_assert(std::is_trivial_v<plMetalShaderLightSource>, "plMetalShaderLightSource must be a trivial type!"); | ||
#endif | ||
|
||
typedef struct | ||
{ | ||
uint32_t UVWSrc; | ||
matrix_float4x4 transform; | ||
} UVOutDescriptor; | ||
#ifndef __METAL_VERSION__ | ||
static_assert(std::is_trivial_v<UVOutDescriptor>, "UVOutDescriptor must be a trivial type!"); | ||
#endif | ||
|
||
typedef struct | ||
{ | ||
|
@@ -180,13 +194,19 @@ typedef struct | |
half4 calcFog(float4 camPosition) constant; | ||
#endif | ||
} VertexUniforms; | ||
#ifndef __METAL_VERSION__ | ||
static_assert(std::is_trivial_v<VertexUniforms>, "VertexUniforms must be a trivial type!"); | ||
#endif | ||
|
||
#define kMetalMaxLightCount 32 | ||
|
||
typedef struct { | ||
uint8_t count; | ||
plMetalShaderLightSource lampSources[kMetalMaxLightCount]; | ||
} plMetalLights; | ||
#ifndef __METAL_VERSION__ | ||
static_assert(std::is_trivial_v<plMetalLights>, "plMetalLights must be a trivial type!"); | ||
#endif | ||
|
||
typedef struct { | ||
simd::float3 lightPosition; | ||
|
@@ -195,6 +215,9 @@ typedef struct { | |
float power; | ||
half opacity; | ||
} plShadowState; | ||
#ifndef __METAL_VERSION__ | ||
static_assert(std::is_trivial_v<plShadowState>, "plShadowState must be a trivial type!"); | ||
#endif | ||
|
||
#endif /* ShaderTypes_h */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.