[Mesa-dev] [Bug 107772] Mesa preprocessor matches if(def)s & endifs incorrectly

2018-08-31 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107772

Mark Janes  changed:

   What|Removed |Added

   Assignee|mesa-dev@lists.freedesktop. |t_arc...@yahoo.com.au
   |org |
 Status|NEEDINFO|ASSIGNED
   Keywords||bisected

-- 
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


[Mesa-dev] [Bug 107772] Mesa preprocessor matches if(def)s & endifs incorrectly

2018-08-31 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107772

Ian Romanick  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #3 from Ian Romanick  ---
(In reply to Ian Romanick from comment #1)
> I'll add a piglit test for this.  I cut-and-paste that code into a shader
> (and did 's/[[]ERROR]: [0-9]*: //'), and I get:
> 
> Failed to compile vertex shader bad.vert: 0:30(1): error: syntax error,
> unexpected $end

Which I now realized is due to the shader being empty after preprocessing. 
With the test case below, I cannot reproduce this issue.  I tried a couple
similar things.  Eero: Can you provide a small case that reproduces this?

#version 400 core
#define SV_301
#define highp
#define mediump
#define lowp
#define TYPE_vertex
#define DO_EMISSIVE_AND_AMBIENT 0
#define NUM_COLORS 64
#define NUM_LIGHTS 16
#ifdef TYPE_fragment
#if !DO_EMISSIVE_AND_AMBIENT
#define DO_LOOP_ITERATION(i)
#define DO_2_LOOP_ITERATIONS(i)
#define DO_4_LOOP_ITERATIONS(i)
#define DO_6_LOOP_ITERATIONS(i)
#define DO_8_LOOP_ITERATIONS(i)
#define DO_16_LOOP_ITERATIONS(i)
#endif
#if !DO_EMISSIVE_AND_AMBIENT
#endif
#if DO_EMISSIVE_AND_AMBIENT
#else
#endif
#endif
#ifdef TYPE_vertex
#if !DO_EMISSIVE_AND_AMBIENT
#endif
#if !DO_EMISSIVE_AND_AMBIENT
#endif
#endif

void main()
{
}

-- 
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


[Mesa-dev] [Bug 107772] Mesa preprocessor matches if(def)s & endifs incorrectly

2018-08-31 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107772

--- Comment #2 from Ian Romanick  ---
(In reply to Ian Romanick from comment #1)
> I'll add a piglit test for this.  I cut-and-paste that code into a shader
> (and did 's/[[]ERROR]: [0-9]*: //'), and I get:

And 's/ \\$//'

> Failed to compile vertex shader bad.vert: 0:30(1): error: syntax error,
> unexpected $end

-- 
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


[Mesa-dev] [Bug 107772] Mesa preprocessor matches if(def)s & endifs incorrectly

2018-08-31 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107772

Ian Romanick  changed:

   What|Removed |Added

 CC||i...@freedesktop.org,
   ||t_arc...@yahoo.com.au

--- Comment #1 from Ian Romanick  ---
I'll add a piglit test for this.  I cut-and-paste that code into a shader (and
did 's/[[]ERROR]: [0-9]*: //'), and I get:

Failed to compile vertex shader bad.vert: 0:30(1): error: syntax error,
unexpected $end

-- 
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


[Mesa-dev] [Bug 107772] Mesa preprocessor matches if(def)s & endifs incorrectly

2018-08-31 Thread bugzilla-daemon
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_301
[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