Vulkan in Processing (draft)
(I'm new to PRs so let me know if you see any mistakes ^^")
This is my attempt at making a Vulkan-based renderer for Processing, using LWJGL to access a Vulkan binding. It's part of my final year dissertation where I compare OpenGL and Vulkan renderer speeds so a lot of code is still very messy.
I was also originally planning to release it as a library for Processing, but it appears that moving away from JOGL/OpenGL is now on Processing's roadmap (#881)
The new renderer can be accessed by using PV2D/PV3D in the size() function:
void setup() {
size(512, 512, PV2D);
}
It works by translating OpenGL commands (through the PGL abstraction layer) to Vulkan commands through a thin OpenGL-to-Vulkan translation layer (under a new package named GL2VK). This layer is optimised for Processing (mostly the immediate and retained modes in Processing). These commands are passed to separate threads (called ThreadNodes) which offload the main thread from potentially expensive operations. There is also a shader converter which translates OpenGL shaders to Vulkan shaders.
Also, it uses GLFW to create a window and receive mouse inputs... no AWT!