[Bug 82921] New: layout(location=0) emits error >= MAX_UNIFORM_LOCATIONS due to integer underflow

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 21 13:49:04 PDT 2014


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

          Priority: medium
            Bug ID: 82921
          Assignee: idr at freedesktop.org
           Summary: layout(location=0) emits error >=
                    MAX_UNIFORM_LOCATIONS due to integer underflow
        QA Contact: intel-3d-bugs at lists.freedesktop.org
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: kam1kaz3 at gmail.com
          Hardware: Other
            Status: NEW
           Version: git
         Component: glsl-compiler
           Product: Mesa

I have a

layout(location=0) uniform sampler2D diffuseTex;

in my shader, and it fails to compile with error:
"location(s) consumed by uniform diffuseTex >= MAX_UNIFORM_LOCATIONS (65536)".

I think this is because of this line in ast_to_hir.cpp:
> unsigned max_loc = qual->location + var->type->uniform_locations() - 1;

If "var->type->uniform_locations()" returns zero and qual->location is zero, we
have an integer underflow, and therefore the following checks will fail.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20140821/673c1fb6/attachment.html>


More information about the intel-3d-bugs mailing list