3Dickulus / FragM

Derived from https://github.com/Syntopia/Fragmentarium/
GNU General Public License v3.0
344 stars 30 forks source link

misdetection of ES in shader compatibility patches #158

Closed claudeha closed 3 years ago

claudeha commented 3 years ago

Describe the bug Something is redefining varying to out despite the GLSL version being 1.10 (no #version specified)

To Reproduce Steps to reproduce the behavior:

  1. Create new tab (Unnamed, with 8 balls usually)
  2. Click on Build
  3. See error
Could not create vertex shader: 
Unnamed :27(1): error: `out' qualifier in declaration of `from' only valid for function parameters in GLSL 1.10
Unnamed :29(1): error: `out' qualifier in declaration of `coord' only valid for function parameters in GLSL 1.10
Unnamed :30(1): error: `out' qualifier in declaration of `viewCoord' only valid for function parameters in GLSL 1.10
Unnamed :31(1): error: `out' qualifier in declaration of `viewCoord2' only valid for function parameters in GLSL 1.10
Unnamed :32(1): error: `out' qualifier in declaration of `dir' only valid for function parameters in GLSL 1.10
Unnamed :33(1): error: `out' qualifier in declaration of `Dir' only valid for function parameters in GLSL 1.10
Unnamed :34(1): error: `out' qualifier in declaration of `UpOrtho' only valid for function parameters in GLSL 1.10
Unnamed :35(1): error: `out' qualifier in declaration of `Right' only valid for function parameters in GLSL 1.10
Unnamed :37(1): error: `out' qualifier in declaration of `PixelScale' only valid for function parameters in GLSL 1.10

Looking at the source, frag has varying.

Expected behavior Old frags to keep working...

Desktop (please complete the following information):

Additional context Up to date develop branch. Pull request forthcoming...

claudeha commented 3 years ago

Maybe I got this wrong still: it compiles now, but with Mandelbulb.frag I get a blank black screen with #version 110 (default) and #version 120. #version 130 displays ok...

claudeha commented 3 years ago

They do seem listed in the GLSL versions ("", "120"):

Display using GL 4.6 Core profile
GLSL versions: 300 es, 310 es, 320 es, , 120, 130, 140, 150, 330, 400, 410, 420, 430, 440, 450, 460
Shaders that do not include a #version directive will be treated as targeting GLSL version 110
3Dickulus commented 3 years ago

there is an option in Edit/Preferences to turn off the application of compatibility patches

3Dickulus commented 3 years ago

something wrong with your info lines...

Display using GL 4.5 Core profile

GLSL versions: 100, 120, 130, 140, 150, 300 es, 310 es, 320 es, 330, 400, 410, 420, 430, 440, 450, 460
Shaders that do not include a #version directive will be treated as targeting GLSL version 110

it should be formatted this way, yours shows blank , , where 110 should be and no 100?

3Dickulus commented 3 years ago

Vendor: NVIDIA Corporation Renderer: GeForce GTX 760/PCIe/SSE2 GL Driver: 4.5.0 NVIDIA 455.23.05

  1. Create new tab (Unnamed, with 8 balls usually)
  2. Click on Build
  3. No errors, compiles under all versions + ES