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

Conversation

Projects
None yet
5 participants
@gregory38
Contributor

gregory38 commented Jul 2, 2017

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.

glsl: reduce geometry shader complexity
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

This comment has been minimized.

Member

lightningterror commented Jul 3, 2017

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

This comment has been minimized.

Member

MrCK1 commented Jul 3, 2017

Works fine for me on Nvidia.

@lightningterror

This comment has been minimized.

Member

lightningterror commented Jul 3, 2017

@MrCK1 can you do some benchmarks?

@MrCK1

This comment has been minimized.

Member

MrCK1 commented Jul 3, 2017

I can, but not until tonight.

@gregory38

This comment has been minimized.

Contributor

gregory38 commented Jul 3, 2017

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

This comment has been minimized.

Contributor

gregory38 commented Jul 3, 2017

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

gregory38 commented Jul 3, 2017

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

This comment has been minimized.

Contributor

gregory38 commented Jul 12, 2017

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

@prafullpcsx2

This comment has been minimized.

Contributor

prafullpcsx2 commented Jul 12, 2017

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

@lightningterror

This comment has been minimized.

Member

lightningterror commented Jul 12, 2017

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

@gregory38

This comment has been minimized.

Contributor

gregory38 commented Jul 12, 2017

Ah yes. I'm useless

@gregory38 gregory38 merged commit c5d35d4 into master Jul 12, 2017

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@gregory38 gregory38 deleted the greg/reduce-gs-glsl branch Oct 4, 2017

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