OpenCL module

I've just introduced a new module for my voxel engine. An OpenCL module where I can built voxel stuff upon. The commit in question is available at github.

I did it almost the same way as with my GLSL shaders, I am parsing the OpenCL kernels and generate C++ code from them. This code is not fully optimized yet. You can check out the generated code in this gist. The kernel that was used to generate this code is available here.

The parser understands the structs in the kernels and parses the kernel parameters to generate the C++ code. But for this to work I rely on some decorators like __kernel, __global and so on. The buffers that are generated determine their buffer flags by qualifiers like const or __read_only, __write_only or __constant.

There is still a lot of work to be done - like the alignment of the data, the work dimension calculation and buffer creation.

The OpenCL stuff is hidden like the OpenGL stuff for the renderer in the video module. Maybe there will be a CUDA implementation later - we'll see.

Kommentare

Beliebte Posts