Implémentation du raytracing pour Global Memory/Shared Memory/Constant Memory
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / 04_RayTracing / moo / device / RayTracingDevice.h
index 1500c43..350ba9c 100644 (file)
@@ -1,7 +1,26 @@
 #ifndef RAY_TRACING_DEVICE_H
 #define RAY_TRACING_DEVICE_H
 
-__global__
-void rayTracing(uchar4* ptrDevPixels, int w, int h, float t);
+#include "ConstantMemoryLink.h"
+
+#include "Sphere.h"
+#include "RayTracingCommon.h"
+
+#if CURRENT_MEMORY_MODEL == MEMORY_MODEL_GLOBAL or CURRENT_MEMORY_MODEL == MEMORY_MODEL_SHARED
+
+    __global__
+    void rayTracing(uchar4* ptrDevPixels, const Sphere* ptrDevSpheres, int w, int h, float t);
+
+#elif CURRENT_MEMORY_MODEL == MEMORY_MODEL_CONSTANT
+
+    /**
+     * Accès à la mémoire constante contenant les sphères.
+     */
+    ConstantMemoryLink constantMemorySpheresLink();
+
+    __global__
+    void rayTracing(uchar4* ptrDevPixels, int w, int h, float t);
+
+#endif
 
 #endif