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

[glsl-in] Incorrect array index calculation #6596

Open
magcius opened this issue Nov 23, 2024 · 0 comments
Open

[glsl-in] Incorrect array index calculation #6596

magcius opened this issue Nov 23, 2024 · 0 comments
Labels
area: naga back-end Outputs of naga shader conversion lang: GLSL OpenGL Shading Language naga Shader Translator type: bug Something isn't working

Comments

@magcius
Copy link
Contributor

magcius commented Nov 23, 2024

Description
naga uses an i32() cast to convert from the floating-point array index specified in the texcoord vector to an integer array texture. However, the GL specification says that round-nearest-even should be used: https://registry.khronos.org/OpenGL/specs/gl/glspec46.core.pdf#page=281

Repro steps
This is visible in the output of samplers.frag.wgsl in the test suite:

let _e34 = coord_9;
let _e38 = textureSample(tex2DArray, samp, _e34.xy, i32(_e34.z));

@teoxoy teoxoy added type: bug Something isn't working area: naga back-end Outputs of naga shader conversion naga Shader Translator lang: GLSL OpenGL Shading Language labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga back-end Outputs of naga shader conversion lang: GLSL OpenGL Shading Language naga Shader Translator type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants