diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-05-11 15:14:06 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-05-11 15:14:06 +0300 |
commit | cc1883468d8537067e0ae6af36075d5cc2d00b68 (patch) | |
tree | 67f158202c7453d098a8a09b3e945fa193a92778 /source/blender | |
parent | 5588a51c9cb89878588c8130a02d76e04a53aae2 (diff) |
Keep valgrind happy by using tight vec3 packing instead of lax vec4 with
an unused coordinate missing.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/gpu/intern/gpu_compositing.c | 8 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c index ab4726508e8..bf3d1753888 100644 --- a/source/blender/gpu/intern/gpu_compositing.c +++ b/source/blender/gpu/intern/gpu_compositing.c @@ -717,12 +717,12 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str int ssao_uniform, ssao_color_uniform, viewvecs_uniform, ssao_sample_params_uniform; int ssao_jitter_uniform, ssao_concentric_tex; float ssao_params[4] = {fx_ssao->distance_max, fx_ssao->factor, fx_ssao->attenuation, 0.0f}; - float sample_params[4]; + float sample_params[3]; sample_params[0] = fx->ssao_sample_count_cache; /* multiplier so we tile the random texture on screen */ - sample_params[2] = fx->gbuffer_dim[0] / 64.0; - sample_params[3] = fx->gbuffer_dim[1] / 64.0; + sample_params[1] = fx->gbuffer_dim[0] / 64.0; + sample_params[2] = fx->gbuffer_dim[1] / 64.0; ssao_params[3] = (passes_left == 1) ? dfdyfac[0] : dfdyfac[1]; @@ -740,7 +740,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str GPU_shader_uniform_vector(ssao_shader, ssao_uniform, 4, 1, ssao_params); GPU_shader_uniform_vector(ssao_shader, ssao_color_uniform, 4, 1, fx_ssao->color); GPU_shader_uniform_vector(ssao_shader, viewvecs_uniform, 4, 3, viewvecs[0]); - GPU_shader_uniform_vector(ssao_shader, ssao_sample_params_uniform, 4, 1, sample_params); + GPU_shader_uniform_vector(ssao_shader, ssao_sample_params_uniform, 3, 1, sample_params); GPU_texture_bind(src, numslots++); GPU_shader_uniform_texture(ssao_shader, color_uniform, src); diff --git a/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl b/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl index 783bce75fbd..494a74dcdf8 100644 --- a/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl @@ -15,7 +15,7 @@ varying vec4 uvcoordsvar; /* ssao_params.x : pixel scale for the ssao radious */ /* ssao_params.y : factor for the ssao darkening */ uniform vec4 ssao_params; -uniform vec4 ssao_sample_params; +uniform vec3 ssao_sample_params; uniform vec4 ssao_color; /* store the view space vectors for the corners of the view frustum here. @@ -34,7 +34,7 @@ vec3 calculate_view_space_normal(in vec3 viewposition) float calculate_ssao_factor(float depth) { /* take the normalized ray direction here */ - vec2 rotX = texture2D(jitter_tex, uvcoordsvar.xy * ssao_sample_params.zw).rg; + vec2 rotX = texture2D(jitter_tex, uvcoordsvar.xy * ssao_sample_params.yz).rg; vec2 rotY = vec2(-rotX.y, rotX.x); /* occlusion is zero in full depth */ |