While this happens to be the very same cube as the last one, from exactly the same angle IIRC, this one is of note for being output from GLSL, and more importantly this should run on AMD GPU's... but I haven't tested it. In the "Display" menu there is an option to switch between GLSL and OpenCL for rendering on the fly. I took the time to make sure they are pixel for pixel the same, correcting the GLSL fragment coords to achieve this.
Of particular interest is the horizontal line through the middle of the cube. It only appears at certain angles, and I believe it to be the result of GLSL not handling infinity quite as nicely as OpenCL does, as the AABB-Slab method I used exploits floating points ability to store both positive and negative infinity. Alas I'm not sure if this is a bug or intended behaviour. Back in good news land, there as yet appears to be no difference in performance between the two implementations on my GTX 680. Here's the relevant commit.
Showing posts with label OpenCL. Show all posts
Showing posts with label OpenCL. Show all posts
Tuesday, November 26, 2013
Monday, November 4, 2013
Shadertoy like OpenCL Kernel Tester
EDIT 2017-11-10: The build environment instructions I've given here are quite out of date, a current one can be found here. Regarding DLL's, MinGW can link directly against them, so there should no longer ever be a need to use
dlltool or gendef in anger. END-EDITWell I say it's like Shadertoy, but it's nowhere near as good. Either way, it's OpenGL using a texture that's generated in OpenCL, and the CPU isn't getting involved. I've also rewiggled the build system, so now it should theoretically build Windows binaries from Linux, although my Debian Wheezy tests have so far not yielded success. I'm hoping there were bugs in the gcc-4.6 version of mingw64, but there's probably a flag somewhere I'm missing, as my Windows test with the same build config on native Windows version of mingw64 with gcc 4.8 worked a treat.
So GNU/Linux users, to build this type "make". You'll need the OpenCL dev files, and some X11 stuff. It should all be in your repository. It doesn't matter if you install the Nvidia OpenCL headers, or the AMD ones, or the Intel ones. They all work the same, and all speak to each other. Your distro's package manager should have everything on hand, shouldn't be more than a couple of megabytes.
Windows users, to build this type "make". Setting it up to be that easy is a bit of a task.
dlltool -l libOpenCL.a -d OpenCL.def -k -A dlltool -l libOpenCL64.a -d OpenCL64.def -k -A
lib.a files you need, stick them in c:\mingw64\x86_64-x64-mingw32\lib\ When the time comes that you want to use more modern OpenCL, you'll have to download the OpenCL SDK from your hardware manufacturer, find their DLL's, and run these commands on them... gendef OpenCL.dll gendef OpenCL64.dll
.def files you need to give to dlltool. If you're cross compiling from GNU/Linux, dlltool is named "x86_64-w64-mingw32-dlltool". It can be coerced into producing the lib file straight from the DLL, but there's no way I'm going to distribute their DLL's.Well, here's the link to the code. It builds on Debian Wheezy, and 64bit windows. You can build it in 32bit mode, but I've got datasets too big to fit in 4Gb of RAM. I don't support 32bit for this project. The upper case sigma, "Σ", reloads the OpenCL kernel from disk.
A note about OpenCL. If you've got current video card drivers from Nvidia or AMD then you already have all the OpenCL you need. I expect my OpenCL kernel will disagree with AMDs OpenCL compiler... feel free to fix it AMD owners :-)
Labels:
BSD License,
C99,
github,
GL Sharing,
OpenCL,
OpenGL,
real-time,
win32,
X11
Friday, September 13, 2013
Most Underwhelming Screenshot Attempt 2
Another in a soon to be oh so very long line of underwhelming screenshots. This one demonstrates OpenCL borrowing a texture from OpenGL, filling it with gradients, and returning it.
Just like the last underwhelming screenshot and if anything moreso, this is a portent of things to come.
Labels:
C99,
GL Interop,
GL Sharing,
GPGPU,
GPU,
OpenCL,
OpenGL
Sunday, February 19, 2012
OpenCL Compilation Tool
I wrote a simple OpenCL compiler interface tool, partially to sink my teeth into OpenCL, partially because I wanted it. Also it seems I'm one of the few who's tackling OpenCL from a pure C angle, so this code may be useful to other folks going down that path.
If compilation works, it tells you how many bytes the binary is. If it fails, it outputs the compiler messages. That's it. It's a single C file, the linked archive includes a Makefile for Mingw, and a binary for windows. It's so simple you should have *no* problems building it on anything. Compiles with gcc and clang with -Wall with no warnings. What more could you want? Features? Use clcc.
It should be noted, that there is already a tool that does this, clcc, which supports... well... options. All of them it seems. It's written in C++, uses Boost, etc. I encourage folks to use that one instead of mine, it's much better. But if you're a fan of KISS, then you might want to check out mine. But clcc is better. On with the show...
Invoking it displays it's usage...
D:\code\opencl\ocl>ocl
OpenCL Compiler Test Tool
(c) 2012 Daniel Burke - dan.p.burke@gmail.com
USAGE:
ocl
display arguments and devices
ocl filename
compile filename with first device
ocl N filename
compile filename with Nth device
The Device list is...
-----------------------
AMD Accelerated Parallel Processing
0 ATI RV770
1 ATI RV770
2 Intel(R) Core(TM)2 Duo CPU E8600 @ 3.33GHz
Intel(R) OpenCL
3 Intel(R) Core(TM)2 Duo CPU E8600 @ 3.33GHz
If compilation works, it tells you how many bytes the binary is. If it fails, it outputs the compiler messages. That's it. It's a single C file, the linked archive includes a Makefile for Mingw, and a binary for windows. It's so simple you should have *no* problems building it on anything. Compiles with gcc and clang with -Wall with no warnings. What more could you want? Features? Use clcc.
Labels:
BSD License,
C,
clcc,
compiler,
download,
github,
KISS,
ocl,
Open Source,
OpenCL
Subscribe to:
Posts (Atom)


