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

GPUParticles not rendered in Web Export or Windows ANGLE with AMD Radeon RX Vega 6-7 GPU #95797

Closed
Maran23 opened this issue Aug 19, 2024 · 24 comments · Fixed by #96413
Closed

Comments

@Maran23
Copy link
Contributor

Maran23 commented Aug 19, 2024

Tested versions

  • Reproducable in Godot 4.3.dev6 -> Godot 4.3

System information

Windows 10, AMD Ryzen 5 4500U (GPU: AMD Radeon RX Vega 6 (Ryzen 4000/5000))

Issue description

EDIT:
Solution 1

I found a settings in Chrome that actually fixes the GPUParticles: (chrome://flags/)
image
This is set to Default,- if it is set to OpenGL, everything works. If it is set to D3D11 or D3D11on12, it doesn't for the below mentioned AMD hardware combinations.

As also written in the description, D3D11 seems to be used as the default for most Windows machines, but it will break GPUParticles for some hardware combinations.

Solution 2

Turning off graphic acceleration in Google Chrome fixes the issue as well (although GPUParticles will lag now)
image


  • After testing my game on different Hardware, there seems to be a problem with AMD GPUs when rendering GPUParticles on a Web Build.
  • The Browser doesn't matter, it doesn't work with every Browser (Edge, Chrome, Firefox)
  • There are no errors in the console
  • There is still the typical particle render lag the first time it should be shown, but nothing is rendered

GPUParticles are not rendered in a Web Build for the following Hardware:

CPU: AMD Ryzen 5 4500U
Integrated GPU: AMD Radeon RX Vega 6
CPU: AMD Ryzen 5 5600U
Integrated GPU: AMD Radeon RX Vega 7
CPU: AMD Ryzen 7 5825U
Integrated GPU: AMD Radeon RX Vega 8 

This combination however works:

CPU: AMD Ryzen 7 5700U
Integrated GPU: AMD Radeon RX Vega 8

The native binary works and renders the GPUParticles (which uses Forward+ (Vulkan)).

It seems that every other Hardware works as of now.
Tested with Intel (iGPU) and Nvidia GPU.

If there is anything I can try, let me know.

Steps to reproduce

  • Open the project, particles should not visible in the editor, also when running

OR

Minimal reproduction project (MRP)

ParticleBug.zip
OR
Open and run in your Browser: https://maran23.itch.io/space-heist

@Maran23 Maran23 changed the title GPUParticles not rendered in Web Export with AMD Radeon RX Vega GPU GPUParticles not rendered in Web Export with AMD Radeon RX Vega 6-7 GPU Aug 19, 2024
@Maran23 Maran23 changed the title GPUParticles not rendered in Web Export with AMD Radeon RX Vega 6-7 GPU GPUParticles not rendered in Web Export with AMD Radeon RX Vega 6-7 GPU Aug 19, 2024
@akien-mga
Copy link
Member

Are all these GPUs on Windows machines? Do they all run the latest AMD drivers?

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 19, 2024

Are all these GPUs on Windows machines? Do they all run the latest AMD drivers?

Yes.
I just updated the issue, I found a solution for the problem. It looks like it has something to do with the ANGLE graphics backend used in Chrome (and probably other browsers as well).

@clayjohn
Copy link
Member

Could you test those same devices but using the ANGLE backend on desktop? We support running ANGLE natively by setting rendering/gl_compatibility/driver.windows to opengl3_angle

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 20, 2024

Could you test those same devices but using the ANGLE backend on desktop? We support running ANGLE natively by setting rendering/gl_compatibility/driver.windows to opengl3_angle

Just tested and it is indeed also broken on 'native' Windows when switch to opengl3_angle.
image

@akien-mga akien-mga changed the title GPUParticles not rendered in Web Export with AMD Radeon RX Vega 6-7 GPU GPUParticles not rendered in Web Export or Windows ANGLE with AMD Radeon RX Vega 6-7 GPU Aug 20, 2024
@ollie-d
Copy link

ollie-d commented Aug 21, 2024

I just wanted to add that CPUparticles are also broken for me on web exports. Both CPU and GPU particles render fine on web export in 4.2.2, but neither render at all on 4.3. Doesn't work on Firefox or Chrome.

Processor: i7-12700K
GPU: AMD RX 6900 XT
OS: Windows 11 Pro, Build 22631

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 22, 2024

I can confirm that it works on Godot 4.2.2 with the complete same setup. So it must be some kind of regression in Godot 4.3 in combination with ANGLE and AMD it looks like.

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 27, 2024

It broke in 4.3.dev6. It worked before.

@akien-mga
Copy link
Member

Would you be able to bisect between 4.3.dev5 (89f70e9) and 4.3.dev6 (64520fe)?

@akien-mga akien-mga added this to the 4.4 milestone Aug 27, 2024
@Maran23
Copy link
Contributor Author

Maran23 commented Aug 27, 2024

Would you be able to bisect between 4.3.dev5 (89f70e9) and 4.3.dev6 (64520fe)?

Yes, we are already bisecting now! :)
On a side note, the axis lines also disappeared in that version. So it's not just Particles it looks like. (Show Origin is turned on, worked in Godot 4.2.2 as well)

