[Bf-blender-cvs] [cb94f59] viewport_experiments: Fix T42596 crash with DOF on MacOS.
Antony Riakiotakis
noreply at git.blender.org
Fri Nov 14 14:45:37 CET 2014
Commit: cb94f59f71ac2b125a3c5602756aca4869763aeb
Author: Antony Riakiotakis
Date: Fri Nov 14 14:45:20 2014 +0100
Branches: viewport_experiments
https://developer.blender.org/rBcb94f59f71ac2b125a3c5602756aca4869763aeb
Fix T42596 crash with DOF on MacOS.
Compiler failed on last shader and failure was not detected. However
compiler error also revealed a blurring error as well :)
===================================================================
M source/blender/gpu/intern/gpu_compositing.c
M source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl
===================================================================
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index 08ad144..662eb82 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -540,7 +540,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
dof_shader_pass5 = GPU_shader_get_builtin_fx_shader(GPU_SHADER_FX_DEPTH_OF_FIELD_PASS_FIVE, is_persp);
/* error occured, restore framebuffers and return */
- if (!dof_shader_pass1 || !(dof_shader_pass2) || (!dof_shader_pass3) || (!dof_shader_pass4)) {
+ if (!dof_shader_pass1 || !dof_shader_pass2 || !dof_shader_pass3 || !dof_shader_pass4 || !dof_shader_pass5) {
GPU_framebuffer_texture_unbind(fx->gbuffer, NULL);
GPU_framebuffer_restore();
return false;
diff --git a/source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl b/source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl
index 385d18d..ffe1118 100644
--- a/source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl
@@ -151,8 +151,8 @@ vec4 small_sample_blur(in sampler2D colorbuffer, in vec2 uv, in vec4 color)
result += weight * texture2D(colorbuffer, uv + color_uv1.xy);
result += weight * texture2D(colorbuffer, uv - color_uv1.xy);
- result += weight * texture2D(colorbuffer, uv + color_uv2.yx);
- result += weight * texture2D(colorbuffer, uv - color_uv2.yx);
+ result += weight * texture2D(colorbuffer, uv + color_uv1.yx);
+ result += weight * texture2D(colorbuffer, uv - color_uv1.yx);
return result;
}
More information about the Bf-blender-cvs
mailing list