GLSL, Qt, and OpenCL

>> Monday, February 20, 2012

I've coded vertex and fragment shaders in GLSL, but I've never worked with the new geometry and tessellation shaders. To make up for this, I've been reading the OpenGL 4.0 Shading Language Cookbook by David Wolff. It's well written and I'm learning a lot. It's more than just a book of recipes; Dr. Wolff does a fine job explaining the underlying concepts.

One aspect of the book I find particularly interesting is the use of Qt in the example code. This is the first OpenGL/GLSL book I've seen that relies on Qt instead of GLUT, and I strongly approve. I have nothing against GLUT, but it was created as a quick-and-dirty way to demonstrate OpenGL coding. There are efforts to build on top of GLUT (see GLOW), but it's still not a professional toolset for building full-featured applications. In contrast, Qt provides a wealth of features including a new method of multithreading that improves the performance of OpenGL rendering. Unfortunately, because so much OpenGL code relies on GLUT, many conflate the two and assume GLUT's limitations apply to OpenGL.

Another thought struck me as I read Dr. Wolff's book. GLSL shaders and OpenCL kernels have a lot in common: similar purposes, operations, and datatypes. But the APIs are so different that you'd never guess they were released by the same group. For OpenCL 2.0, it would be helpful if the kernel API was changed to resemble GLSL. This would make it easier to code GPU drivers and compilers and would probably increase the developer base of both languages. Besides, in my OpenCL-OpenGL applications, the OpenCL kernels act like pre-shaders, manipulating vertices and colors before the real shaders begin processing.


Mac OS X 10.8 - Mountain Lion

>> Thursday, February 16, 2012

Apple has announced the upcoming release of Mac OS, version 10.8. I've searched as best I can, but I can't find any hard information regarding OpenCL/OpenGL support.

Many articles mention a "new graphics infrastructure" involving OpenCL and OpenGL. I don't know what that means, but I'll keep an eye out.


Source Code

>> Monday, February 13, 2012

Over the weekend, I received an e-mail asking for the source code for my OpenCL FFT. Like most of the projects mentioned on this blog, this is freely available at Manning's web site here. There are three archives: one for Visual Studio, one for Linux, and one for Mac OS. The reason for the separate Linux and Mac OS releases is that Linux supports OpenCL 1.1 and Mac OS doesn't.

Speaking of Mac OS, Apple has several job openings for OpenCL developers, and it doesn't look like they're being filled. I'm sure this is partly due to OpenCL's difficulty and obscurity, but I bet a large part of it has to do with mindset. If you've chosen OpenCL over CUDA, it probably means you prefer standards-based, cross-platform tools over tools developed by and for a single company. If this is the case, Apple is the last place you'll want to work. When I consider how cult-like Apple's consumers are, I can only imagine what their employees must be like.

If I was AMD, I'd lend my best OpenCL coders to Apple to help with driver development. If OpenCL is ever fully supported by Mac OS and iOS, the size of the developer base will skyrocket.


  © Blogger template Werd by 2009

Back to TOP