image

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 28, 2024

Bisected to 4df39dc
Broken by: #88816
cc @joined72

I can help on testing a possible fix.

@akien-mga
Copy link
Member

CC @Alex2782 @clayjohn

@Alex2782
Copy link
Contributor

Alex2782 commented Aug 28, 2024

I think PR #88816 was only there to prevent the project from crashing on Android - Adreno 3xx, the GPU particles are invisible / not possible there either.

ERR_FAIL_COND_MSG(GLES3::Config::get_singleton()->disable_particles_workaround, "Due to driver bugs, GPUParticles are not supported on Adreno 3XX devices. Please use CPUParticles instead.");


On a side note, the axis lines also disappeared in that version. So it's not just Particles it looks like. (Show Origin is turned on, worked in Godot 4.2.2 as well)

gpuparticles.zip

We need a MRP first, does GPUParticles node still need to have certain settings?
It is not reproducible on my Windows11 Mini-PC with an AMD CPU/GPU. Angle version etc. could perhaps also be important. What exactly do you see displayed? @Maran23

Screenshot

image

OpenGL API OpenGL ES 3.0.0 (ANGLE 2.1.1 git hash: 468fcbe033fa) - Compatibility - Using Device: Google Inc. (AMD) - ANGLE (AMD, AMD Radeon 780M Graphics (0x000015BF) Direct3D11 vs_5_0 ps_5_0, D3D11-32.0.11029.1008)

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 28, 2024

We need a MRP first, does GPUParticles node still need to have certain settings? It is not reproducible on my Windows11 Mini-PC with an AMD CPU/GPU. Angle version etc. could perhaps also be important. What exactly do you see displayed?

Forgot to attach the project we were using when bisecting, thanks. Did now.
But there are no special settings, just a plain GPUParticles2D will do.

Angle version etc. could perhaps also be important.

I used the newest release in https://github.com/godotengine/godot-angle-static

What exactly do you see displayed?

Nothing, all particles are not visible at all.

Note that I can not reproduce it on my AMD machine either with AMD Ryzen 9 5900X and AMD Radeon RX 6900 XT.

I will hopefully do some more tests later, e.g. partially reverting the changes. But I always need the help of my friend to test as he can only reproduce it. So it may take a while. :D

@Alex2782
Copy link
Contributor

Angle version etc. could perhaps also be important. What exactly do you see displayed?

Nothing, all particles are not visible at all.

I mean this informations (Screenshot: Godot Editor - Output Tab)
Please share, maybe important :-) ANGLE version etc.

image

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 29, 2024

with yesterdays' master:

image

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 29, 2024

Also note that the mentioned PR did change stuff in the glsl files and the other similar issue #96030 which was closed as duplicate has some interesting information as well:

In the specified Godot 4.3 versions, CPUParticles2D and GPUParticles2D nodes' particles do not render at all on web export, unless given a shader that overrides their COLOR. For example, this would suffice to fix it:

On web, they now also render, though their color information appears to be wrong: white particles show up magenta, and yellow particles show as red. It appears that the green channel appears to be constantly zero.
My theory is that the alpha channel is also constantly zero, which would explain why the particles are invisible with the default shader.

Looking at this information, maybe the changes broke something with the colors in general for older AMD GPUs. Thats why it is not visible.

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 29, 2024

Reverting all changes in the stdlib_inc.glsl (stdlib_inc.glsl) makes the particles work again.

But I'm not familiar with the godot_un/pack methods there. (diff)
Maybe @clayjohn has an idea?

