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

Calls to glUniform*() wrongly assume uniform variable is at location 0 #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

georgeraraujo
Copy link

These changes fix problems on 4 of the examples (see below) with the
following hardware & drivers on Windows 8.1 Pro x64:

  • NVIDIA GeForce GTX 650 Ti with driver 353.30
  • Intel HD 4400 with driver 10.18.14.4206 (OpenGL 4.3)

hdrexposure

  • NVIDIA: no output, and the following error:
    GL_INVALID_OPERATION error generated. Wrong component type or count.

ktxview

  • NVIDIA:
    GL_INVALID_OPERATION error generated. Wrong component type or count.
  • Intel: no output, and the following error:
    Error has been generated. GL error GL_INVALID_OPERATION: GL error GL_INVALID_OPERATION: mismatched type setting uniform "s" in program 1, "" using shaders, 2, "", 3, ""

tesssubdivmodes

  • NVIDIA: no output, and the following error:
    GL_INVALID_OPERATION error generated. Wrong component type or count.

wrapmodes

  • NVIDIA: wrong output, and the following error:
    GL_INVALID_OPERATION error generated. Wrong component type or count.

Wrong:
wrapmodes_location0
Right:
wrapmodes_glgetuniformlocation

These changes fix problems on 4 of the examples (see below) with the
following hardware & drivers on Windows 8.1 Pro x64:
- NVIDIA GeForce GTX 650 Ti with driver 353.30:
- Intel HD 4400 with driver 10.18.14.4206 (OpenGL 4.3).

- hdrexposure
NVIDIA: no output, and the following error:
GL_INVALID_OPERATION error generated. Wrong component type or count.

- ktxview
NVIDIA:
GL_INVALID_OPERATION error generated. Wrong component type or count.

Intel: no output, and the following error:
Error has been generated. GL error GL_INVALID_OPERATION: GL error
GL_INVALID_OPERATION: mismatched type setting uniform "s" in program 1,
"" using shaders, 2, "", 3, ""

- tesssubdivmodes
NVIDIA: no output, and the following error:
GL_INVALID_OPERATION error generated. Wrong component type or count.

- wrapmodes
NVIDIA: wrong output, and the following error:
GL_INVALID_OPERATION error generated. Wrong component type or count.
Several of the examples let the user adjust parameters by means of the
GLFW_KEY_KP_ADD (keypad +) and GLFW_KEY_KP_SUBTRACT (keypad -) keys, but
these keys are not available on keyboards that lack a keypad, e.g. a
number of laptop keyboards and tenkeyless keyboards. As a result, users
of these keyboards can not adjust parameters in those examples.

In order to allow users of said keyboards to adjust the parameters on
those examples, this change modifies onKey() in the following manner:
- Parameter values are decreased by pressing the GLFW_KEY_MINUS key (-)
instead of GLFW_KEY_KP_SUBTRACT (keypad -)
- Parameter values are increased by pressing the GLFW_KEY_EQUAL key (=)
instead of GLFW_KEY_KP_ADD (keypad +). The rationale for this is that,
on US and UK keyboard layout, you hold SHIFT and strike = to type +.
… keypads

Several of the examples let the user adjust parameters by means of the
GLFW_KEY_KP_ADD (keypad +) and GLFW_KEY_KP_SUBTRACT (keypad -) keys, but
these keys are not available on keyboards that lack a keypad, e.g. a
number of laptop keyboards and tenkeyless keyboards. As a result, users
of these keyboards can not adjust parameters in those examples.

In
order to allow users of said keyboards to adjust the parameters on those
examples, this change modifies onKey() in the following manner:
-
Parameter values are decreased, in addition to GLFW_KEY_KP_SUBTRACT
(keypad -), by pressing the GLFW_KEY_MINUS key (-)
- Parameter values
are increased, in addition to GLFW_KEY_KP_ADD (keypad +), by pressing
the GLFW_KEY_EQUAL key (=) . The rationale for this is that, on US and
UK keyboard layouts, you hold SHIFT and strike = to type +.
mattgruenke added a commit to mattgruenke/sb7plus that referenced this pull request Dec 8, 2017
@mattgruenke
Copy link

Thanks for this.

BTW, in my fork, I'm porting these examples to use OGLplus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants