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

Can't run Godot OpenGL 3 on ATI Radeon HD 3650 since shader cache addition #78888

Closed
gagupa opened this issue Jun 30, 2023 · 9 comments · Fixed by #85273
Closed

Can't run Godot OpenGL 3 on ATI Radeon HD 3650 since shader cache addition #78888

gagupa opened this issue Jun 30, 2023 · 9 comments · Fixed by #85273

Comments

@gagupa
Copy link

gagupa commented Jun 30, 2023

Godot version

4.1 (many ver.)

System information

Windows 10 - 4.1 (many ver.) - OpenGL 3.3 compatibility

Issue description

I installed several versions of godot to test, as I have a very old computer.
i don't know if this is a BUG, or just my OLD Hardware be incompatible.

HARDWARE:
intel q6600 quadcore, 4gb ram, windows 10(last update), ATI Radeon HD 3650 - 512mb VRAM.

OpenGL Extensions Viewer 6.4.1.1:
OpenGL Version 3.3 (3.3.11672 core profile forward-compatible context)
Driver Version: 8.970.100.9001 (13-jan-15)
DirectX: 10.1, 9
Shader model: 4.1
Vulkan: N/A

VERSIONS TESTED and WORK fine:
3.5.2stable_win64 -> OK (NO extra cmds prompt needed)
3.6beta2_win64 -> OK (NO extra cmds prompt needed)
4.0.3stable_win64 -> OK with some errors but work
4.1-dev1_win64 -> OK with some error but work (see image TOP)

VERSIONS TESTED and ALL THAT NOT WORK:
4.1-beta1_win64 -> don't launch
4.1-beta2_win64 -> don't launch
4.1-beta3_win64 -> don't launch
4.1-dev2_win64 -> don't launch
4.1-dev3_win64 -> don't launch
4.1-dev4-win64 -> don't launch
4.1-rc1_win64 -> don't launch
4.1-rc2_win64 -> don't launch (see image Bottom)

  • ALL 4.x i have used (--rendering-driver opengl3 --rendering-method gl_compatibility)

I would really like to use the latest version (4.1rc2) and later/future the 4.1 stable , but I couldn't get last version it to work at all, not even loading a project directly into the editor.

i have a screenshot showing the las lines of prompt (top is working "4.1_dev1", botton don't work "4.1_rc2)
Screenshot-1

if you need any LOG or other file with details, please let me know which one, and how preferably.

Steps to reproduce

I don't know what to put here, I explained the best way possible in the description of the problem.

Minimal reproduction project

N/A

@bitsawer
Copy link
Member

That is indeed a pretty old GPU, looks like from around 2008. Driver quality and support for this old cards can be pretty spotty, but if it worked previously it might be worth checking out if Godot GLES3 code does something wrong or if we just hit a driver bug with some change.

If things (mostly) worked in 4.1-dev1_win64 and stopped working in 4.1-dev2_win64, the change is possibly something in this list: https://godotengine.github.io/godot-interactive-changelog/#4.1-dev2 There are a few OpenGL / GLES3 changes there that could potentially cause this.

I assume that even the Godot project manager doesn't start when using the newer Godot releases, and not just your project? You can post the log here as file attachments by drag and dropping, you can usually find the most recent log files in %APPDATA%\Godot\app_userdata\[project_name]\logs. It would be interesting to see that full shader code error.

@gagupa
Copy link
Author

gagupa commented Jul 1, 2023

As there were many files from many different versions, I deleted all the contents of the folder "%APPDATA%\Godot\app_userdata[project_name]\logs" to do a clean test.

Then I started "Godot_v4.1-rc2_win64" to see exactly what files it created there, and to my surprise, no LOG file was created, just 2 files in the following folders "shader_cache > CopyShaderGLES3" and "shader_cache > SceneShaderGLES3" .

Also several empty folders were created, but no other files and nothing from the LOG.

Because of this, I did a test and directed/pipe the output of the executable to a text file:
Godot_v4.1-rc2_win64.exe --rendering-driver opengl3 --rendering-method gl_compatibility --verbose >> Godot_v4.1-rc2_win64-LAUNCH_LOG.txt
Godot_v4.1-rc2_win64-LAUNCH_LOG.txt

I did the same process above with all the other 4.1*** versions, and they all generated just the same 2 files mentioned above.

---> The Only One that work:
The only exception was even in "Dev1", where the folder "shader_cache" WAS NOT CREATED, and it loaded normally, and created the files "editor_settings-4.tres" and "projects.cfg"

I believe it has something to do with that.
And Analyzing the modifications in "Dev2" of the link that you passed, there was indeed some change precisely in the creation of the CACHE OF OpenGL: "Add shader cache to GLES3" submitted as GH-76092.

As no LOG file was created too, I did the same above and directed the output to a text file:
Godot_v4.1-dev1_win64.exe --rendering-driver opengl3 --rendering-method gl_compatibility --verbose >> Godot_v4.1-dev1_win64-LAUNCH_LOG.txt
Godot_v4.1-dev1_win64-LAUNCH_LOG.txt

--->

But for now, I'll keep studying and learning on 4.1-dev1 maybe on 4.0.3 stable, until I can buy a better Video Card.

I appreciate your attention @bitsawer, because I didn't know where the godot folders/files were, and I didn't even know the github changelog, thank's.

===> NEW EDITED <===
because the generated file has "line numbers" of the source codes, I am sending 2 new files WITHOUT the line numbers, THIS FACILITATED a lot to compare the files, which do not have significant differences that indicate the possible error.
Godot_v4.1-dev1_LAUNCH_PIPE.txt
Godot_v4.1-rc2_LAUNCH_PIPE.txt

@akien-mga akien-mga changed the title some 4.1 versions don't launch Can't run Godotnm OpenGL 3 on ATI Radeon HD 3650 since shader cache addition Jul 1, 2023
@akien-mga akien-mga changed the title Can't run Godotnm OpenGL 3 on ATI Radeon HD 3650 since shader cache addition Can't run Godot OpenGL 3 on ATI Radeon HD 3650 since shader cache addition Jul 1, 2023
@akien-mga akien-mga added this to the 4.2 milestone Jul 1, 2023
@akien-mga
Copy link
Member

Thanks for the logs and the investigation, that's pretty good. It seems likely indeed that the shader cache is what doesn't work on your hardware.

There seems to be shader errors both in 4.1-dev1 and in later builds, but somehow those errors didn't prevent rendering things in dev 1. They might however be considered critical for saving/loading the shader cache?

Or maybe the shader cache relies on a core OpenGL function, or an extension, which is not properly implemented on your drivers.

CC @clayjohn @ChibiDenDen

@bitsawer
Copy link
Member

bitsawer commented Jul 1, 2023

If someone can do and host a custom build with those GLES3 commits reverted, it could be pretty easy to test if they are the cause of the regression.

Also, looks like the two shader compiler error line numbers in the screenshot match these lines:

uniform uint omni_light_indices[MAX_FORWARD_LIGHTS];

uniform uint spot_light_indices[MAX_FORWARD_LIGHTS];

Looks like the shader compiler seems to think that MAX_FORWARD_LIGHTS

#define MAX_FORWARD_LIGHTS uint(8)

is not a constant integer expression, maybe it thinks it's cast/scalar constuctor or something? Possible driver shader compiler bug/difference? I wonder if changing it and some loop variables using it to 8 or 8u would fix some compile issues? Other similar defines in the log seem to use normal integers. Probably not related to this issue, but an interesting observation.

@ChibiDenDen
Copy link
Contributor

I cant see in the logs (they are truncated) why would the shader cache fail here.
But I can only assume that some specializations are pushed to the dictionary despite not being fully built (as seen by the failure)
perhaps adding a check for spec->ok in line 623 in _save_to_cache could solve this...

instead of:

if (specialization == nullptr) {

try this:

if (specialization == nullptr || !specialization->ok) {

regardless, like @bitsawer said, there is some issue compiling the shader which causes this weird state to begin with.
I could try to force this behavior myself but it would be best for someone with access to the hardware that has issues to check it as well.

@akien-mga
Copy link
Member

There should be improvements for this type of hardware in Godot 4.2, as we now integrated ANGLE as an alternative to the native OpenGL drivers which are often buggy on Windows for those old chipsets.

Could you test and let us know whether it works?

I'm not sure if it would pick up ANGLE by default, so you might have to pass --rendering-driver opengl3_angle on the command line explicitly for it to be used. Let us know whether it's picked up automatically or needs to be specified manually, we might be able to add some logic to make sure ANGLE is used on this hardware.

@akien-mga akien-mga modified the milestones: 4.2, 4.3 Nov 15, 2023
@rovecone
Copy link

I have tested the changes on ATI Radeon HD 4870 graphics card with success. Passed --rendering-driver opengl3_angle on the command line to start Godot v4.2-rc1 (win64). It started successfully without giving any errors. Running any scene gave the following usual error:

ERROR: SceneShaderGLES3: Fragment shader compilation failed:
Fragment shader failed to compile with the following errors:
ERROR: 0:442: error(#185) Array size must be a constant integer expression
ERROR: 0:452: error(#185) Array size must be a constant integer expression
ERROR: error(#273) 2 compilation errors. No code generated
at: _display_error_with_code (drivers/gles3/shader_gles3.cpp:252)
ERROR: Method/function failed.
at: _compile_specialization (drivers/gles3/shader_gles3.cpp:394)

Went to Project Settings > Toggled "Advanced Settings" to ON. Rendering > GL Compatibility > Changed the driver to opengl3_angle for my platform (Windows). Restarted Godot and the scene ran successfully. Thanks for all the improvements and changes.

@akien-mga
Copy link
Member

Thanks for testing!

So we still need to add more heuristics to detect this type of card and default to opengl3_angle out of the box. CC @bruvzg

@bruvzg
Copy link
Member

bruvzg commented Nov 23, 2023

These GPUs are a bit too old even for ANGLE (not fully supporting DX11), so some stuff might be still broken.

Based on other reports, I think we can safely force ANGLE on everything pre GCN 4th gen.

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

Successfully merging a pull request may close this issue.

8 participants