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

Dream Club portable graphic issue #6497

Closed
sum2012 opened this issue Jul 4, 2014 · 54 comments
Closed

Dream Club portable graphic issue #6497

sum2012 opened this issue Jul 4, 2014 · 54 comments
Labels
D3D11 Direct3D 11 Depth / Z Issue involves depth drawing parameters. GE emulation Backend-independent GPU issues Software Rasterizer

Comments

@sum2012
Copy link
Collaborator

sum2012 commented Jul 4, 2014

v0.9.8-1000-ga675c30 no problem
1
v0.9.8-1018-g318f641 human some problem
v0.9.8-1020-gcda9833 cannot see human
v0.9.8-1061-gcda9833 cannot see human
v0.9.8-1142-g1415532-windows-amd64\ bg full black
v0.9.8-1206-g9503603 cannot see human
v0.9.8-1219-gf664979 cannot see human
v0.9.8-1235-gd1357e5 semi problem on human
v0.9.8-1282-g935f1cb semi problem on human
v0.9.8-1538-gbe0340b semi problem on human
2

v0.9.8-1018-g318f641 log:
https://gist.github.com/sum2012/13c11126d5b9add2ef81
v0.9.8-1538-gbe0340b log:
https://gist.github.com/sum2012/b8d15983366d98e19a7e

@sum2012
Copy link
Collaborator Author

sum2012 commented Jul 4, 2014

I find a solution in v0.9.8-1538-gbe0340b
Windows size set from 2x to 1x
then no problem
edit: (can set back 2x)
3

@unknownbrackets
Copy link
Collaborator

What does the GE debugger show when drawing the missing elements?

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Jul 4, 2014

v0.9.8-1000-ga675c30 does draw
1
v0.9.8-1538-gbe0340b doesn't
2

@unknownbrackets
Copy link
Collaborator

Darn, I thought it'd be related to framebuf size. Does it help if you disable any of the tests during drawing? Like alpha, stencil, depth? We did change the value we initially had framebuffers set to... weird that it has gone through so many iterations...

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Jul 4, 2014

After change the flag's value ,press resume ?
Also , when do change flag's value ? In the https://cloud.githubusercontent.com/assets/2177532/3484243/c45734fa-03a3-11e4-9697-27492fb5fd5d.png ?

. Does it help if you disable any of the tests during drawing

btw:
Press Escape twice also fix the missing elements

@sum2012
Copy link
Collaborator Author

sum2012 commented Jul 4, 2014

Press Escape twice log
3

@unknownbrackets
Copy link
Collaborator

Pressing escape fixes it, huh? That implies that it's something to do with the stencil, depth, or alpha since it will reset the buffers. Maybe we are not detecting a memcpy.

504 width is a strange number.

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Jul 4, 2014

I re-doing the log (ignore sceunulity)
https://gist.github.com/sum2012/79cbbdad9e09f020e025
The 504 is from
46:34:434 idle0 I[SCEGE]: GLES\Framebuffer.cpp:823 Resizing FBO for 00000000 : 504 x 272 x 1
47:05:708 idle0 I[SCEGE]: GLES\Framebuffer.cpp:823 Resizing FBO for 00044000 : 504 x 272 x 1
47:22:408 idle0 I[SCEGE]: GLES\Framebuffer.cpp:2038 Decimating FBO for 00044000 (504 x 272 x 1), age 6

Debug log (ignore sceunulity)
https://drive.google.com/file/d/0B3OaSdeV0L8kY1MtbnpNZEpmR2M/edit?usp=sharing

@sum2012
Copy link
Collaborator Author

sum2012 commented Jul 4, 2014

Change stencil, depth, and alpha 's value to disable,Press "Resume" not work .
2

@sum2012
Copy link
Collaborator Author

sum2012 commented Jul 4, 2014

Re-start once the girl appear with flash
Press two times "step Frame" result differuclt
1

2

@sum2012
Copy link
Collaborator Author

sum2012 commented Aug 31, 2015

I review the issue.
edit :The first bisect result (from good to nothing) is
32439bc

@sum2012
Copy link
Collaborator Author

sum2012 commented Sep 1, 2015

Hmm,Another good test

edit v0.9.8-1224-g43bddd8 semi problem on human
edit :v0.9.8-1228-gf0f8f72 semi problem on human
v0.9.8-1235-gd1357e5 semi problem on human

edit:The changes are
v0.9.8-1224-g43bddd8...v0.9.8-1228-gf0f8f72

