Skip to content

Instantly share code, notes, and snippets.

@kraiskil
Created December 17, 2013 13:16
Show Gist options
  • Save kraiskil/8004743 to your computer and use it in GitHub Desktop.
Save kraiskil/8004743 to your computer and use it in GitHub Desktop.
diff --git a/geomfunc.h b/geomfunc.h
index 6f2fde3..19ef462 100644
--- a/geomfunc.h
+++ b/geomfunc.h
@@ -29,7 +29,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef SMALLPT_GPU
-static float SphereIntersect(
+float SphereIntersect(
#ifdef GPU_KERNEL
OCL_CONSTANT_BUFFER
#endif
@@ -58,7 +58,7 @@ OCL_CONSTANT_BUFFER
}
}
-static void UniformSampleSphere(const float u1, const float u2, Vec *v) {
+void UniformSampleSphere(const float u1, const float u2, Vec *v) {
const float zz = 1.f - 2.f * u1;
const float r = sqrt(max(0.f, 1.f - zz * zz));
const float phi = 2.f * FLOAT_PI * u2;
@@ -68,7 +68,7 @@ static void UniformSampleSphere(const float u1, const float u2, Vec *v) {
vinit(*v, xx, yy, zz);
}
-static int Intersect(
+ int Intersect(
#ifdef GPU_KERNEL
OCL_CONSTANT_BUFFER
#endif
@@ -91,7 +91,7 @@ OCL_CONSTANT_BUFFER
return (*t < inf);
}
-static int IntersectP(
+int IntersectP(
#ifdef GPU_KERNEL
OCL_CONSTANT_BUFFER
#endif
@@ -109,7 +109,7 @@ OCL_CONSTANT_BUFFER
return 0;
}
-static void SampleLights(
+void SampleLights(
#ifdef GPU_KERNEL
OCL_CONSTANT_BUFFER
#endif
@@ -164,7 +164,7 @@ OCL_CONSTANT_BUFFER
}
}
-static void RadiancePathTracing(
#ifdef GPU_KERNEL
OCL_CONSTANT_BUFFER
#endif
@@ -337,7 +337,7 @@ OCL_CONSTANT_BUFFER
}
}
-static void RadianceDirectLighting(
+void RadianceDirectLighting(
#ifdef GPU_KERNEL
OCL_CONSTANT_BUFFER
#endif
diff --git a/rendering_kernel.cl b/rendering_kernel.cl
index 593b321..5c8ff69 100644
--- a/rendering_kernel.cl
+++ b/rendering_kernel.cl
@@ -26,7 +26,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "camera.h"
#include "geomfunc.h"
-static void GenerateCameraRay(OCL_CONSTANT_BUFFER Camera *camera,
+void GenerateCameraRay(OCL_CONSTANT_BUFFER Camera *camera,
unsigned int *seed0, unsigned int *seed1,
const int width, const int height, const int x, const int y, Ray *ray) {
const float invWidth = 1.f / width;
diff --git a/simplernd.h b/simplernd.h
index b9bdbf0..cfea0cb 100644
--- a/simplernd.h
+++ b/simplernd.h
@@ -31,7 +31,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef SMALLPT_GPU
-static float GetRandom(unsigned int *seed0, unsigned int *seed1) {
+float GetRandom(unsigned int *seed0, unsigned int *seed1) {
*seed0 = 36969 * ((*seed0) & 65535) + ((*seed0) >> 16);
*seed1 = 18000 * ((*seed1) & 65535) + ((*seed1) >> 16);
diff --git a/smallptGPU.c b/smallptGPU.c
index b5a2384..2b878ef 100644
--- a/smallptGPU.c
+++ b/smallptGPU.c
@@ -282,6 +282,7 @@ static void SetUpOpenCL() {
case CL_DEVICE_TYPE_DEFAULT:
stype = "TYPE_DEFAULT";
break;
+ default:
case CL_DEVICE_TYPE_CPU:
stype = "TYPE_CPU";
if (!useGPU && !deviceFound) {
@@ -296,9 +297,6 @@ static void SetUpOpenCL() {
deviceFound = 1;
}
break;
- default:
- stype = "TYPE_UNKNOWN";
- break;
}
fprintf(stderr, "OpenCL Device %d: Type = %s\n", i, stype);
@pjaaskel
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment