Giter Site home page Giter Site logo

line pragmas break on Mesa about fragm HOT 7 CLOSED

3dickulus avatar 3dickulus commented on July 28, 2024
line pragmas break on Mesa

from fragm.

Comments (7)

3Dickulus avatar 3Dickulus commented on July 28, 2024

huh :-/

I get log lines like this...
/home/Fragmentarium/test.frag(130) : warning C7011: implicit cast from "int" to "float"

edit: maybe the quotes? follow with empty line before #ifdef line ?? nVidia only ???

from fragm.

3Dickulus avatar 3Dickulus commented on July 28, 2024

quote from https://www.khronos.org/opengl/wiki/Core_Language_(GLSL)#.23line_directive

#line directive

The #line directive allows you to change the current FILE and LINE values

from fragm.

claudeha avatar claudeha commented on July 28, 2024

I already quoted a bit from there. It only supports string numbers, not filenames, at least per the spec, which Mesa adheres to (NVIDIA is too lenient, leading to breakage elsewhere...).

I have some patches that print out a filename map before error messages with string numbers:

0 -> Unnamed
1 -> /home/claude/opt/fragm/glm/Fragmentarium-2.5.0/Examples/Include/MathUtils.frag
2 -> /home/claude/opt/fragm/glm/Fragmentarium-2.5.0/Examples/Include/DE-Raytracer.frag
3 -> /home/claude/opt/fragm/glm/Fragmentarium-2.5.0/Examples/Include/3D.frag
Could not create fragment shader: 0:6(40): error: syntax error, unexpected FLOATCONSTANT, expecting ')' or ','

So this error occured in an Unnamed (unsaved) frag. Fixing it and adding an error in DE-Raytracer.frag gives

0 -> Unnamed
1 -> /home/claude/opt/fragm/glm/Fragmentarium-2.5.0/Examples/Include/MathUtils.frag
2 -> /home/claude/opt/fragm/glm/Fragmentarium-2.5.0/Examples/Include/DE-Raytracer.frag
3 -> /home/claude/opt/fragm/glm/Fragmentarium-2.5.0/Examples/Include/3D.frag
Could not create fragment shader: 2:15(1): error: syntax error, unexpected NEW_IDENTIFIER, expecting $end

which I hope is better than nothing (or the total breakage from using filenames).

from fragm.

3Dickulus avatar 3Dickulus commented on July 28, 2024

quote from https://www.khronos.org/opengl/wiki/Core_Language_(GLSL)#.23line_directive

#line directive
The #line directive allows you to change the current FILE and LINE values

a string is a string is a string so shouldn't matter if it's numbers or letters (but apparently it does)

If you are using nVidia gfx card I highly recomend using the nVidia driver, the installer builds a kernel module from source with a bit of proprietary stuff thrown in, using any other driver will not let you enjoy the full power of the gfx card and imho will always have problems. This is why I'm not really actively supporting anything other than manufacturers officially released drivers or hardware that doesn't support at least GL 4.0

from fragm.

claudeha avatar claudeha commented on July 28, 2024

full quote of that section, as you didn't pay attention to the part I quoted already:

#line directive

The #line directive allows you to change the current __FILE__ and __LINE__ values, and is different from C. It has the forms:

#line line

#line line source-string-number

The line after the #line directive in the source will be set to the give line number. For example, if you have "#line 4" on one line and "error" on the next, then "error" will be on line 4 if it is an error. The #line directive does not support source files as in C.

(my emphasis)

from fragm.

3Dickulus avatar 3Dickulus commented on July 28, 2024

nVidia driver/compiler has no problems with this (GL>4)

I have a working version that uses numbers as index into filename list and puts the correct filename in the log, should work for AMD too.

from fragm.

claudeha avatar claudeha commented on July 28, 2024

nVidia driver/compiler is known to accept out-of-spec input, which leads to issues everywhere else.

looking forward to test your fixes!

from fragm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.