Revision: 56597
          http://sourceforge.net/p/brlcad/code/56597
Author:   ejno
Date:     2013-08-05 20:09:16 +0000 (Mon, 05 Aug 2013)
Log Message:
-----------
work on sphere intersection

Modified Paths:
--------------
    brlcad/branches/opencl/src/librt/primitives/ell/ell.c

Modified: brlcad/branches/opencl/src/librt/primitives/ell/ell.c
===================================================================
--- brlcad/branches/opencl/src/librt/primitives/ell/ell.c       2013-08-05 
20:01:13 UTC (rev 56596)
+++ brlcad/branches/opencl/src/librt/primitives/ell/ell.c       2013-08-05 
20:09:16 UTC (rev 56597)
@@ -254,10 +254,8 @@
 static cl_kernel kernel;
 
 
+/* just spheres for now  */
 const char * const clt_program_code = "\
-#define MAX_SPHERES 10\
-\
-\
 typedef struct\
 {\
     float3 position;\
@@ -266,18 +264,18 @@
 } Sphere;\
 \
 \
-__kernel void ray_trace(__global float *output, __constant Sphere *gspheres)\
+__kernel void ell_shot(__global float *output, __constant Sphere sphere, 
Sphere vlight, float3 E, float3 V)\
 {\
-    __local Sphere spheres[MAX_SPHERES];\
+    float3 EO = sphere.position-(E+V);\
+    float v = dot(EO, V);\
+    float disc = 0; //TODO\
 \
-    spheres[get_global_id(0)] = gspheres[get_global_id(0)];\
-    barrier(CLK_LOCAL_MEM_FENCE);\
+    if (disc < 0) {\
+       output = 0;\
+       return;\
+    }\
 \
-    if (get_global_id(0) == 0) {\
-       for (int i = 0; i < MAX_SPHERES; ++i)\
-       printf(\"is_light: %d\n\", spheres[i].is_light);\
-       printf(\"%d\n\", get_local_size(0));\
-    }\
+    float d = sqrt(disc);\
 }\
 \
 ";

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to