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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Aug 31 16:00:25 UTC 2018


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

Ian Romanick <idr at freedesktop.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Ian Romanick <idr at freedesktop.org> ---
(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_30    1
#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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180831/9cfcbdd8/attachment.html>


More information about the mesa-dev mailing list