From 4f8e4044ae6b9b7d71e1d16170f40f1753e4da89 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Fri, 10 Oct 2025 18:38:24 +0200 Subject: [PATCH] API Documentation: Add note to `gpu.shader` to explicitly set all uniforms Fix #103176 Pull Request: https://projects.blender.org/blender/blender/pulls/146860 --- source/blender/python/gpu/gpu_py_shader.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/python/gpu/gpu_py_shader.cc b/source/blender/python/gpu/gpu_py_shader.cc index db4143b6a97..62cd9d28ed2 100644 --- a/source/blender/python/gpu/gpu_py_shader.cc +++ b/source/blender/python/gpu/gpu_py_shader.cc @@ -1049,6 +1049,11 @@ PyDoc_STRVAR( "All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.\n" "\n" "Its value must be modified using the :class:`gpu.matrix` module.\n" + "\n" + ".. important::\n" + "\n" + " Shader uniforms must be explicitly initialized to avoid retaining values from previous " + "executions.\n" "\n" PYDOC_BUILTIN_SHADER_DESCRIPTION); static PyModuleDef pygpu_shader_module_def = { /*m_base*/ PyModuleDef_HEAD_INIT,