[glsl-in] Incorrect array index calculation #6596
Labels
area: naga back-end
Outputs of naga shader conversion
lang: GLSL
OpenGL Shading Language
naga
Shader Translator
type: bug
Something isn't working
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:
wgpu/naga/tests/out/wgsl/samplers.frag.wgsl
Lines 415 to 416 in c54a159
The text was updated successfully, but these errors were encountered: