o
odinpkg.dev
packages / library / OpenGL_Compute_Shaders_with_SSBO_in_Odin

OpenGL_Compute_Shaders_with_SSBO_in_Odin

ada1797library

The dream of having something resembling CUDA Computing on the GPU in simple OpenGL on open source drivers.

No license · updated 3 years ago

OpenGL Compute Shaders with SSBO in Odin

The dream of having something resembling CUDA Computing on the GPU in simple OpenGL on open source drivers.

How to use compute shaders in OpenGL with SSBO - Shader Storage Buffer Objects?

Objective

To perform general computing tasks, of the type of CUDA on the GPU using Compute Shaders and SSBO - Shader Storage Buffer Objects.

Description

The following code has a bug and in my open source Linux drivers on a Integrated AMD GPU inside my CPU AMD Ryzen 4700 G, it crashes the computer. Not fun at all. But because there is so little information on the internet about how to use the Compute shaders and SSBO - Shader Storage Buffer Objects, I am posting this code anyway.

I implemented this code in Odin after doing a lot of research on the internet.
I post here the code and the references that I used to implement it.

There is also a other program inside the directory "opengl_simple_program_working", that works, I made it from following the learning OpenGL tutorial from the site: https://learnopengl.com and from one example of Odin of the GLFW library. That program doesn't use Compute Shaders and SSBO - Shader Storage Buffer Objects, but it works and it is a good starting point to learn how to use OpenGL in Odin.

References

License

MIT Open Source License

Have fun

Best regards,
João Nuno Carvalho