trial icon indicating copy to clipboard operation
trial copied to clipboard

Render state

Open Shinmera opened this issue 9 months ago • 0 comments

This PR supersedes the earlier effort in #50

Specifically it adds a new resource type, the render-state, which encapsulates the relevant global OpenGL state in an object that can be swapped out wholesale to represent different state sets.

Traditional calls to more "immediately" change state are changed to operations on this state object, and old functions to do the same are deprecated.

This is notably not a complete switch to support render state objects. Parts of Trial and user code will still directly manipulate a render state object, while they should ultimately for best performance on future backends become immutable, and more importantly, discretely enumerated ahead of time like other resource types.

For now this PR merely aims to achieve two things:

  1. Implement a new, more "modern" API based on the render-state object for users to consume and switch from old operators to
  2. Remove all calls to GL feature flag wrangling
  3. Remove all direct calls to GL functions outside of resource implementations

Future efforts will need to tackle discrete enumeration of state objects and re-examine how framebuffers, shader-programs, and so on are managed and used.

Shinmera avatar Apr 11 '25 18:04 Shinmera