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

            Bug ID: 107772
           Summary: Mesa preprocessor matches if(def)s & endifs
                    incorrectly
           Product: Mesa
           Version: git
          Hardware: Other
                OS: All
            Status: NEW
          Keywords: regression
          Severity: normal
          Priority: medium
         Component: glsl-compiler
          Assignee: mesa-dev@lists.freedesktop.org
          Reporter: eero.t.tammi...@intel.com
        QA Contact: intel-3d-b...@lists.freedesktop.org

Mesa started to give bogus error:
  0:10(1): preprocessor error: Unterminated #if

for GfxBench ALU2 test shader between these commits:
2018-08-29 17:51:11 8fb966688b: st/mesa: Disable blending for integer formats
2018-08-30 16:41:50 d9cf4308ce: i965/screen: Allow modifiers on sRGB formats

Test-case:
* bin/testfw_app --gfx glfw --gl_api desktop_core --width 1920 --height 1080
--test_id gl_alu2

GfxBench is proprietary, so I can't provide whole shader, but these are the
pre-processor directive lines from the failing shader:
-----------------------------------
[ERROR]: 1: #version 400 core
[ERROR]: 2: #define SV_30    1
[ERROR]: 3: #define highp
[ERROR]: 4: #define mediump
[ERROR]: 5: #define lowp
[ERROR]: 6: #define TYPE_vertex
[ERROR]: 7: #define DO_EMISSIVE_AND_AMBIENT 0
[ERROR]: 8: #define NUM_COLORS 64
[ERROR]: 9: #define NUM_LIGHTS 16
[ERROR]: 10: #ifdef TYPE_fragment
[ERROR]: 20: #if !DO_EMISSIVE_AND_AMBIENT
[ERROR]: 25: #define DO_LOOP_ITERATION(i) \
[ERROR]: 46: #define DO_2_LOOP_ITERATIONS(i) \
[ERROR]: 50: #define DO_4_LOOP_ITERATIONS(i) \
[ERROR]: 54: #define DO_6_LOOP_ITERATIONS(i) \
[ERROR]: 58: #define DO_8_LOOP_ITERATIONS(i) \
[ERROR]: 62: #define DO_16_LOOP_ITERATIONS(i) \
[ERROR]: 66: #endif
[ERROR]: 69: #if !DO_EMISSIVE_AND_AMBIENT
[ERROR]: 71: #endif
[ERROR]: 76: #if DO_EMISSIVE_AND_AMBIENT
[ERROR]: 85: #else
[ERROR]: 104: #endif
[ERROR]: 106: #endif
[ERROR]: 108: #ifdef TYPE_vertex
[ERROR]: 112: #if !DO_EMISSIVE_AND_AMBIENT
[ERROR]: 115: #endif
[ERROR]: 120: #if !DO_EMISSIVE_AND_AMBIENT
[ERROR]: 122: #endif
[ERROR]: 125: #endif
-----------------------------------

One should also be able to reproduce this with the GUI-only free version of
GfxBench v4 from gfxbench.com, but I haven't tested that.

(No other tests we run were affected.)

I haven't bisected this, but the most likely candidate looks this:
  28a3731e3f: glsl: skip stringification in preprocessor if in unreachable
branch

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to