[Mesa-dev] [Bug 29537] New: [glsl2] texture2DLod() should not be accepted by fragment programs

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 12 12:50:06 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=29537

           Summary: [glsl2] texture2DLod() should not be accepted by
                    fragment programs
           Product: Mesa
           Version: git
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
        AssignedTo: mesa-dev at lists.freedesktop.org
        ReportedBy: brian.e.paul at gmail.com


Per the GLSL 1.10 and 1.20 specs:

"""
Section 8.7 Texture Lookup Functions

The built-ins suffixed with “Lod” are allowed only in a vertex shader. For the
“Lod” functions, lod is directly used as the level of detail.
"""

The glsl2 compiler errantly accepts fragment shaders that use the
texture2DLod() function.  This function was added as a frag shader feature
through the GL_ATI_shader_texture_lod extension (undocumented?  google it) but
it's not standard GLSL.

There are some built-in functions that only apply to vertex shaders or fragment
shaders but I don't see how/where the glsl2 compiler makes any distinction.

I'm attaching a piglit shaderrunner test for this but I don't see a way to
indicate to shaderrunner that a shader should NOT compile.

VMware Workstation checks to see if a shader using GL_ATI_shader_texture_lod
and texture2DLod() compiles and tries to use it if successful.  The glsl
compiler allows it but we blow-up/fail later when we try to actually run the
shader.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mesa-dev mailing list