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

glsl: reduce geometry shader complexity #1995

Merged
merged 1 commit into from Jul 12, 2017
Merged

Conversation

gregory38
Copy link
Contributor

output 1 strip of 2 triangles instead of 2 strips of 1 triangle.

Potentially it would reduce the geometry shader overhead. And it
might avoid a middle line in sprite in some AMD GPU/driver/OS
bad combination

Need a quick test on various driver, AMD, Nvidia, Intel.

output 1 strip of 2 triangles instead of 2 strips of 1 triangle.

Potentially it would reduce the geometry shader overhead. And it
might avoid a middle line in sprite in some AMD GPU/driver/OS
bad combination
@lightningterror
Copy link
Contributor

Wish I could test this now but i can't on both intel and amd. eta 2 weeks maybe.
I'd like this to be added before 1.6 release. More fps is always welcome :)

@Sarania can you do some tests?

@MrCK1
Copy link
Member

MrCK1 commented Jul 3, 2017

Works fine for me on Nvidia.

@lightningterror
Copy link
Contributor

@MrCK1 can you do some benchmarks?

@MrCK1
Copy link
Member

MrCK1 commented Jul 3, 2017

I can, but not until tonight.

@gregory38
Copy link
Contributor Author

Don't expect too much. First of all, Opengl barely uses geometry shader. And compiler might already do the job correctly. Hum I will check the shader size with Nouveau.

@gregory38
Copy link
Contributor Author

Here some stats on Nouveau compiler. GPR is the number of used register (less register means more shader run in //). Inst is the number of instruction (less instruction means faster shader run). bytes is the size of the shader. First shader is to convert sprite. And the next 2 are used in the unscale line/point hack.

Before

T:Oth		S:	=> type: 2, local: 0, gpr: 34, inst: 187, bytes: 1712
T:Oth		S:	=> type: 2, local: 0, gpr: 29, inst: 197, bytes: 1808
T:Oth		S:	=> type: 2, local: 0, gpr: 44, inst: 211, bytes: 1936

After

T:Oth		S:	=> type: 2, local: 0, gpr: 37, inst: 133, bytes: 1216
T:Oth		S:	=> type: 2, local: 0, gpr: 30, inst: 142, bytes: 1304
T:Oth		S:	=> type: 2, local: 0, gpr: 33, inst: 147, bytes: 1344

@mirh
Copy link

mirh commented Jul 3, 2017

avoid a middle line in sprite

Wait, like in the actual finished rendered image I might see some improvement?
I could give a check to it tomorrow then

@gregory38
Copy link
Contributor Author

I remembered someone posted some screenshot on an AMG GPU that show sprite diagonal (border of 2 triangles). Normally rasterization rules are obvious. Only a single fragment must be generated at the border. I don't know if it was due to the 2 sprites or a random bug in the driver. Anyway, code is better this way. And maybe someone could do the same for latest added shader.

@PCSX2 PCSX2 deleted a comment from mirh Jul 4, 2017
@gregory38
Copy link
Contributor Author

Anyone to test Nemo ? @prafullpcsx2 I think you have the game, isn't it.

@prafullpcsx2
Copy link
Contributor

This doesn't show any difference with Nemo. I guess you meant #1994 ? That one surely fixes the Nemo regression.

@lightningterror
Copy link
Contributor

lightningterror commented Jul 12, 2017

Looks like greg posted in the wrong thread again :D
Anyway yea he meant that one.

@gregory38
Copy link
Contributor Author

Ah yes. I'm useless

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

Successfully merging this pull request may close these issues.

None yet

5 participants