@Alex2782
Copy link
Contributor

Alex2782 commented Aug 29, 2024

Do they all run the latest AMD drivers?

The AMD Ryzen 7 5700U is a mobile processor with 8 cores, launched in January 2021

image

D3D11-32.0.11029.1008 (amd driver, on my minipc windows 11, AMD Ryzen 9 7940HS, launched in January 2023)

Newer drivers cannot be installed? What versions do the other PCs have where it works?

Screenshot DxDiag, more information on exactly which DLL files are used.

image

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 29, 2024

It looks like this (german):
image
Not sure if there is any update, but it doesn't look like so.
The Driver & Software Panel looks different to mine, where everything works:
image

Also one thing: I changed the unpack and pack method to the one provided in godotengine/godot-proposals#3187 (comment) and now everything works again. So I'm pretty certain that something in the Godot pack/unpack methods is wrong, and due to PR: #88816, we are using them now (instead of the 'native' ones)

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 29, 2024

Looks like there was a similar error already:
#73320 caused by #72914 and fixed by #73332

cc @JonqsGames

Citing:

For some reason the radeon drivers really don't like the h_e == uint(0x0000) comparison. Replacing it with (h_e >> uint(10)) == uint(0) works though.

I now reverted half2float and float2half before change #72914, and it works.

@Alex2782
Copy link
Contributor

I would also try to download the driver update from the homepage again, maybe the update software is defective or the update is deactivated in the settings? The question is also what effects it has on other systems and drivers. On Android, users cannot update the drivers as easily as on PCs :-)

GPUParticles are not rendered

CPU: AMD Ryzen 7 5825U <--- Release Date: Jan 2022
Integrated GPU: AMD Radeon RX Vega 8

This combination however works:

CPU: AMD Ryzen 7 5700U <--- Release Date: Jan 2021
Integrated GPU: AMD Radeon RX Vega 8

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 29, 2024

Now only reverted half2float and it still works.

While a driver update may help, it is still something we should aim to fix, no?
The Updater might be deactivated, we found this problem on company laptops as they all have an AMD GPU, so it was broken for pretty much every laptop. But also for some friends that have e.g. an AMD Radeon RX 580, which is much older.

@Alex2782
Copy link
Contributor

Alex2782 commented Aug 29, 2024

The question is also what effects it has on other systems and drivers. On Android, users cannot update the drivers as easily as on PCs :-)

I have an Adreno 3xx (Android) device and could try your changes.

// Compatibility renames. These are exposed with the "godot_" prefix
// to work around two distinct Adreno bugs:
// 1. Some Adreno devices expose ES310 functions in ES300 shaders.
// Internally, we must use the "godot_" prefix, but user shaders
// will be mapped automatically.
// 2. Adreno 3XX devices have poor implementations of the other packing
// functions, so we just use our own everywhere to keep it simple.


If the godot_ - renames is only necessary for Adreno, then maybe we can add #if defined?

#if defined(ADRENO) 
#define packUnorm4x8 godot_packUnorm4x8
#define unpackUnorm4x8 godot_unpackUnorm4x8
#define packSnorm4x8 godot_packSnorm4x8
#define unpackSnorm4x8 godot_unpackSnorm4x8
#define packHalf2x16 godot_packHalf2x16
#define unpackHalf2x16 godot_unpackHalf2x16
#define packUnorm2x16 godot_packUnorm2x16
#define unpackUnorm2x16 godot_unpackUnorm2x16
#define packSnorm2x16 godot_packSnorm2x16
#define unpackSnorm2x16 godot_unpackSnorm2x16
#endif

@Maran23
Copy link
Contributor Author

Maran23 commented Aug 29, 2024

If the godot_ - renames is only necessary for Adreno, then maybe we can add #if defined?

That was there previously, but changed in #88816 due to buggy Adreno implementation of the packed methods. We may can fix the problem by fixing half2float so that is works for those AMD GPUs as well as for everything else. This is unfortunately beyond my knowledge. But I will try some things in the next days, maybe I can fix it 'by accident' and someone more experienced can review it.

Also good to know that you have access to an Adreno 3xx device! :-)

BTW: We just checked the Radeon RX 580 Series Driver, it is indeed the newest driver and it still suffers from the problem
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Very Bad
Development

Successfully merging a pull request may close this issue.

6 participants