10110111 / CalcMySky

Simulator of light scattering by planetary atmospheres
GNU General Public License v3.0
29 stars 7 forks source link

"lightPollutionAngularIntegrationPoints" do not match #3

Open uwes-ufo opened 2 years ago

uwes-ufo commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

10110111 commented 2 years ago

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 commented 2 years ago

... Finished in 20m12s

Ah, now we have really clear skies!

10110111 commented 2 years ago

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

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](https://github.com/10110111/CalcMySky/files/9529784/compile-and-link.tar.gz)
10110111 commented 2 years ago

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.