Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Fielder <jason_apple>2022-03-30 20:37:29 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-03-30 20:47:00 +0300
commit7c9e128bbfb37d70799f8867d93992ee3f522242 (patch)
tree2b881de1c924455d6e58ccad35d8831339abfa3a /source/blender/gpu/shaders/opengl
parent60a6fbf5b59911cba54d30bd1105626fcc577875 (diff)
Metal: GLSL Compatibility - explicit mat4_to_mat3 conversion
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
Diffstat (limited to 'source/blender/gpu/shaders/opengl')
-rw-r--r--source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl b/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl
index a5fce2e71c3..0515a737e6e 100644
--- a/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl
+++ b/source/blender/gpu/shaders/opengl/glsl_shader_defines.glsl
@@ -1,3 +1,13 @@
+
+/* 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)