Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide High-Level GPU abstraction #42

Open
JayFoxRox opened this issue Jul 14, 2018 · 1 comment
Open

Provide High-Level GPU abstraction #42

JayFoxRox opened this issue Jul 14, 2018 · 1 comment

Comments

@JayFoxRox
Copy link
Member

I think we should implement some form of freeglut + subset of OpenGL 1.x (with NV specific extensions).

I did consider using MESA but I think it might be better to keep things minimalistic, as the primary use-case will be unit-tests for Xbox emulation. This means an OpenGL implementation should be rather flexible and easy to understand.

We probably also don't care too much about error-checking or 100% correct behaviour of OpenGL either.

I've started prototyping some (insanely ugly) OpenGL here JayFoxRox#3
Most of our existing code is also close to OpenGL already and could easily be hacked to have simple applications running.

@JayFoxRox
Copy link
Member Author

JayFoxRox commented Jun 15, 2020

Since this issue was created, a lot of things changed:

  • XGU is a higher-level-than-pbkit, low-level graphics API (roughly 1 GPU command per function).
  • XGUX is a higher-level-than-XGU, low-level graphics API (grouping GPU commands) that come with XGU. It also takes care to hide some GPU internals (example: converting floats to fixed-point and precomputing terms to be compatible with D3D or OpenGL parametrization).
  • xgu-gl is a very rough GL implementation on top of XGU. It was designed for my Neverball port, but it's also being used in gish and some other projects of mine. It's not very generic (and it's a non-goal to be generic) and many features don't work as expected: dive into the codebase to adapt it for your project. It is a good base / snippet library for porting OpenGL (or even D3D) applications.

I also did look at Mesa (and even took some of its code), and I think it would have been a good choice. However, the direction that I took with xgu-gl is also fine for me and my projects.
I also agree with my initial statements that OpenGL should be usable for unit testing (also in tandem with low-level APIs); Mesa would have made this more difficult.

Most applications also only use a small subset of OpenGL, so implementing it yourself is very simple and allows for performance optimizations (also why xgu-gl isn't very generic).

I'll keep this issue opened, until XGU is officially "released", and until xgu-gl has better documentation (probably once my Neverball port is complete).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant