[GH-ISSUE #828] Project Diva Extend texture flickering when HW transform is enabled (Vertex Cache issue) #230

Closed
opened 2026-03-17 10:32:27 +03:00 by kerem · 15 comments
Owner

Originally created by @dogtopus on GitHub (Mar 2, 2013).
Original GitHub issue: https://github.com/hrydgard/ppsspp/issues/828

It happens randomly.
This problem happens since the white screen (list doesn't exist) fix of this game(Maybe a month ago or much earlier)

Originally created by @dogtopus on GitHub (Mar 2, 2013). Original GitHub issue: https://github.com/hrydgard/ppsspp/issues/828 It happens randomly. This problem happens since the white screen (list doesn't exist) fix of this game(Maybe a month ago or much earlier)
kerem closed this issue 2026-03-17 10:32:32 +03:00
Author
Owner

@dogtopus commented on GitHub (Mar 4, 2013):

Disable vertex cache can also solve this problem temporarily
@hrydgard what do you think?

<!-- gh-comment-id:14386025 --> @dogtopus commented on GitHub (Mar 4, 2013): Disable vertex cache can also solve this problem temporarily @hrydgard what do you think?
Author
Owner

@unknownbrackets commented on GitHub (Mar 4, 2013):

Hmm. Jikandia also has issues with the vertex cache. We need to find a way to improve it more...

-[Unknown]

<!-- gh-comment-id:14390382 --> @unknownbrackets commented on GitHub (Mar 4, 2013): Hmm. Jikandia also has issues with the vertex cache. We need to find a way to improve it more... -[Unknown]
Author
Owner

@unknownbrackets commented on GitHub (Dec 7, 2013):

Does anyone have a compiler and this game, and want to try a few things out?

In GPU/GLES/TransformPipeline.cpp:

                        if (vai->numVerts > 100) {
                            // exponential backoff up to 16 draws, then every 24
                            vai->drawsUntilNextFullHash = std::min(24, vai->numFrames);
                        } else {
                            // Lower numbers seem much more likely to change.
                            vai->drawsUntilNextFullHash = 0;
                        }

See that 100? Lower values improve performance, higher values improve accuracy. Does 200 prevent the flicker? What's the lowest multiple of 10 required to make the flicker go away?

Maybe we can find other smart ways, like the vertex type, to decide what to do. If you use Debug -> GE Debugger, you should be able to step through and see it drawing the eyelashes using step draw or step prim. What does the "Vertex type" field say while it does this?

-[Unknown]

<!-- gh-comment-id:30049243 --> @unknownbrackets commented on GitHub (Dec 7, 2013): Does anyone have a compiler and this game, and want to try a few things out? In GPU/GLES/TransformPipeline.cpp: ``` c++ if (vai->numVerts > 100) { // exponential backoff up to 16 draws, then every 24 vai->drawsUntilNextFullHash = std::min(24, vai->numFrames); } else { // Lower numbers seem much more likely to change. vai->drawsUntilNextFullHash = 0; } ``` See that 100? Lower values improve performance, higher values improve accuracy. Does 200 prevent the flicker? What's the lowest multiple of 10 required to make the flicker go away? Maybe we can find other smart ways, like the vertex type, to decide what to do. If you use Debug -> GE Debugger, you should be able to step through and see it drawing the eyelashes using step draw or step prim. What does the "Vertex type" field say while it does this? -[Unknown]
Author
Owner

@dbz400 commented on GitHub (Dec 7, 2013):

I will do this test as well .

<!-- gh-comment-id:30049438 --> @dbz400 commented on GitHub (Dec 7, 2013): I will do this test as well .
Author
Owner

@dbz400 commented on GitHub (Dec 7, 2013):

Humm it seems to be i cannot reproduce this issue in latest version .... or may be already fixed?

<!-- gh-comment-id:30049501 --> @dbz400 commented on GitHub (Dec 7, 2013): Humm it seems to be i cannot reproduce this issue in latest version .... or may be already fixed?
Author
Owner

@daniel229 commented on GitHub (Dec 7, 2013):

vai->numVerts > 1680 fixes the blink.

<!-- gh-comment-id:30049608 --> @daniel229 commented on GitHub (Dec 7, 2013): vai->numVerts > 1680 fixes the blink.
Author
Owner

@unknownbrackets commented on GitHub (Dec 10, 2013):

How about changing the other number, 24?

vai->drawsUntilNextFullHash = std::min(24, vai->numFrames);

Does it improve if this is, let's say, 8? That might be a big hit to performance, though...

It'd help to know what vertex type it's using when drawing the eyelashes, I think, in case we can do anything smart with it (probably not much we can do, though...)

-[Unknown]

<!-- gh-comment-id:30277578 --> @unknownbrackets commented on GitHub (Dec 10, 2013): How about changing the other number, 24? vai->drawsUntilNextFullHash = std::min(24, vai->numFrames); Does it improve if this is, let's say, 8? That might be a big hit to performance, though... It'd help to know what vertex type it's using when drawing the eyelashes, I think, in case we can do anything smart with it (probably not much we can do, though...) -[Unknown]
Author
Owner

@thedax commented on GitHub (Dec 11, 2013):

This information should apply to Extend, since 2nd also has the eyelash 'glitch' when VC is on:

When the eyelash texture (it's actually the eye, the lash, and eyebrows all in one texture, either way) is drawn, it uses "float texcoords, ABGR 8888 colors, float normals, float positions, float weights (1)".

Adjusting vai->drawsUntilNextFullHash = std::min(24, vai->numFrames); to 8 makes no difference. If I set it to something absurd like 4 or 1, it works fine for the first blink, but then 'flickers' again after that.

<!-- gh-comment-id:30283984 --> @thedax commented on GitHub (Dec 11, 2013): This information should apply to Extend, since 2nd also has the eyelash 'glitch' when VC is on: When the eyelash texture (it's actually the eye, the lash, and eyebrows all in one texture, either way) is drawn, it uses "float texcoords, ABGR 8888 colors, float normals, float positions, float weights (1)". Adjusting vai->drawsUntilNextFullHash = std::min(24, vai->numFrames); to 8 makes no difference. If I set it to something absurd like 4 or 1, it works fine for the first blink, but then 'flickers' again after that.
Author
Owner

@unknownbrackets commented on GitHub (Dec 11, 2013):

Only the first time? That is weird. Does it work every time if you change this:

if (vai->drawsUntilNextFullHash == 0) {

To just if (true) {? If no, it must be hash collisions I guess.

If so, I wonder what the impact performance wise of a 64-bit hash would be... probably not great. If you change the u32 hash here to u64, and then change both the return type and fullhash type to u64 in ComputeHash(), that should already improve the quality of the hash... does it still happen then?

-[Unknown]

<!-- gh-comment-id:30289363 --> @unknownbrackets commented on GitHub (Dec 11, 2013): Only the first time? That is weird. Does it work every time if you change this: ``` if (vai->drawsUntilNextFullHash == 0) { ``` To just `if (true) {`? If no, it must be hash collisions I guess. If so, I wonder what the impact performance wise of a 64-bit hash would be... probably not great. If you change the `u32 hash` [here](https://github.com/hrydgard/ppsspp/blob/master/GPU/GLES/TransformPipeline.h#L70) to u64, and then change both the return type and `fullhash` type to u64 [in ComputeHash()](https://github.com/hrydgard/ppsspp/blob/master/GPU/GLES/TransformPipeline.cpp#L427), that should already improve the quality of the hash... does it still happen then? -[Unknown]
Author
Owner

@thedax commented on GitHub (Dec 11, 2013):

Changing if (vai->drawsUntilNextFullHash == 0) to if (true) works, yes, every time.

As for the 64 bit hash (without the == 0 change), it doesn't change anything; the eye texture still flickers every time.

<!-- gh-comment-id:30290074 --> @thedax commented on GitHub (Dec 11, 2013): Changing `if (vai->drawsUntilNextFullHash == 0)` to `if (true)` works, yes, every time. As for the 64 bit hash (without the == 0 change), it doesn't change anything; the eye texture still flickers every time.
Author
Owner

@dbz400 commented on GitHub (Dec 11, 2013):

I tested the if (true) { unfornaturely not helping the Midnight Club 4 and Assassins Creed Bloodline

<!-- gh-comment-id:30316863 --> @dbz400 commented on GitHub (Dec 11, 2013): I tested the if (true) { unfornaturely not helping the Midnight Club 4 and Assassins Creed Bloodline
Author
Owner

@thedax commented on GitHub (Mar 14, 2014):

This can be closed, it was fixed with https://github.com/hrydgard/ppsspp/pull/5650.

<!-- gh-comment-id:37646374 --> @thedax commented on GitHub (Mar 14, 2014): This can be closed, it was fixed with https://github.com/hrydgard/ppsspp/pull/5650.
Author
Owner

@unknownbrackets commented on GitHub (Sep 8, 2014):

I found a draw with 1680 verts in the demo, and it is properly detected by the change in #6855, but I'm not sure if I can tell if the eyelashes are working properly. How does it look with that change?

-[Unknown]

<!-- gh-comment-id:54766985 --> @unknownbrackets commented on GitHub (Sep 8, 2014): I found a draw with 1680 verts in the demo, and it is properly detected by the change in #6855, but I'm not sure if I can tell if the eyelashes are working properly. How does it look with that change? -[Unknown]
Author
Owner

@daniel229 commented on GitHub (Sep 8, 2014):

Looks fine now

<!-- gh-comment-id:54768457 --> @daniel229 commented on GitHub (Sep 8, 2014): Looks fine now
Author
Owner

@thedax commented on GitHub (Sep 8, 2014):

Still glitchy in Diva 2nd. I don't have Extend. Would a video help demonstrate how it's supposed to look?

Edit: Oops, saw that that's not merged. Let me try it out.

Looks fine like Daniel said. No more glitchy eyelashes.

<!-- gh-comment-id:54778562 --> @thedax commented on GitHub (Sep 8, 2014): ~~Still glitchy in Diva 2nd. I don't have Extend. Would a video help demonstrate how it's supposed to look?~~ ~~Edit: Oops, saw that that's not merged. Let me try it out.~~ Looks fine like Daniel said. No more glitchy eyelashes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ppsspp#230
No description provided.