From 9bcba25bc2aa5ad96391423daa6d06339c54083b Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Thu, 10 Oct 2024 12:16:28 +0200 Subject: [PATCH] Fix #128282: EEVEE: Unable to compile displacement When using vertex displacement EEVEE didn't compile the generated functions into the vertex shader. This could result in errors when compiling materials. **Notes** - Should be back-ported to Blender 4.2 Pull Request: https://projects.blender.org/blender/blender/pulls/128525 --- .../gpu/shaders/gpu_shader_codegen_lib.glsl | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl b/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl index 253af081591..2826c239f7d 100644 --- a/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl +++ b/source/blender/gpu/shaders/gpu_shader_codegen_lib.glsl @@ -312,20 +312,10 @@ GlobalData g_data; #ifndef GPU_FRAGMENT_SHADER /* Stubs. */ -vec3 dF_impl(vec3 v) -{ - return vec3(0.0); -} -void dF_branch(float fn, out vec2 result) -{ - result = vec2(0.0); -} - -void dF_branch_incomplete(float fn, out vec2 result) -{ - result = vec2(0.0); -} +# define dF_impl(a) (vec3(0.0)) +# define dF_branch(a, b) (b = vec2(0.0)) +# define dF_branch_incomplete(a, b) (b = vec2(0.0)) #elif defined(GPU_FAST_DERIVATIVE) /* TODO(@fclem): User Option? */ /* Fast derivatives */