Code Monkey home page Code Monkey logo

sparkle's People

Contributors

atouchet avatar fabricedesre avatar jdm avatar mmatyas avatar pragmatrix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sparkle's Issues

Generic buffer data methods are unsound

Methods Gl::buffer_data and Gl::sub_buffer_data pass slices of arbitrary T values to the GL system, but those Ts may have padding, which is uninitialised, which means we are passing uninitialised data to the GL system that may be read back by Rust later. The T type parameter should be constrained by some sort of unsafe trait to prevent that.

Factory API for building gl bindings?

One thing we hit in webxr was that gleam doesn't provide a standard API for a GlFactory, that would implement Send and Clone, and would build new Rc<dyn Gl> objects. Servo rolls its own, but there's no way to have those be used by webxr without having webxr depend on servo. It might be nice to put that API in sparkle.

Read pixels into buffer method is unsound

08:55 <nox> jdm: And read_pixels_into_buffer is unsound, cf all the params in https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelStore.xhtml
08:58 <nox> Like, IIRC, if you set GL_PACK_ROW_LENGTH to a bigger value than the natural one, GL will write stuff outside of dst_buffer.

Some texture methods are unsound

Those methods take a buffer, pass it to a GL API as a pointer, and let GL decide how many bytes it should read from it through a combination of other inputs (for example, width and height), these methods should be unsafe:

Furthermore, the GL functions for compressed textures also specify that undefined results can occur "if data is not encoded in a manner consistent with the extension specification defining the internal compression format", so the two methods using them should probably marked as unsafe too:

Parameter methods are probably unsound

Method Gl::get_tex_parameter_iv when passed GL_TEXTURE_BORDER_COLOR will try to write four integer values in a &mut GLint which is obviously not large enough.

The same thing can happen with Gl::get_tex_parameter_fv.

For now, it can't happen with Gl::get_framebuffer_attachment_parameter_iv and Gl::get_renderbuffer_parameter_iv because all framebuffer attachment and renderbuffer parameters are single-valued, but nothing guarantees us that this will be true of all GL extensions in the future, so I would make it unsafe too.

Cc @kvark with whom I had debated about that in the past when it was a problem in gleam.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.