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

"lightPollutionAngularIntegrationPoints" do not match #3

Open
uwes-ufo opened this issue Sep 5, 2022 · 7 comments
Open

"lightPollutionAngularIntegrationPoints" do not match #3

uwes-ufo opened this issue Sep 5, 2022 · 7 comments

Comments

@uwes-ufo
Copy link

uwes-ufo commented Sep 5, 2022

Hello,
I tried to calculate the sample.atmo but got an error - any idea?

$ /c/calcmysky/calcmysky --out-dir sample_atmo ~/git/calcmysky/examples/sample.atmo
OpenGL vendor : Intel
OpenGL renderer: Intel(R) UHD Graphics 620
OpenGL version : 3.3.0 - Build 27.20.100.9749
GLSL version : 3.30 - Build 27.20.100.9749
GL_ARB_shading_language_420pack is supported
Writing parameters to output description file... done
Working on wavelengths 360, 391.333, 422.667, 454 nm (set 1 of 4):
Saving shader "sample_atmo/shaders/zero-order-scattering/0/common-functions.frag"...done
Saving shader "sample_atmo/shaders/zero-order-scattering/0/phase-functions.frag"...done
Saving shader "sample_atmo/shaders/zero-order-scattering/0/render.frag"...done
Saving shader "sample_atmo/shaders/zero-order-scattering/0/texture-coordinates.frag"...done
Saving shader "sample_atmo/shaders/zero-order-scattering/0/texture-sampling-functions.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/common-functions.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/direct-irradiance.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/eclipsed-direct-irradiance.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/phase-functions.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/render.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/texture-coordinates.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/texture-sampling-functions.frag"...done
Computing parts of scattering order 1:
Computing transmittance... done
Saving transmittance texture to "sample_atmo/transmittance-wlset0.f32"... done
Computing direct ground irradiance... done
Computing light pollution single scattering... [WARN] QOpenGLShader::link: ERROR: Initializers for constant global variable "lightPollutionAngularIntegrationPoints" do not match.

Failed to link shader program to compute single scattering of light pollution

@10110111
Copy link
Owner

10110111 commented Sep 5, 2022

Intel GPU driver version 27.20.100.9749 seems quite old, could you try updating it to the latest version? According to this page there is a version from February 2022, while yours is from June 2021.

@uwes-ufo
Copy link
Author

uwes-ufo commented Sep 6, 2022

Intel GPU driver version 27.20.100.9749 seems quite old, could you try updating it to the latest version? According to this page there is a version from February 2022, while yours is from June 2021.

So, I'm back with a new driver...

$ /c/calcmysky/calcmysky --out-dir sample_atmo ~/git/calcmysky/examples/sample.atmo
OpenGL vendor : Intel
OpenGL renderer: Intel(R) UHD Graphics 620
OpenGL version : 3.3.0 - Build 31.0.101.2111
GLSL version : 3.30 - Build 31.0.101.2111
GL_ARB_shading_language_420pack is supported
Writing parameters to output description file... done
Working on wavelengths 360, 391.333, 422.667, 454 nm (set 1 of 4):
Saving shader "sample_atmo/shaders/zero-order-scattering/0/common-functions.frag"...done
Saving shader "sample_atmo/shaders/zero-order-scattering/0/phase-functions.frag"...done
Saving shader "sample_atmo/shaders/zero-order-scattering/0/render.frag"...done
Saving shader "sample_atmo/shaders/zero-order-scattering/0/texture-coordinates.frag"...done
Saving shader "sample_atmo/shaders/zero-order-scattering/0/texture-sampling-functions.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/common-functions.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/direct-irradiance.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/eclipsed-direct-irradiance.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/phase-functions.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/render.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/texture-coordinates.frag"...done
Saving shader "sample_atmo/shaders/eclipsed-zero-order-scattering/0/texture-sampling-functions.frag"...done
Computing parts of scattering order 1:
Computing transmittance... done
Saving transmittance texture to "sample_atmo/transmittance-wlset0.f32"... done
Computing direct ground irradiance... done
Computing light pollution single scattering... [WARN] QOpenGLShader::link: ERROR: Initializers for constant global variable "lightPollutionAngularIntegrationPoints" do not match.

Failed to link shader program to compute single scattering of light pollution

@10110111
Copy link
Owner

10110111 commented Sep 6, 2022

OK, I've found an Intel+Windows machine where this reproduces. Investigating.

@10110111
Copy link
Owner

10110111 commented Sep 6, 2022

This still looks like a driver bug. For now, I've pushed a workaround into intel-windows-experiments branch that you can try. It's not a nice fix, but still should make it work.

@uwes-ufo
Copy link
Author

uwes-ufo commented Sep 6, 2022

...
Finished in 20m12s

Ah, now we have really clear skies!

@10110111
Copy link
Owner

10110111 commented Sep 8, 2022

I've reduced the problem to attempt to link the following 3 shaders:

  • vertex shader:
#version 330
in vec3 vertex;
out vec3 position;
void main()
{
    position=vertex;
    gl_Position=vec4(position,1);
}
  • first fragment shader:
#version 330
const int globalConst=200;

float f()
{
    const float copy=globalConst;
    return copy;
}

void main() {}
  • second fragment shader:
#version 330
const int globalConst=200;

These shaders compile and link successfully on NVIDIA GeForce 750 Ti, as well as on Linux/Mesa-based Intel UHD Graphics 620 (WHL GT2).

But attempt to compile on Windows 11 with Intel HD Graphics 520 and driver 31.0.101.2111 fails with the error «ERROR: Initializers for constant global variable "globalConst" do not match.». This is the same error as reported in this issue.

If I remove const qualifier from the copy variable, the problem doesn't reproduce.

This indeed looks like a bug in the GLSL compiler, so I'm going to report this to Intel. Here is a simple Qt-based project reproducing the problem: compile-and-link.tar.gz

@10110111
Copy link
Owner

OK, so far Intel just refused to look at my bug report based on my location:

Intel complies with all applicable trade regulations and sanctions in the countries in which it operates. Based on Intel’s announcement to cease operations in Russia, I am unable to provide the support requested.

So, if you (the OP or anyone affected) are not in a sanctioned country, and you want to have this issue solved, please report it to Intel. The necessary technical details are in this comment. If any technical questions arise that you cannot answer, ping me and I'll try to help.

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

No branches or pull requests

2 participants