From f88f52617be9966cddd3ec28d590704fb8a615eb Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Fri, 19 Apr 2013 20:46:21 +0000 Subject: Ajout option -Werror et affichage lorsque ca compile pas. Amelioration des kernels en conséquence. Bugfix avec le sizeof(source) qui prennait un caractère de trop (le '\0') MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2013-gpudataviz/trunk@31 371a6b4a-a258-45f8-9dcc-bdd82ce0ac9d --- src/opencl_mesh_kit.hpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/opencl_mesh_kit.hpp') diff --git a/src/opencl_mesh_kit.hpp b/src/opencl_mesh_kit.hpp index 5efd30e..29e8d64 100644 --- a/src/opencl_mesh_kit.hpp +++ b/src/opencl_mesh_kit.hpp @@ -52,18 +52,12 @@ const char kernel_src_zero_z[]=STRINGIFY( __kernel void zero_z(__global float4 *pos, unsigned int width, unsigned int height, float time) { unsigned int nx = get_global_id(0); unsigned int ny = get_global_id(1); - /* calculate uv coordinates of the mesh point [0.0;1.0] */ - float u = nx / (float) width; - float v = ny / (float) height; - /* calculate centered normalized coordinates [-1.0;1.0] */ - float x = u*2.0-1.0; - float y = v*2.0-1.0; - /* Calculate the desirated value of the mesh point */ - float z = 0.0f; - /* We only use normalized quaterinons here */ - float w = 1.0f; - /* Write output vertex (centered) */ - pos[ny*width+nx] = (float4)(x, y, z, w); + float4 out; + out.x = nx / (float) width * 2.0f - 1.0f; + out.y = ny / (float) height * 2.0f - 1.0f; + out.z = 0.0f; + out.w = 1.0f; + pos[ny*width+nx] = out; } ); -- cgit v1.2.3