Created attachment 144651 [details]
shader cache corruption
Using Cemu emulator with shader cache functionality breaks after commit 11e16ca7ce0. Screen display only solid colors with very low fps.
AMD Ryzen 2600
Linux 5.0.9, amdgpu, mesa master
How to reproduce the issue:
1. Run Cemu, enable shader cache functionality
2. Play a game then let shader cahce be generated. Game can be played normally and shader can be built normally. No graphical issue is found at this stage.
3. Quit Cemu
4. Play the same game again utilizing the generated shader cache
5. Game display shows flickering solid colors as shown in this ticket attachment.
Playing the same game with previously generated shader cache should display the correct graphic instead of flickering solid colors.
Can you address this issue?
Thanks for the top quality bug report!
Just to be clear before 11e16ca7ce0 Cemu wasn't actually making use of the cache as it was disabled for core profiles (which Cemu uses). Enabling it uncovered a bug with the interaction of our cache implementation and the separate shader objects extension.
Anyway the following patch should fix the issue.
(In reply to Timothy Arceri from comment #1)
> Thanks for the top quality bug report!
> Just to be clear before 11e16ca7ce0 Cemu wasn't actually making use of the
> cache as it was disabled for core profiles (which Cemu uses).
Sorry that should have been "it was disabled for compatibility profiles"
I applied your patch to the latest mesa git-2042f22e28. Your patch fixed the issue. You can close this bug. Thank for responding so quickly.
Author: Timothy Arceri <email@example.com>
Date: Mon Jul 1 12:25:19 2019 +1000
mesa: save/restore SSO flag when using ARB_get_program_binary
Without this the restored program will fail the pipeline validation
checks when we attempt to use an SSO program.
Fixes: c20fd744fef1 ("mesa: Add Mesa ARB_get_program_binary helper functions")
Reviewed-by: Jordan Justen <firstname.lastname@example.org>