From 18b45aabf91ad0a407e8c7cd16c5503e7a99d6fa Mon Sep 17 00:00:00 2001 From: Jason Fielder Date: Thu, 22 Sep 2022 17:52:44 +0200 Subject: 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 --- .../draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh') diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh index 92a35a049a4..e2cc0a54153 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh @@ -278,7 +278,7 @@ GPU_SHADER_CREATE_INFO(overlay_edit_uv_verts) GPU_SHADER_CREATE_INFO(overlay_edit_uv_tiled_image_borders) .do_static_compilation(true) .vertex_in(0, Type::VEC3, "pos") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .fragment_out(0, Type::VEC4, "fragColor") .vertex_source("overlay_edit_uv_tiled_image_borders_vert.glsl") .fragment_source("overlay_uniform_color_frag.glsl") @@ -294,7 +294,7 @@ GPU_SHADER_CREATE_INFO(overlay_edit_uv_stencil_image) .sampler(0, ImageType::FLOAT_2D, "imgTexture") .push_constant(Type::BOOL, "imgPremultiplied") .push_constant(Type::BOOL, "imgAlphaBlend") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .fragment_out(0, Type::VEC4, "fragColor") .fragment_source("overlay_image_frag.glsl") .additional_info("draw_mesh"); @@ -581,7 +581,7 @@ GPU_SHADER_CREATE_INFO(overlay_depth_only_clipped) GPU_SHADER_CREATE_INFO(overlay_uniform_color) .do_static_compilation(true) .vertex_in(0, Type::VEC3, "pos") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .fragment_out(0, Type::VEC4, "fragColor") .vertex_source("overlay_depth_only_vert.glsl") .fragment_source("overlay_uniform_color_frag.glsl") -- cgit v1.2.3