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

Clarify sampler type matching rules #3658

Open
lexaknyazev opened this issue May 29, 2024 · 0 comments
Open

Clarify sampler type matching rules #3658

lexaknyazev opened this issue May 29, 2024 · 0 comments
Assignees

Comments

@lexaknyazev
Copy link
Member

The current text says:

Texture lookup functions return values as floating point, unsigned integer or signed integer, depending on the sampler type passed to the lookup function. If the wrong sampler type is used for texture access, i.e., the sampler type does not match the texture internal format, the returned values are undefined in OpenGL ES Shading Language 3.00.6. In WebGL, generates an INVALID_OPERATION error in the corresponding draw call, including drawArrays, drawElements, drawArraysInstanced, drawElementsInstanced , and drawRangeElements.

If the sampler type is floating point and the internal texture format is normalized integer, it is considered as a match and the returned values are converted to floating point in the range [0, 1].

  • The first part should mention shadow samplers, i.e.,

    • a shadow sampler cannot be used with a non-depth texture;
    • a shadow sampler cannot be used with a depth texture when its compare mode is none;
    • a non-shadow sampler cannot be used with a depth texture when its compare mode is not none.
  • The second statement should mention that the range is [0, 1] for unsigned normalized and [-1, 1] for signed normalized texture formats.

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

No branches or pull requests

1 participant