Explicit constructor for mat3 from a mat4 is not valid and cannot be overloaded. Adding explicit texture resource type flags for depth textures. This is an explicit requirement for Metal Shading language. This is a temporary compatibility, as this path is already supported in GPU_SHADER_CREATE_INFO under ImageType::DEPTH_2D, though required in shader source for MSL shaders which do not have create info. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14418
28 lines
584 B
GLSL
28 lines
584 B
GLSL
|
|
/* Texture format tokens -- Type explictness required by other Graphics APIs. */
|
|
#define depth2D sampler2D
|
|
#define depth2DArray sampler2DArray
|
|
#define depth2DMS sampler2DMS
|
|
#define depth2DMSArray sampler2DMSArray
|
|
#define depthCube samplerCube
|
|
#define depthCubeArray samplerCubeArray
|
|
#define depth2DArrayShadow sampler2DArrayShadow
|
|
|
|
/* Backend Functions. */
|
|
#define select(A, B, mask) mix(A, B, mask)
|
|
|
|
bool is_zero(vec2 A)
|
|
{
|
|
return all(equal(A, vec2(0.0)));
|
|
}
|
|
|
|
bool is_zero(vec3 A)
|
|
{
|
|
return all(equal(A, vec3(0.0)));
|
|
}
|
|
|
|
bool is_zero(vec4 A)
|
|
{
|
|
return all(equal(A, vec4(0.0)));
|
|
}
|