

You should know when to choose a compute shader over the other shaders for your algorithm (this is not one such example). The work group size is specified along with the kernel source code, and the number of work groups launched is given by the application as arguments to DispatchCompute*().

Just like with other GPGPU implementations, threads are grouped into work groups and one compute shader invocation processes a bunch of work groups. OpenGL compute shaders are GLSL and similar to other shaders: you can read textures, images, and buffers and write images and buffers. Instead, compute shaders have to be placed into program objects by themselves and the application has to instruct OpenGL about the execution order explicitly by switching on and off the compute shader program object and calling DispatchCompute*() to run the compute shaders. Shader objects within a program object are implicitly pipelined after another, and a program object is "ready to go" as it is.Ĭompute shaders cannot be baked into a program object alongside other shaders as their execution order is not fixed. The important thing to note is that while the other shaders have a fixed execution order, compute shaders can essentially alter any data anywhere. Today, since I couldn't find a tutorial/example on google, I'm going to show you how to use them. OpenGL 4.3 was released yesterday, and among the larger updates were compute shaders. OpenGL (4.3) compute shader example Introduction

GPGPU abstraction framework (CUDA/OpenCL + OpenGL)

Using dynamic libraries for modular client threadsĬreating a double buffered X window with the DBE X extensionĬhange local passwords via RoundCube safer Using manually tweaked PTX assembly in your CUDA 2 program Linux initramfs with iSCSI and bonding support for PXE booting