@sum2012
Copy link
Collaborator Author

sum2012 commented Sep 1, 2015

@unknownbrackets git bisect result:
a54cefc
Hope you have idea for correct fix.

Anyway,v1.0.1-857-g08b340f gpu debugger
1

@sum2012
Copy link
Collaborator Author

sum2012 commented Sep 2, 2015

No,The git bisect result is wrong :(

@unknownbrackets
Copy link
Collaborator

Has anything improved here recently?

-[Unknown]

@daniel229
Copy link
Collaborator

No.

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 19, 2016

v1.1.1-760-g07a1670 same problem
soft gpu no missing element but ugly

1

Can we try some code of invalidate to fix it ?

@unknownbrackets
Copy link
Collaborator

Haha, wow that is bad.

I still really wonder if this is depth related. If you change the StateMapping.cpp file, and find:

            glstate.depthFunc.set(ztests[gstate.getDepthTestFunction()]);

And replace it with:

            glstate.depthFunc.set(GL_ALWAYS);

Does it draw all parts of the character? It'll probably draw them wrong, but I'm wondering if it will at least draw everything.

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 20, 2016

Yes.It draw all parts of the character.
Just a little ugly
2

@unknownbrackets unknownbrackets added the Depth / Z Issue involves depth drawing parameters. label Jan 20, 2016
@unknownbrackets
Copy link
Collaborator

So, the reason estimation affected this is because we only blit the depth if the render width and height matched.

Find this in Framebuffer.cpp:

void FramebufferManager::BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFramebuffer *dst) {

And add below:

if (src->z_address == dst->z_address && src->z_stride != 0 && dst->z_stride != 0) {
    NOTICE_LOG(HLE, "Framebuffer switch with same depth, %dx%d -> %dx%d", src->renderWidth, src->renderHeight, dst->renderWidth, dst->renderHeight);
}

What does it say? Ideally, use the GE debugger to click "Step Frame" twice. That will show only one frame of the log, which will be most ideal.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Actually, how about this function instead:

void FramebufferManager::BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFramebuffer *dst) {
    bool matchingDepthBuffer = src->z_address == dst->z_address && src->z_stride != 0 && dst->z_stride != 0;
    bool matchingSize = src->width == dst->width && src->height == dst->height;
    if (matchingDepthBuffer && matchingSize) {
        int w = std::min(src->renderWidth, dst->renderWidth);
        int h = std::min(src->renderHeight, dst->renderHeight);

        if (gstate_c.Supports(GPU_SUPPORTS_ARB_FRAMEBUFFER_BLIT | GPU_SUPPORTS_NV_FRAMEBUFFER_BLIT)) {
            // Only use NV if ARB isn't supported.
            bool useNV = !gstate_c.Supports(GPU_SUPPORTS_ARB_FRAMEBUFFER_BLIT);

            // Let's only do this if not clearing depth.
            fbo_bind_for_read(src->fbo);
            glstate.scissorTest.force(false);

            if (useNV) {
#if defined(USING_GLES2) && defined(ANDROID)  // We only support this extension on Android, it's not even available on PC.
                glBlitFramebufferNV(0, 0, w, h, 0, 0, w, h, GL_DEPTH_BUFFER_BIT, GL_NEAREST);
#endif // defined(USING_GLES2) && defined(ANDROID)
            } else {
                glBlitFramebuffer(0, 0, w, h, 0, 0, w, h, GL_DEPTH_BUFFER_BIT, GL_NEAREST);
            }
            // If we set dst->depthUpdated here, our optimization above would be pointless.

            glstate.scissorTest.restore();
        }
    }
}

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 20, 2016

Talk in the first change first

Find this in Framebuffer.cpp:

