diff options
author | Jason Fielder <jason_apple> | 2022-03-30 20:37:29 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-03-30 20:47:00 +0300 |
commit | 7c9e128bbfb37d70799f8867d93992ee3f522242 (patch) | |
tree | 2b881de1c924455d6e58ccad35d8831339abfa3a /source/blender/draw/engines/overlay | |
parent | 60a6fbf5b59911cba54d30bd1105626fcc577875 (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/draw/engines/overlay')
3 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl b/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl index 67d172fbd01..2f4542343f7 100644 --- a/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl @@ -2,7 +2,7 @@ #pragma BLENDER_REQUIRE(common_math_lib.glsl) uniform sampler2D colorTex; -uniform sampler2D depthTex; +uniform depth2D depthTex; uniform sampler2D lineTex; uniform bool doSmoothLines; diff --git a/source/blender/draw/engines/overlay/shaders/extra_lightprobe_grid_vert.glsl b/source/blender/draw/engines/overlay/shaders/extra_lightprobe_grid_vert.glsl index 1f3a23324bb..19a3cd42bde 100644 --- a/source/blender/draw/engines/overlay/shaders/extra_lightprobe_grid_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/extra_lightprobe_grid_vert.glsl @@ -1,5 +1,5 @@ -uniform sampler2D depthBuffer; +uniform depth2D depthBuffer; uniform vec4 gridModelMatrix[4]; uniform bool isTransform; diff --git a/source/blender/draw/engines/overlay/shaders/grid_frag.glsl b/source/blender/draw/engines/overlay/shaders/grid_frag.glsl index 9feca644bd3..4a9b8d15528 100644 --- a/source/blender/draw/engines/overlay/shaders/grid_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/grid_frag.glsl @@ -12,7 +12,7 @@ uniform vec3 planeAxes; uniform float gridDistance; uniform vec3 gridSize; uniform float lineKernel = 0.0; -uniform sampler2D depthBuffer; +uniform depth2D depthBuffer; uniform int gridFlag; uniform float zoomFactor; @@ -49,7 +49,7 @@ float get_grid(vec2 co, vec2 fwidthCos, float grid_size) { float half_size = grid_size / 2.0; /* triangular wave pattern, amplitude is [0, half_size] */ - vec2 grid_domain = abs(mod(co + half_size, grid_size) - half_size); + vec2 grid_domain = abs(mod(co + half_size, vec2(grid_size)) - half_size); /* modulate by the absolute rate of change of the coordinates * (make lines have the same width under perspective) */ grid_domain /= fwidthCos; |