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

Vulkan Performance Issues in Hot Shots Golf Open Tee - UCUS98614 #12355

Closed
Passingby1 opened this issue Sep 27, 2019 · 3 comments · Fixed by #12873
Closed

Vulkan Performance Issues in Hot Shots Golf Open Tee - UCUS98614 #12355

Passingby1 opened this issue Sep 27, 2019 · 3 comments · Fixed by #12873
Labels
GE emulation Backend-independent GPU issues Vulkan
Milestone

Comments

@Passingby1
Copy link

Passingby1 commented Sep 27, 2019

What happens?

When you take a shot the bottom power bar fills, at that moment there is severe slowdown in the Vulkan driver, slowdown which is not present in the OpenGL and D3D11 backends. Furthermore, when you are inside the green, besides the the slowdown (on Vulkan) there is also severe flickering in all three mentioned backends.

This is also present in the Android version of the emulator.

What should happen?

No slowdown on Vulkan as it is on the other two backends, plus no flickering when inside the green.

What hardware, operating system, and PPSSPP version? On desktop, GPU matters for graphical issues.

PC:
Windows 10pro 1903
PPSSPP 1.9 (also present in 1.8 and 1.7)
Nvidia 1080ti with various drivers.

Mobile:
Android 9
Chipset | Hisilicon Kirin 710 (12 nm)
CPU | Octa-core (4x2.2 GHz Cortex-A73 & 4x1.7 GHz Cortex-A53)
GPU | Mali-G51 MP4

EDIT
The second game, Hot Shots Golf Open Tee 2 - UCUS98693, also suffers from exactly the same issues.

@hrydgard hrydgard added this to the v1.10.0 milestone Sep 27, 2019
@unknownbrackets
Copy link
Collaborator

This does a lot of block transfers (RAM -> VRAM via memcpy), 272 of them per frame to be exact.

Memcpy fbo upload 08bc6b00 -> 04000000 (s: 000003c0)
Memcpy fbo upload 08bc6ec0 -> 04000400 (s: 000003c0)
Memcpy fbo upload 08bc7280 -> 04000800 (s: 000003c0)
Memcpy fbo upload 08bc7640 -> 04000c00 (s: 000003c0)
...
Memcpy fbo upload 08c06340 -> 04043c00 (s: 000003c0)

Each copy is 480 times 16 bits long, and it skips the stride. The source image is tightly packed, so it's essentially doing this (based on the log):

for (int y = 0; y < 272; ++y) {
    memcpy(dst16 + y * 512, src16 + y * 480, 480 * sizeof(uint16_t));
}

Using an allocator for drawPixelsTex_ seems to help immensely... although it complains about a double-free if I just toss it in quickly.

On the green, I do get some slight flicker when trying to shoot. In software rendering, the elements that flicker are simply not visible. We seem to be missing every other frame's uploads, based on memcpy upload logs (it's doing the thing I mentioned above.)

This happens because we somehow detect the second framebuffer as 481 pixels wide (not 480), and therefore deem it a dangerous guess at a framebuffer copy.

-[Unknown]

@unknownbrackets unknownbrackets changed the title Flickering and Vulkan Related Issues in Hot Shots Golf Open Tee - UCUS98614 Vulkan Performance Issues in Hot Shots Golf Open Tee - UCUS98614 Mar 23, 2020
@unknownbrackets unknownbrackets added the GE emulation Backend-independent GPU issues label Mar 23, 2020
@hrydgard
Copy link
Owner

hrydgard commented May 6, 2020

Got this game now (well, Everybody's Golf). Yeah I think using an allocator is the way to go here for sure. In fact I believe not using one might have lost us performance in other games too, as our VulkanTexture without an allocator will simply have to make its own allocation and that's super expensive on some drivers.

I got it working without any nasty double-frees, so I'm just gonna commit that first at least after testing a little on Android. Ideally we should detect and combine these, but it's not easy to do in this case.

hrydgard added a commit that referenced this issue May 6, 2020
…images.

Fixes #12355 (or at a minimum, will improve it).
hrydgard added a commit that referenced this issue May 6, 2020
…images.

Fixes #12355 (or at a minimum, will improve it).
@unknownbrackets
Copy link
Collaborator

unknownbrackets commented May 6, 2020

Lending to my "maybe texture replacement slowness is mainly allocation" concern, heh.

Thanks, forgot about this one.

-[Unknown]

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 Vulkan
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants