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

Add support for older hardware #5

Merged
merged 8 commits into from
Dec 17, 2021
Merged

Conversation

derezzedex
Copy link
Contributor

@derezzedex derezzedex commented Dec 8, 2021

This PR aims to add support for older hardware, depends on grovesNL/glow#196.
Should close #4.

Changes

For this, this PR does a couple of things:

  • Separate the pipeline into core and compatibility.
  • Modify shaders based on context version.
  • Change texture format based on context version.

I've also:

  • Added Pipeline::get_max_texture_size (which had a TODO)
  • Described the changes on CHANGELOG.md

Core and Compatibility

The main idea here is to separate the core pipeline, which is preferred and used on hardware that supports it and the compatibility pipeline which is the fallback, used on hardware that doesn't have the features needed for core.

Right now, the main thing separating them is the support for instancing, this means that core uses instancing while compatibility uses a vertex and index buffer.

Feedback

I think the separation between the core and compatibility could be improved to reduce code duplication and futher changes/maintenance easier. Any feedback and testing is appreciated.

@hecrj hecrj added the enhancement New feature or request label Dec 8, 2021
@hecrj hecrj added this to the 0.4.1 milestone Dec 8, 2021
Copy link
Owner

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is perfect! Great work 🎉

I have made a couple of small changes:

  • Updated glutin to 0.28, as I wasn't able to run the examples with the older version.
  • Updated glow to 0.11.1, which already contains the changes in Expose Version and add Context::version grovesNL/glow#196 🎉
  • Updated the CHANGELOG to only mention the changes that are important to end-users.

The integration workflow is failing on the beta toolchain because of an issue on winit and some changes in the linking strategy of Rust (see rust-windowing/winit#2078).

In any case, I think we can 🚢 !

@hecrj hecrj merged commit 92b5bea into hecrj:master Dec 17, 2021
@hecrj hecrj modified the milestones: 0.4.1, 0.5.0 Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for old OpenGL versions
2 participants