Hazel icon indicating copy to clipboard operation
Hazel copied to clipboard

Fixed AMD issues with SPIR-V Shaders

Open FinalDeath61 opened this issue 4 years ago • 8 comments

PR impact

List of related issues/PRs this will solve:

Impact Issue/PR
Issues this solves #440
Other PRs this solves #504

Closes #440

Proposed fix

Using shader sources generated by SpirV-Cross for OpenGL with AMD GPU instead of the Spirv-V binary. Storing the opengl program binary like Spir-V binary and loading it when it exist.

Maybe there is a better way of detecting when using AMD GPU ?

Additional context

  • [x] Debug - x64
  • [x] Release - x64
  • [x] Dist - x64

FinalDeath61 avatar Dec 19 '21 16:12 FinalDeath61

I check this on my laptop, where was previously with AMD and now is working :D

Drockk avatar Dec 26 '21 17:12 Drockk

Can confirm this fixes (although workaround) the issue on my system:

Vendor: ATI Technologies Inc. Renderer: Radeon RX 580 Series Version: 4.6.14802 Compatibility Profile/Debug Context 21.12.1 30.0.14011.3017

nepp95 avatar Jan 01 '22 14:01 nepp95

I too can confirm that this fixes the problem on my system: Renderer: AMD Radeon(TM) Vega 10 Graphics Vendor: ATI Technologies Inc. Version: 4.6.13596 Compatibility Profile/Debug Context 20.10.12.09 27.20.11012.9001

RentierMr avatar Jan 06 '22 19:01 RentierMr

I assume this can be close when Cherno switch to Vulkan.

FinalDeath61 avatar Jun 28 '22 18:06 FinalDeath61

@FinalDeath61 I tried this and it fixes the crash but all objects disappear when I pressed Play, do you have any idea what could be the issue?

thain-gd avatar Sep 15 '22 03:09 thain-gd

@FinalDeath61 I tried this and it fixes the crash but all objects disappear when I pressed Play, do you have any idea what could be the issue?

Some more information would be helpful. Was it working before or did you clone, make the adjustment and then found out it wasn't working? Are there any entities in the scene hierarchy? Is there even anything being rendered (check stats)? Those are the first things I think about. If that doesn't give you an idea, the debugging begins :)

nepp95 avatar Nov 08 '22 17:11 nepp95

@FinalDeath61 I tried this and it fixes the crash but all objects disappear when I pressed Play, do you have any idea what could be the issue?

It's probably not related to the SPIR-V issue. You probably have an issue in the scene copy, or maybe you don't give the actual scene to your runtime. I suggest that you watch the episodes of the game engine serie related to scene start stop to. (https://youtube.com/playlist?list=PLlrATfBNZ98dC-V-N3m0Go4deliWHPFwT)

FinalDeath61 avatar Nov 08 '22 17:11 FinalDeath61

I have looked through the AMD forums again and unfortunately there is no response to the issue, so I think this workaround seems necessary for now. Curious how other developers work around this issue. Haven't tested with the current driver version though, so they could have fixed it without a mention in the release notes.

nepp95 avatar Nov 08 '22 17:11 nepp95

This seems to have been resolved with one of the driver updates from AMD. I'm currently on version 23.5.2, and it runs just fine without any AMD workaround (which I had been using until now, but was causing other issues).

drsnuggles8 avatar Jul 02 '23 14:07 drsnuggles8

This seems to have been resolved with one of the driver updates from AMD. I'm currently on version 23.5.2, and it runs just fine without any AMD workaround (which I had been using until now, but was causing other issues).

I'll try it with an AMD driver >= 23.5.2 and will close the issue if it work. Thanks for the heads-up 👍

FinalDeath61 avatar Jul 02 '23 14:07 FinalDeath61

I can confirme it SPIR-V shader now work in AMD with driver version 23.5.2. I close the MR and issue.

FinalDeath61 avatar Jul 02 '23 17:07 FinalDeath61