Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup: Removed unsupported floating-point suffix prior to GLSL ES 3.00 #11985

Merged
merged 1 commit into from Sep 15, 2023

Conversation

daschuer
Copy link
Member

This fixes the issue reported here:
#11982

warning [Main] QOpenGLShader::compile(Fragment): ERROR: 0:7: '0.75f' : Floating-point suffix unsupported prior to GLSL ES 3.00
ERROR: 0:7: '0.75f' : syntax error

@daschuer daschuer added this to the 2.4.0 milestone Sep 15, 2023
Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Swiftb0y Swiftb0y merged commit d49c6a5 into mixxxdj:2.4 Sep 15, 2023
10 checks passed
@JoergAtGithub
Copy link
Member

JoergAtGithub commented Sep 15, 2023

Now Angle works when I add precision highp float; (with the black spinnies reported in #11930 - this means this is a 2.4 bug and not a Qt6 regression). But than the normal OpenGL operation is broken. Mixxx asserts before the main window is shown:

warning [Main] QOpenGLShader::compile(Fragment): ERROR: 0:5: '' :  syntax error, unexpected IDENTIFIER
ERROR: 1 compilation errors.  No code generated.


warning [Main] *** Problematic Fragment shader source code ***
#ifdef GL_KHR_blend_equation_advanced
#extension GL_ARB_fragment_coord_conventions : enable
#extension GL_KHR_blend_equation_advanced : enable
#endif
#define lowp
#define mediump
#define highp
#line 1

uniform highp vec4 color;
varying highp float vgradient;
precision highp float;
void main()
{
    float minAlpha = 0.5 * color.w;
    float maxAlpha = 0.83 * color.w;
    gl_FragColor = vec4(color.xyz, mix(minAlpha, maxAlpha, max(0.,vgradient)));
}

***
DEBUG ASSERT: "addShaderFromSourceCode( GLShader::Fragment, fragmentShaderCode)" in function void __cdecl mixxx::Shader::load(const class QString &,const class QString &) at C:\Users\Joerg.WORLDWARTWEB\source\repos\JoergAtGithub\mixxx\src\shaders\shader.cpp:24

@JoergAtGithub
Copy link
Member

I found out, that we need to specify
precision highp float;
when using OpenGL ES, but not when using normal OpenGL.

@daschuer
Copy link
Member Author

Yes, that's clear. But In my tests the Qt boilerplate Code defined highp away. Why does this fail in your case?

@daschuer
Copy link
Member Author

Ah I see it is the added:
precision highp float;
This does not work along with
#define highp
It will become
precision float;
and fails.

@Swiftb0y
Copy link
Member

yeah, so I guess we can't specify the precision via the default precision precision-qualifier​ type​; but instead need to specify it manually for every variable so it gets #defined away properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants