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

build(deps): bump glow from 0.10.0 to 0.11.0 #594

Merged
merged 4 commits into from
Sep 2, 2021

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 18, 2021

Bumps glow from 0.10.0 to 0.11.0.

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Aug 18, 2021
Bumps [glow](https://github.com/grovesNL/glow) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/grovesNL/glow/releases)
- [Commits](https://github.com/grovesNL/glow/commits)

---
updated-dependencies:
- dependency-name: glow
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/cargo/glow-0.11.0 branch from f78ea3e to 795f5ec Compare August 30, 2021 01:46
@iceiix
Copy link
Owner

iceiix commented Sep 2, 2021

error[E0277]: the trait bound `NativeTexture: std::default::Default` is not satisfied
   --> src/gl/mod.rs:263:20
    |
263 | pub struct Texture(glow::Texture);
    |                    ^^^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `NativeTexture`
    |
    = note: required by `std::default::Default::default`
    = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)

lots of errors of this form, for each of the glow structures. How were they changed? Looks like it can be tracked down to this commit: grovesNL/glow@e6c11f7 (Use newtypes for native GL handles) from grovesNL/glow#180. Glow is now using the newtype pattern much the same as I am in src/gl/mod.rs:

#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
 pub struct NativeShader(NonZeroU32);

but is #[derive(Default)] actually needed, is it used anywhere? Only one place:

impl Drop for VertexArray {
    fn drop(&mut self) {
        unsafe {
            glow_context().delete_vertex_array(self.0);
        }
        self.0 = glow::VertexArray::default();
    }
}

intending to zero-out the released resource, to not leave it dangling. However the new glow::NativeVertexArray is now a newtype of std::num::NonZeroU32: https://doc.rust-lang.org/std/num/struct.NonZeroU32.html

An integer that is known not to equal zero.

This enables some memory layout optimization. For example, Option is the same size as u32:

The intent, I believe, is for safety. But impl Drop for FrameBuffer and Texture do not zero on delete. If I really need to denote this value as freed or not present, it may be better typed as an Option<glow::VertexArray>. Trying removing the assignment first, no ill effects observed so far.

@iceiix
Copy link
Owner

iceiix commented Sep 2, 2021

Removing the defaults works on my local machine, but fails in CI because it causes new clippy warnings - probably the reason I added these defaults in the first place:

warning: you should consider adding a `Default` implementation for `gl::Framebuffer`
   --> src/gl/mod.rs:852:5
    |
852 | /     pub fn new() -> Framebuffer {
853 | |         Framebuffer(unsafe {
854 | |             glow_context()
855 | |                 .create_framebuffer()
856 | |                 .expect("create framebuffer failed")
857 | |         })
858 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
    |
851 | impl Default for gl::Framebuffer {
852 |     fn default() -> Self {
853 |         Self::new()
854 |     }
855 | }
    |

@iceiix iceiix merged commit 83bbb9f into master Sep 2, 2021
@iceiix iceiix deleted the dependabot/cargo/glow-0.11.0 branch September 2, 2021 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant