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-09-22 18:52:44 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-09-22 18:53:56 +0300
commit18b45aabf91ad0a407e8c7cd16c5503e7a99d6fa (patch)
treec4b5a1db3ec5bab9f1d9f1038d131f398046506a /source/blender/gpu
parent1514e1a5b7e15ec0c11cd40c2b9389982bd5d00e (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/gpu')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl2
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl6
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl2
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_3D_polyline_info.hh2
4 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
index 27740c8d71b..f912bad8a14 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
@@ -7,7 +7,7 @@ void main()
discard;
}
#endif
- fragColor = interp.color;
+ fragColor = interp.final_color;
if (lineSmooth) {
fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5 - abs(interp.smoothline), 0.0, 1.0);
}
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl
index 1c824023234..6d23e03c835 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl
@@ -18,14 +18,14 @@ vec4 clip_line_point_homogeneous_space(vec4 p, vec4 q)
void do_vertex(const int i, vec4 pos, vec2 ofs)
{
#if defined(UNIFORM)
- interp_out.color = color;
+ interp_out.final_color = color;
#elif defined(FLAT)
/* WATCH: Assuming last provoking vertex. */
- interp_out.color = interp_in[1].color;
+ interp_out.final_color = interp_in[1].final_color;
#elif defined(SMOOTH)
- interp_out.color = interp_in[i].color;
+ interp_out.final_color = interp_in[i].final_color;
#endif
#ifdef CLIP
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl
index d4ef3e6142f..5119db2437c 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl
@@ -3,7 +3,7 @@ void main()
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
#ifndef UNIFORM
- interp.color = color;
+ interp.final_color = color;
#endif
#ifdef CLIP
interp.clip = dot(ModelMatrix * vec4(pos, 1.0), ClipPlane);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_polyline_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_polyline_info.hh
index b486674082e..f16dc516bac 100644
--- a/source/blender/gpu/shaders/infos/gpu_shader_3D_polyline_info.hh
+++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_polyline_info.hh
@@ -9,7 +9,7 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_INTERFACE_INFO(gpu_shader_3D_polyline_iface, "interp")
- .smooth(Type::VEC4, "color")
+ .smooth(Type::VEC4, "final_color")
.smooth(Type::FLOAT, "clip")
.no_perspective(Type::FLOAT, "smoothline");