OpenCL API #567
Replies: 2 comments 5 replies
-
|
To bridge the gap between low-level OpenCL APIs and JVM-focused mod developers, I recommend looking at JavaToGPU (A WIP project, but all the basic functionality has already been implemented): Writing raw OpenCL C kernels inside Java strings and manually managing native buffers has a high entry barrier. This library solves that by translating standard Java bytecode into GPU kernels at runtime. Key Features:
Providing a high-level tool like this alongside Cleanroom's core OpenCL implementation would make GPU-accelerated modding actually accessible for the community. |
Beta Was this translation helpful? Give feedback.
-
|
Having learned about the OpenCL feature in the Cleanroom core, I would like to raise a number of serious architectural concerns and questions that any mod developer will inevitably face. 1. Unreliability of Text Kernel compilation. 2. Architecture and vendor fragmentation. 3. Device selection issues (iGPU vs. dGPU). 4. Register pressure and resource exhaustion. 5. Whose responsibility is hardware-specific optimization? Forcing modders to manually check the resources of every possible GPU, study the nuanced memory behavior of iGPUs vs. dGPUs, and write hacky workarounds creates a colossal barrier to entry. Without a high-level abstraction that takes on the burden of generating correct, hardware-aware code and managing memory safely, GPU acceleration in mods will remain a niche domain for a few enthusiasts, rather than an accessible standard for the community. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Add an OpenCL wrapper (preferrably the LWJGL one) to Cleanroom
Goals
Non Goals
Motivation
There are many kinds of calculations in video games that can be sped up by parallelizing them on the GPU. OpenGL already has that feature in the form of compute shaders, however sadly, it only allows for features implemented at the time OpenGL 4.6 was released. OpenCL would allow developers to write Vulkan Compute level GPU computations without actually implementing Vulkan in the game. There are some mods that might implment their own physics, calculating them with OCL would reduce the load it would take on the CPU. This mainly applies to custom build vehicle mods like Valkyrien Skies and Davinci's Vessels which are notoriously heavy on the tick rate. Adding an API like this would allow for easy integration of paralellized computation without relying on interfacing native code written physics engine as it is done by VS2.
I'm pretty sure OpenGL is also client only, so the compute shaders can't run on the server.
Description
Add a Java OpenCL library to Cleanroom, implement a high level API that wraps around it. Make them avaliable on both client and server.
Dependencies
References
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions