Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/metal/mtl_shader_defines.msl
| Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | |||||
| #define TEXURE_MACRO(_1, _2, _3, TEXNAME, ...) TEXNAME | #define TEXURE_MACRO(_1, _2, _3, TEXNAME, ...) TEXNAME | ||||
| #define texture(...) TEXURE_MACRO(__VA_ARGS__, texture3, texture2)(__VA_ARGS__) | #define texture(...) TEXURE_MACRO(__VA_ARGS__, texture3, texture2)(__VA_ARGS__) | ||||
| #define textureGather(...) TEXURE_MACRO(__VA_ARGS__, textureGather3, textureGather2)(__VA_ARGS__) | #define textureGather(...) TEXURE_MACRO(__VA_ARGS__, textureGather3, textureGather2)(__VA_ARGS__) | ||||
| /* Texture-write functions. */ | /* Texture-write functions. */ | ||||
| #define imageStore(_tex, _coord, _value) _texture_write_internal(_tex, _coord, _value) | #define imageStore(_tex, _coord, _value) _texture_write_internal(_tex, _coord, _value) | ||||
| /* Cubemap support always available when using Metal. */ | |||||
| #define textureLod_cubemapArray(tex, co, lod) textureLod(tex, co, lod) | |||||
| /* Singular return values from texture functions of type DEPTH are often indexed with either .r or | /* Singular return values from texture functions of type DEPTH are often indexed with either .r or | ||||
| * .x. This is a lightweight wrapper type for handling this syntax. */ | * .x. This is a lightweight wrapper type for handling this syntax. */ | ||||
| union _msl_return_float { | union _msl_return_float { | ||||
| float r; | float r; | ||||
| float x; | float x; | ||||
| inline operator float() const | inline operator float() const | ||||
| { | { | ||||
| return r; | return r; | ||||
| ▲ Show 20 Lines • Show All 979 Lines • ▼ Show 20 Lines | |||||
| mat3 MAT3(float f) | mat3 MAT3(float f) | ||||
| { | { | ||||
| return mat3(f); | return mat3(f); | ||||
| } | } | ||||
| mat3 MAT3(mat4 m) | mat3 MAT3(mat4 m) | ||||
| { | { | ||||
| return mat4_to_mat3(m); | return mat4_to_mat3(m); | ||||
| } | } | ||||
| No newline at end of file | No newline at end of file | ||||