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/overlay/shaders/infos/overlay_extra_info.hh | |
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/overlay/shaders/infos/overlay_extra_info.hh')
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/infos/overlay_extra_info.hh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_extra_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_extra_info.hh index 4ebc83c27b0..65084361f14 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_extra_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_extra_info.hh @@ -145,7 +145,7 @@ GPU_SHADER_CREATE_INFO(overlay_extra_point) /* TODO(fclem): Move the vertex shader to Overlay engine and remove this bypass. */ .define("blender_srgb_to_framebuffer_space(a)", "a") .vertex_in(0, Type::VEC3, "pos") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .vertex_out(overlay_extra_point_iface) .fragment_out(0, Type::VEC4, "fragColor") .vertex_source("overlay_extra_point_vert.glsl") @@ -161,7 +161,7 @@ GPU_SHADER_INTERFACE_INFO(overlay_extra_loose_point_iface, "").smooth(Type::VEC4 GPU_SHADER_CREATE_INFO(overlay_extra_loose_point) .do_static_compilation(true) .vertex_in(0, Type::VEC3, "pos") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .vertex_out(overlay_extra_loose_point_iface) .fragment_out(0, Type::VEC4, "fragColor") .fragment_out(1, Type::VEC4, "lineOutput") @@ -257,7 +257,7 @@ GPU_SHADER_CREATE_INFO(overlay_image) .push_constant(Type::BOOL, "isCameraBackground") .push_constant(Type::BOOL, "imgPremultiplied") .push_constant(Type::BOOL, "imgAlphaBlend") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .vertex_in(0, Type::VEC3, "pos") .vertex_out(overlay_image_iface) .sampler(0, ImageType::FLOAT_2D, "imgTexture") @@ -304,7 +304,7 @@ GPU_SHADER_INTERFACE_INFO(overlay_particle_iface, "").flat(Type::VEC4, "finalCol GPU_SHADER_CREATE_INFO(overlay_particle) .sampler(0, ImageType::FLOAT_1D, "weightTex") - .push_constant(Type::VEC4, "color") /* Draw-size packed in alpha. */ + .push_constant(Type::VEC4, "ucolor") /* Draw-size packed in alpha. */ .vertex_in(0, Type::VEC3, "part_pos") .vertex_in(1, Type::VEC4, "part_rot") .vertex_in(2, Type::FLOAT, "part_val") |