diff options
author | Jason Fielder <jason_apple> | 2022-09-22 18:52:44 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-09-22 18:53:56 +0300 |
commit | 18b45aabf91ad0a407e8c7cd16c5503e7a99d6fa (patch) | |
tree | c4b5a1db3ec5bab9f1d9f1038d131f398046506a /source/blender/draw/engines/workbench | |
parent | 1514e1a5b7e15ec0c11cd40c2b9389982bd5d00e (diff) |
Metal: GLSL shader compatibility changes for global uniform and interface name collision.
For the Metal shader translation support for shader-global uniforms are remapped via macro's, and in such cases where a uniform name matches a vertex attribute name, compilation errors will occur due to this injected syntax being incompatible with the immediate code.
Also adding source-level function interface alternatives where sized arrays are passed in. These are not supported directly in Metal shading language and are instead handled as pointers. These pointers require explicit address-space qualifiers in some cases, if device/constant address space memory is passed into the function.
Ref T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15898
Diffstat (limited to 'source/blender/draw/engines/workbench')
-rw-r--r-- | source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl index 213279b1913..32191835668 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_transparent_accum_frag.glsl @@ -6,7 +6,7 @@ #pragma BLENDER_REQUIRE(workbench_world_light_lib.glsl) /* Special function only to be used with calculate_transparent_weight(). */ -float linear_zdepth(float depth, vec4 viewvecs[2], mat4 proj_mat) +float linear_zdepth(float depth, mat4 proj_mat) { if (proj_mat[3][3] == 0.0) { float d = 2.0 * depth - 1.0; @@ -14,7 +14,7 @@ float linear_zdepth(float depth, vec4 viewvecs[2], mat4 proj_mat) } else { /* Return depth from near plane. */ - return depth * viewvecs[1].z; + return depth * drw_view.viewvecs[1].z; } } @@ -24,7 +24,7 @@ float linear_zdepth(float depth, vec4 viewvecs[2], mat4 proj_mat) */ float calculate_transparent_weight(void) { - float z = linear_zdepth(gl_FragCoord.z, drw_view.viewvecs, drw_view.winmat); + float z = linear_zdepth(gl_FragCoord.z, drw_view.winmat); #if 0 /* Eq 10 : Good for surfaces with varying opacity (like particles) */ float a = min(1.0, alpha * 10.0) + 0.01; |