void FramebufferManager::BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFramebuffer *dst) {

And add below:

if (src->z_address == dst->z_address && src->z_stride != 0 && dst->z_stride != 0) {
    NOTICE_LOG(HLE, "Framebuffer switch with same depth, %dx%d -> %dx%d", src->renderWidth, src->renderHeight, dst->renderWidth, dst->renderHeight);
}

The GE debugger graphic not same as the first time (Step Frame)
1

There is invalid address in the log (in your change)!!!
1

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 20, 2016

In your second change,

void FramebufferManager::BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFramebuffer *dst) {
    bool matchingDepthBuffer = src->z_address == dst->z_address && src->z_stride != 0 && dst->z_stride != 0;
    bool matchingSize = src->width == dst->width && src->height == dst->height;
    if (matchingDepthBuffer && matchingSize) {
        int w = std::min(src->renderWidth, dst->renderWidth);
        int h = std::min(src->renderHeight, dst->renderHeight);

        if (gstate_c.Supports(GPU_SUPPORTS_ARB_FRAMEBUFFER_BLIT | GPU_SUPPORTS_NV_FRAMEBUFFER_BLIT)) {
            // Only use NV if ARB isn't supported.
            bool useNV = !gstate_c.Supports(GPU_SUPPORTS_ARB_FRAMEBUFFER_BLIT);

            // Let's only do this if not clearing depth.
            fbo_bind_for_read(src->fbo);
            glstate.scissorTest.force(false);

            if (useNV) {
#if defined(USING_GLES2) && defined(ANDROID)  // We only support this extension on Android, it's not even available on PC.
                glBlitFramebufferNV(0, 0, w, h, 0, 0, w, h, GL_DEPTH_BUFFER_BIT, GL_NEAREST);
#endif // defined(USING_GLES2) && defined(ANDROID)
            } else {
                glBlitFramebuffer(0, 0, w, h, 0, 0, w, h, GL_DEPTH_BUFFER_BIT, GL_NEAREST);
            }
            // If we set dst->depthUpdated here, our optimization above would be pointless.

            glstate.scissorTest.restore();
        }
    }
}

Well done,it fixed

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Jan 21, 2016
This is really what was implemented originally, this code was just not
updated to match when we started resizing framebuffers.

Fixes hrydgard#6497.
@sum2012 sum2012 reopened this Jan 31, 2016
@hrydgard hrydgard modified the milestones: Future, v1.11.0 Nov 18, 2020
@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 18, 2020

git bisect result e14437c

@hrydgard
Copy link
Owner

Fixed it for OpenGL again. Moving further work to 1.12.

@hrydgard hrydgard modified the milestones: v1.11.0, v1.12.0 Dec 13, 2020
@sum2012
Copy link
Collaborator Author

sum2012 commented Dec 13, 2020

Re-test in v1.10.3-1324-g226a8be1c
Yes,Remain Directx 9 and Direct 11 have problem

@unknownbrackets
Copy link
Collaborator

The frame dump here appears to work for me in Direct3D 11 and Direct3D 9. Is this potentially fixed? Or does it not reproduce in the dump now?

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 10, 2022

in v1.12.3-607-g2d7a7fd34
Opengl and Vulkan fixed.
Dx9 and DX 11 girl disappear

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 10, 2022

My harddisk die again :(
Now I focus in making game in renpy

@unknownbrackets
Copy link
Collaborator

With the recent changes to depth buffer copying, I think this is even more likely to be fixed. The INTZ change may have helped D3D9, potentially.

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Oct 10, 2022

OpenGL , DX9,Valkun no problem
DX11 and Soft gpu have problem
DX11:
https://img.chkaja.com/92bde1cfd326de86.jpg
Softgpu a little problem:
1

Update frame dump
ULJS00333.zip

@unknownbrackets
Copy link
Collaborator

The correct rendering:
#6497_ULJS00333_dreamclub_depth

Software renders:
#6497_ULJS00333_dreamclub_depth_softgpu

There's some precision issue with some coordinates. But it's actually pretty close.

D3D11 does better with the accuracy:
#6497_ULJS00333_dreamclub_depth_directx11

The frame dump works on Windows 10 / Direct3D 11 using both NVIDIA and Intel. I wonder if some drivers don't support depth readback or require it in a different format.

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Oct 11, 2022

@unknownbrackets some graphic problem may only see by part of iso (umd bufer)
jpcsp made it in jpcsp/jpcsp@c2d7c80
Do you interest it ?

@unknownbrackets
Copy link
Collaborator

I'm not really sure what that is, but it seems like a tool to see what sectors of the UMD the game read from. I don't think it's relevant here?

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Oct 16, 2022

@unknownbrackets I only mean that easier to reproduce the problem

@sum2012
Copy link
Collaborator Author

sum2012 commented Sep 24, 2023

Test in v1.16.3-14-gc4ad32420 of AMD cpu 7900 of AMD Integrated graphics card in windows 11
All render mode okay now.

@sum2012 sum2012 closed this as completed Sep 24, 2023
@hrydgard hrydgard removed this from the Future milestone Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D3D11 Direct3D 11 Depth / Z Issue involves depth drawing parameters. GE emulation Backend-independent GPU issues Software Rasterizer
Projects
None yet
Development

No branches or pull requests

5 participants