I built a small game engine using OpenCL and SDL2 but it's not running really fast compare to Vulkan and OpenGL. I wrote rasterization code, but when I did some research Vulkan and OpenGL use hardware base rasterization and my rasterization is software base, so my code will be a lot slower. Is it possible to force OpenCL to enable hardware base rasterization?
\$\begingroup\$
\$\endgroup\$
6
-
\$\begingroup\$ If you've determined that Vulkan and OpenGL implementations are faster at doing what they're designed to do — rasterization — than an API designed to do GPU workloads that are not rasterization, why not simply implement your rastization workloads in Vulkan/OpenGL or other graphics APIs (ie. what the rest of the games industry does)? Do you have some special requirement that demands the use of OpenCL for this task? \$\endgroup\$DMGregory– DMGregory ♦2022-04-02 19:44:41 +00:00Commented Apr 2, 2022 at 19:44
-
\$\begingroup\$ Because I already have experience with opencl and learning Vulkan and OpenGL is kind annoying, plus I want totally control of my code \$\endgroup\$is code– is code2022-04-02 19:53:01 +00:00Commented Apr 2, 2022 at 19:53
-
\$\begingroup\$ In what sense do you believe using these APIs would take away control of your code? \$\endgroup\$DMGregory– DMGregory ♦2022-04-02 20:14:20 +00:00Commented Apr 2, 2022 at 20:14
-
\$\begingroup\$ I would like to implement my own 3d math library, as I could have more control then using GLM library \$\endgroup\$is code– is code2022-04-02 21:21:34 +00:00Commented Apr 2, 2022 at 21:21
-
2\$\begingroup\$ You don't have to use GLM with OpenGL, so you can use your own 3D math library with OpenGL, or any other graphics API. I get a strong impression from reading your questions that you are labouring under some serious misconceptions about what these graphics APIs are and how they work. I think you would benefit from building at least a small sample with one, to learn how it actually works in practice. \$\endgroup\$DMGregory– DMGregory ♦2022-04-02 21:29:38 +00:00Commented Apr 2, 2022 at 21:29
|
Show 1 more comment