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

Gallery Fake color is not correct #8406

Closed
daniel229 opened this issue Jan 8, 2016 · 19 comments · Fixed by #12158 or #16073
Closed

Gallery Fake color is not correct #8406

daniel229 opened this issue Jan 8, 2016 · 19 comments · Fixed by #12158 or #16073
Labels
GE emulation Backend-independent GPU issues
Milestone

Comments

@daniel229
Copy link
Collaborator

Since #8389

right color
01

wrong color
02

@daniel229
Copy link
Collaborator Author

current master log

11:07:566 voice[0]     I[ME]: HLE\sceAtrac.cpp:1558 sceAtracReleaseAtracID(1)
11:09:102 user_main    I[SCEGE]: Common\FramebufferCommon.cpp:416 Creating FBO for 001fc000 : 64 x 4 x 3
11:09:117 user_main    W[G3D]: Common\FramebufferCommon.cpp:914 Block transfer upload 09006230 -> 041fc000
11:09:117 user_main    I[G3D]: GLES\ShaderManager.cpp:160 Linked shader: vs 19 fs 29
11:10:087 user_main    W[FileSys]: FileSystems\ISOFileSystem.cpp:573 Reading beyond end of file, clamping size 263168 to 20400
11:10:088 voice[0]     I[ME]: HLE\sceAtrac.cpp:1892 1=sceAtracSetDataAndGetID(08a7b7c0, 00040400)
11:10:088 voice[0]     W[ME]: HLE\sceAtrac.cpp:1779 This is an atrac3+ mono audio
11:10:089 voice[0]     E[ME]: HLE\sceAtrac.cpp:1491 sceAtracGetSecondBufferInfo(1, 09ff2e80, 09ff2e84)
11:18:228 voice[0]     I[ME]: HLE\sceAtrac.cpp:1558 sceAtracReleaseAtracID(1)
11:19:781 user_main    W[FileSys]: FileSystems\ISOFileSystem.cpp:573 Reading beyond end of file, clamping size 263168 to 45592
11:19:781 voice[0]     I[ME]: HLE\sceAtrac.cpp:1892 1=sceAtracSetDataAndGetID(08a7b7c0, 00040400)
11:19:781 voice[0]     W[ME]: HLE\sceAtrac.cpp:1779 This is an atrac3+ mono audio
11:19:782 voice[0]     E[ME]: HLE\sceAtrac.cpp:1491 sceAtracGetSecondBufferInfo(1, 09ff2e80, 09ff2e84)
11:19:831 user_main    W[G3D]: GLES\TextureCache.cpp:1333 Using texture with rendered CLUT: texfmt=5, clutfmt=3

before

13:21:210 voice[0]     I[ME]: HLE\sceAtrac.cpp:1558 sceAtracReleaseAtracID(1)
13:22:749 user_main    I[SCEGE]: Common\FramebufferCommon.cpp:420 Creating FBO for 001fc000 : 64 x 4 x 3
13:22:753 user_main    W[G3D]: Common\FramebufferCommon.cpp:631 Memcpy fbo download 041fc000 -> 045fc000
13:22:760 user_main    W[G3D]: Common\FramebufferCommon.cpp:833 Block transfer upload 09006230 -> 041fc000
13:22:761 user_main    I[G3D]: GLES\ShaderManager.cpp:160 Linked shader: vs 19 fs 29
13:22:762 user_main    W[G3D]: GLES\TextureCache.cpp:1329 Using texture with rendered CLUT: texfmt=5, clutfmt=3

@unknownbrackets
Copy link
Collaborator

It's funny that the colors in the wrong image look right.

Could you try to bisect which change broke it, and see the GE debugger? I'm guessing it's because we're not downloading the entire framebuffer. But it might also be caused by my checking the stride - this CLUT is 64x4 rather than 256x1.

-[Unknown]

@daniel229
Copy link
Collaborator Author

Since unknownbrackets@28a07c7 ,it's black,and then unknownbrackets@095d8cb it looks what it looks now.

Is it one?
03
https://gist.github.com/daniel229/0d2eb63089b3ff6e5c22

@unknownbrackets
Copy link
Collaborator

Watch for the CLUT field under Texture to show an address that starts with 0x04.

-[Unknown]

@daniel229
Copy link
Collaborator Author

@unknownbrackets
Copy link
Collaborator

Well, it definitely drew brown in the CLUT, and it seems like it ought to be brown... Hmm maybe it needs a flush before copy.

Try adding:

    FlushBeforeCopy();

Just after:

    PackFramebufferAsync_(nullptr);

Hmm, actually, that could be an interesting cause of various issues, even in the GPU deindexing...

-[Unknown]

@daniel229
Copy link
Collaborator Author

Is it each PackFramebufferAsync_(nullptr);? I added them and still not work.

@daniel229
Copy link
Collaborator Author

13:47:989 user_main W[G3D]: GLES\TextureCache.cpp:1333 Using texture with rendered CLUT: texfmt=5, clutfmt=3
This log posting up is 4.976 seconds later than before.

@unknownbrackets
Copy link
Collaborator

Was this originally working correctly in v1.1.1?

-[Unknown]

@daniel229
Copy link
Collaborator Author

No.

@unknownbrackets
Copy link
Collaborator

Find, GPU/GLES/Framebuffer.cpp:

        int w = std::min(pixels % vfb->fb_stride, (int)vfb->width);
        int h = std::min((pixels + vfb->fb_stride - 1) / vfb->fb_stride, (int)vfb->height);

Add after:

        if (w == 0 || h > 1) {
            // Exactly aligned.
            w = std::min(vfb->fb_stride, (int)vfb->width);
        }

Does this help?

-[Unknown]

@daniel229
Copy link
Collaborator Author

Yes,it does.

@unknownbrackets
Copy link
Collaborator

Cool, okay so that is the fix for this issue, and might fix others... but umm, #8509 will look pretty terrible with that fixed, right now. Hmm.

-[Unknown]

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Jul 7, 2019
Or otherwise when loading full rows.  Should fix hrydgard#8406.
@unknownbrackets unknownbrackets added this to the v1.9.0 milestone Jul 7, 2019
unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Jul 7, 2019
Or otherwise when loading full rows.  Should fix hrydgard#8406.
@hrydgard hrydgard reopened this Nov 10, 2020
@hrydgard
Copy link
Owner

Got re-broken since I reverted the fix: d8db8ec

@unknownbrackets
Copy link
Collaborator

Is this working in the latest git versions?

-[Unknown]

@Panderner
Copy link
Contributor

Here in the latest build:
ULJS00024_00001

@hrydgard
Copy link
Owner

Oh, interesting. That almost looks right, but not quite.

Can I have a GE dump? https://github.com/hrydgard/ppsspp/wiki/How-to-create-a-frame-dump

@Panderner
Copy link
Contributor

Here:
ULJS00024.zip

@hrydgard
Copy link
Owner

hrydgard commented Sep 21, 2022

Interesting one, the palette is loaded from a 64x4 framebuffer:

image

But we only look at the first line when loading palettes on the GPU. Fixable with a little extra shader work, will take care of this soon.

Great test case!

@hrydgard hrydgard modified the milestones: Future, v1.14.0 Sep 21, 2022
@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label Sep 21, 2022
hrydgard added a commit that referenced this issue Sep 21, 2022
Fixes #8406, although technically, we should wrap by bufw, not the
texture width.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
4 participants