Summary: | piglit spec_glsl-1.10_compiler_literals_invalid-float-suffix-capital-f.vert fails | ||
---|---|---|---|
Product: | Mesa | Reporter: | lu hua <huax.lu> |
Component: | glsl-compiler | Assignee: | Lars Hamre <chemecse> |
Status: | RESOLVED FIXED | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | christophe.prigent |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
lu hua
2014-07-21 06:06:30 UTC
The "f" suffix on floats was added in 1.20. Before accepting a change in behavior, I'd like to know what other implementations do. If this test also fails on NVIDIA and AMD, I'd rather remove the test. That would imply there's a good chance that applications may rely on the behavior. It's also not clear whether this was intended to be new feature of GLSL 1.20 or just a correction. It is called out in the changes section along with other new features, so I guess it's a new feature? "Changes from revision 60 of version 1.10 • Accept "f" as part of a floating-point constant. E.g. "float g = 3.5f"." Using the f suffix on NVidia's proprietary driver version 340.46 with #version 110 gives the following error: error C7502: OpenGL does not allow type suffix 'f' on constant literals in versions below 120 However, if I leave out the #version line entirely then the error becomes a warning and it successfully compiles. The Piglit test doesn't specify the #version line so I guess it would fail on NVidia's driver too. (In reply to Neil Roberts from comment #2) > Using the f suffix on NVidia's proprietary driver version 340.46 with > #version 110 gives the following error: > > error C7502: OpenGL does not allow type suffix 'f' on constant literals in > versions below 120 > > However, if I leave out the #version line entirely then the error becomes a > warning and it successfully compiles. The Piglit test doesn't specify the > #version line so I guess it would fail on NVidia's driver too. The GLSL spec says "shaders that do not include a #version directive will be treated as targeting version 110". I think NVidia operates in some relaxed mode when #version is missing. (In reply to Matt Turner from comment #3) > (In reply to Neil Roberts from comment #2) > > Using the f suffix on NVidia's proprietary driver version 340.46 with > > #version 110 gives the following error: > > > > error C7502: OpenGL does not allow type suffix 'f' on constant literals in > > versions below 120 > > > > However, if I leave out the #version line entirely then the error becomes a > > warning and it successfully compiles. The Piglit test doesn't specify the > > #version line so I guess it would fail on NVidia's driver too. > > The GLSL spec says "shaders that do not include a #version directive will be > treated as targeting version 110". I think NVidia operates in some relaxed > mode when #version is missing. That's correct. Without a #version, NVIDIA treats the shader as if it specified the highest supported version, but offers some warnings for post-1.10 functionality. Based on this information, I think it's probably okay to strictly follow the spec by rejecting the F suffix in 1.10 shaders. Fixed by: commit 6773128bbf8703663ed1a4d6c1c3308b3c002a35 Author: Lars Hamre <chemecse@gmail.com> Date: Mon Mar 28 20:42:14 2016 -0400 glsl: invalidate float suffixes for GLSL 1.10 and GLSL ES 1.00 Float suffixes are not allowed in GLSL 1.10 nor GLSL ES 1.00. Fixes the following piglit tests: tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-capital-f.vert tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-f.vert` v2: modify error message v3: parse the float instead of returning an ERROR_TOK v4: (by Ken) Change to is_version(120, 300) to avoid breaking ES3 shaders; update commit message accordingly. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81585 Signed-off-by: Lars Hamre <chemecse@gmail.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.