Thanks to visit codestin.com
Credit goes to github.com

Skip to content

"UniformXARB doesn't exist" comments in uniform_storage.rs #2132

@OLEGSHA

Description

@OLEGSHA

I wanted to implement support for non-square matrix uniform values, and I am currently looking at uniform_storage.rs. Some data types have comments like // Uniform1uiARB doesn't exist and use a workaround instead of the uniform! macro.

I did some digging and I can't quite understand what's going on.

Let's examine UnsignedIntVec2. According to OpenGL reference at Khronos, glUniform2uiv is unavailable before 3.0. Current workaround code will attempt to use it in OpenGL versions 1.5, 2.0 and 2.1 (let's ignore ES for now):

if ctxt.version >= &Version(Api::Gl, 1, 5) ||
   ctxt.version >= &Version(Api::GlEs, 2, 0)
{
    ctxt.gl.Uniform2uiv( // ...

Otherwise, it will use the signed integer ARB version, Uniform2ivARB.

  1. How can this work in OpenGL 1.5*?
  2. How can this work in OpenGL 2.0, 2.1?
  3. Why is there no runtime check for values that wouldn't fit into Uniform2ivARB if it's used? I imagine debugging a bug caused by this conversion could be a nightmare.
  4. Why does this workaround even exist if Glium is an "Easy-to-use, high-level, OpenGL3+ wrapper" (from docs index)?
  5. Do I need to use the same workaround for non-square matrices that seem to be in the same situation?

* - I don't have any real experience working carefully with context versions, by from my understanding, even if ARB_shader_objects was ubiquitously available before 2.0, it would still require the use of the suffixed symbols.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions