Repository navigation
Run on GPUs with only the OpenGL 4.3 minimum of 8 image units - #3
Merged
Merged
Conversation
Shaders now sample the fields they only read and keep image units for writes, numbered below 8, so NVIDIA and Intel drivers no longer refuse to start the game. The startup limit check is gone; gpu-compile checks every program against the OpenGL 4.3 minimums instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Powder Game wouldn't start on GPUs that offer only the OpenGL 4.3 minimum of 8 image units, which is what NVIDIA and Intel drivers usually report. It showed "GPU supports 8 image units; Powder Game requires 18" and quit.
Shaders now sample any field they don't write (texelFetch, returning zero outside the texture as imageLoad did) and use image units only for writes, all on units 0 to 7. The host binds read-only fields as textures, write-only ones as images and read-write ones as both, and image barriers also cover texture fetches. The startup limit check is gone; gpu-compile now fails any shader that goes over the 4.3 minimums.
Tested on an RX 7800 XT: ctest 103/103, POWDER_REPLAY=all passes, benchmark-realtime passes (combined GPU mean 18.5 ms). The water, sand, boundary and leakage replay signatures match v0.7.1 exactly. Gas and combined end slightly differently; I bisected that to compiler rounding in smoke_correct and gas_velocity_correct, where the values read are identical. Not tested on NVIDIA or Intel hardware.