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

handle cull mode by indices, refer to issue #10172 #10973

Merged
merged 6 commits into from
Jun 10, 2018

Conversation

weihuoya
Copy link
Contributor

@weihuoya weihuoya commented Apr 27, 2018

improve performance for GVGNP.

See #10172

@weihuoya weihuoya changed the title handle cull mode by indices, refer to #10172 handle cull mode by indices, refer to issue #10172 Apr 27, 2018
@hrydgard
Copy link
Owner

Nice, this is exactly the kind of thing I had imagined when I wrote that comment :)

Looks like it deserves some testing and, if I'm understanding this right, it should be done for the other triangle primitive types as well (triangle list, fan, plus all the non-indexed types). Could also fall back to flushing the cull mode if those are encountered...

@hrydgard hrydgard added this to the v1.7.0 milestone Apr 27, 2018
@weihuoya
Copy link
Contributor Author

I haven't find a game to test other primitive types, so all those fallback to flush.

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented May 29, 2018

Just a note: this in theory should fix #1319 and #6958, I think. Possibly also #10597.

-[Unknown]

@weihuoya
Copy link
Contributor Author

weihuoya commented Jun 3, 2018

GTA use triangle fan, need handle it.

if (numInds <= 0) return;
indexOffset = index_ - indexOffset;
int numTris = numInds - 2;
u16 *outInds = inds_;
const int v1 = clockwise ? 1 : 2;
const int v2 = clockwise ? 2 : 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Didn't use these below?

-[Unknown]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will fx it now.:flushed:

@@ -1618,6 +1632,14 @@ void GPUCommon::Execute_Prim(u32 op, u32 diff) {
gstate.cmdmem[GE_CMD_TEXSCALEV] = data;
gstate_c.uv.vScale = getFloat24(data);
break;
case GE_CMD_TEXOFFSETU:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tomb Raider use GE_CMD_TEXOFFSETU and GE_CMD_TEXOFFSETV frequently, but not quite useful.:grimacing:

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's some engine, there's other games that do that too (basically the whole point of the gstate_c.uv optimization.) Makes sense to add them here.

-[Unknown]

Copy link
Collaborator

@unknownbrackets unknownbrackets left a comment

Choose a reason for hiding this comment

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

Looks good to me - I think we should merge.

dc.cullMode != -1 && gstate.isCullEnabled() && gstate.getCullMode() != dc.cullMode could possibly be factored into a method, but I think it's a good change either way.

-[Unknown]

@hrydgard
Copy link
Owner

Yeah, agreed.

@ghost
Copy link

ghost commented Jun 17, 2018

WOW 😃 Naruto Ultimate Ninja Impact 1 now running smooth in 30/30 FPS unlike in previous version this game is running very slow but now it's fast maybe because of this "handle cull mode of indices"?

@ghost
Copy link

ghost commented Jun 18, 2018

I will try Digimon Adventure if this PR help its #10842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants