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

shader_ir/warp: Implement SHFL for Nvidia devices #2855

Merged
merged 1 commit into from Sep 20, 2019

Conversation

@ReinUsesLisp
Copy link
Contributor

commented Sep 11, 2019

Implements SHFL (not SHFL.VTG, that's a different instruction) using Nvidia intrinsics.

On non-Nvidia devices SHFL is emulated with as a theoretical device with a warp size of one, having the same behaviour as NX hardware but with a single thread per warp. We won't have to do this on Vulkan with devices with the option of using a subgroup of 32 (gen9 Intel, Vega and Nvidia). That being said, SPIR-V instructions can't query if a thread is out of bounds. The IR is generic enough to handle three cases.

I'm sad about the math used to convert Nvidia's SHFL mask back into GLSL's width. What this mask means is unknown to me at the moment of writing this.

This also introduces the usage of std::string_view to avoid code repetition on the GLSL decompiler.

@FernandoS27

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2019

@ReinUsesLisp Rebase
@amayra Please use discord to ask such questions. PRs are suppose to only have posts related to the PR.

@yuzu-emu yuzu-emu deleted a comment from amayra Sep 15, 2019
@ReinUsesLisp ReinUsesLisp force-pushed the ReinUsesLisp:shfl branch from a0314fa to 0526bf1 Sep 17, 2019
@ReinUsesLisp ReinUsesLisp added the opengl label Sep 18, 2019
Copy link
Contributor

left a comment

LGTM

@bunnei
bunnei approved these changes Sep 20, 2019
@bunnei bunnei merged commit 88d8574 into yuzu-emu:master Sep 20, 2019
5 checks passed
5 checks passed
yuzu verify Build #20190917.4 succeeded
Details
yuzu verify (build standard linux) build standard linux succeeded
Details
yuzu verify (build standard windows) build standard windows succeeded
Details
yuzu verify (build testing windows) build testing windows succeeded
Details
yuzu verify (format clang) format clang succeeded
Details
@ReinUsesLisp ReinUsesLisp deleted the ReinUsesLisp:shfl branch Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.