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

PixelShaderGen: Clamp texture layer when using manual texture sampling with stereoscopic 3D #11386

Conversation

Pokechu22
Copy link
Contributor

Fixes https://forums.dolphin-emu.org/Thread-manual-texture-sampling-does-not-work-with-stereoscopic-3d.

Otherwise, texelFetch() will use an out-of-bounds layer for game textures (that have 1 layer; EFB copies have 2 layers in stereoscopic 3D mode), which is undefined behavior (often resulting in a black image). The fast texture sampling path uses texture(), which always clamps (see https://www.khronos.org/opengl/wiki/Array_Texture#Access_in_shaders), so it was unaffected by this difference.

…g with stereoscopic 3D

Otherwise, texelFetch() will use an out-of-bounds layer for game textures (that have 1 layer; EFB copies have 2 layers in stereoscopic 3D mode), which is undefined behavior (often resulting in a black image). The fast texture sampling path uses texture(), which always clamps (see https://www.khronos.org/opengl/wiki/Array_Texture#Access_in_shaders), so it was unaffected by this difference.
Copy link
Contributor

@iwubcode iwubcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested

@GPhMorin
Copy link

I just tried compiling the code that you provided (first time I compile Dolphin in fact) and the build failed:
image

@K0bin
Copy link
Contributor

K0bin commented Dec 28, 2022

That seems unrelated to the PR. Just to rule out the simple thing first: Have you checked out all the submodules?

@AdmiralCurtiss
Copy link
Contributor

If you just want to test the build, you can also just download the PR build from buildbot. At the bottom here scroll to pr-win-x64 -> Details -> Download the pr-11386-dolphin-latest-x64.7z.

@AdmiralCurtiss AdmiralCurtiss merged commit ed99153 into dolphin-emu:master Jan 3, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants