Project

General

Profile

Actions

Emulator Issues #1437

closed

opengl plugin optimization

Added by rodolfoosvaldobogado over 14 years ago.

Status:
Fixed
Priority:
Normal
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

This is just a try to optimize opengl speed, I’m just starting to look at
the code but I’ll really like to help.
Changes made:
• Added centralized program management to improve state conservation, now
the program selection , activation and deactivation are centralized in the
cache ( the fragment program selection is still uncached because it's break
SMS, trying figure out why)
• Some tweaks to improve texture conversion.
• Change the use of glBufferData to glBufferSubData to update the vertex
buffer, this must be faster but with the current amount of draw calls there
is a minimum difference.

Actions #1

Updated by jayork42 over 14 years ago

I'd like to see this compiled if it works!

Actions #2

Updated by nakeee over 14 years ago

I don't see any difference in performance.
What should run faster using this patch?

Actions #3

Updated by rodolfoosvaldobogado over 14 years ago

nothing should run a lot faster the performance diference is minimun , as i say just
started to view the code, with this changes i get 3 fps more using real xfb and using
copy efb to ram no more than that.
the idea is do this type of state caching where is posible.I'm trying to do it but
work takes all my time these days (I'm a sofware developer in Argentina)you can
obtain a real frame rate grow increasing the buffer sise from 0x4000 to 0x50000 an
decresing the number of buffers from 0x40 to 0x4 in VertexManager.cpp.
in my machine thas takes sms from 12-25 to 19-30 fps (i belive is from the reduction
in draw calls due to less buffer splits). but as i say when i have more free time
will try to give a deep view to the code.
excuse me for my english but i'm a little out of practice.

Actions #4

Updated by rodolfoosvaldobogado over 14 years ago

First real try, apply the same tactic of joining all the possible primitives,
transforming then to plain triangles and do indexed draws to minimize draw calls,
thanks to Rice for the idea :) (the credit is for him, just translated his code to
OpenGL and make some modifications to ensure parallelism and performance)
Need someone to test this please.
I’ll think you will get a nice surprise.

Actions #5

Updated by Anonymous over 14 years ago

boring poking of people that know opengl rather well...

Actions #6

Updated by shortzi over 14 years ago

Thanks for the patch.

Whilst it does show a good speed up, It's still very slow for ATI cards.
DirectX is still faster in this case..

Actions #8

Updated by rodolfoosvaldobogado over 14 years ago

shortzi, what ati model are you using and what driver version?
I'm using hd4870 in windows 7 with the lastest drivers and the speed drop is only
around 3 to 9 % compared to d3d ( tested sms,smg,ztp,zww the only ones i'm own ),
Some one with linux may try, i like to know de performance in linux drivers.

Actions #9

Updated by shortzi over 14 years ago

Sorry i should of stated that in earlier post.

ATI HD3650, Catalyst 9.9 latest

The Opengl plugin was always slow compared to the DirectX plugin and
your optimizations did speed it up, but just not as fast as DirectX, i dont know if
it's because there are some Nvidia only instructions in the code?

ATI has a history of shitty Opengl support, i know Gonetz(Glide64) had to write a
hack to reverse the texture format to get it to get proper speed on ATI Cards

Actions #10

Updated by rodolfoosvaldobogado over 14 years ago

You are right, ati opengl support is bad. Let see if on newer drivers this change.
But in the meantime, the only thing left is try to optimize de code.
D3d is faster but opengl is the only way in linux and OSX.

Actions #11

Updated by cacofff over 14 years ago

Not to mention OpenGL is slower on Vista/7, compared to XP or other OSes.

By the way, good job, I noticed about 5% fps increase in most games.

Actions #12

Updated by hrydgard over 14 years ago

  • Status changed from New to Accepted

Thanks for the patches, I'm going to try and probably apply them.

Actions #13

Updated by hrydgard over 14 years ago

works fine, submitted

Actions #14

Updated by ling.weak over 14 years ago

Twilight Princess minimap is horribly broken.
http://img16.imageshack.us/img16/9371/ztpbrokenmap.png

Actions #15

Updated by rodolfoosvaldobogado over 14 years ago

as i promise a new path, this must be faster, and more acurate, changed the way the
everything is indexed to reduce draws, this should fix ztp minimap, More explanations
later, is to late and I'm to tired. please test it and tell me the remainings to fix :)

Actions #16

Updated by hrydgard over 14 years ago

Cool thanks, I'll try to remember to have a look and submit it when I get home today.

Actions #17

Updated by jacky.kk.tsui over 14 years ago

Thanks Rodol .The new patch looks good but notice one thing .The Anti-aliasing has
high performance hit even for 2x using OGL plugin . Anti-aliasing on D3D is working
great with almost no frame rate drop .

P.S.I'm using 9600gso and E5200.

Actions #18

Updated by hrydgard over 14 years ago

that's surprising, since AA actually isn't working in the D3D plugin right now - if
you see AA, it's your imagination :p

Actions #19

Updated by hrydgard over 14 years ago

(and if you're forcing AA through your gfx card control panel, well, don't, since it
doesn't play well with dolphin)

Actions #20

Updated by rodolfoosvaldobogado over 14 years ago

well, new patch, little cleanup, get rid of sps (i hope) and reorder de code to make
it more generic and easy to port to d3d, for people with onboard and basic video now
the indexbufeer size changes if it biger than hardware supported size.
please test it and let mi know if there any issues left.

Actions #21

Updated by rodolfoosvaldobogado over 14 years ago

is incredible wath borred people can do. take this patch carefully an test it a lot,
in my system speed up things a little but i like to see what happens in others
systems, with this 2 patches aplien d3d and opengl will have the same structure in
the vertexmanager. my next step is to review in deep the rest of the plugins
searching for inprovemnets i hope i can make a new patch soon.

Actions #22

Updated by rodolfoosvaldobogado over 14 years ago

Rebuild one of my Client's database from a lot of exells files is soooooooooooo
boring and slow so...
:) Peek_Z in direct3d plugin working.
test please, enjoy SMG :)

Actions #23

Updated by hrydgard over 14 years ago

I'll patch them in this weekend, thanks!

Actions #24

Updated by hrydgard over 14 years ago

Actually, I just added you to committers if you want to commit the changes yourself.

Actions #25

Updated by jacky.kk.tsui over 14 years ago

Sorry , ector . you are right . AA is not working in D3D .Hope later rev , this can
be fixed and we can use AA again

Actions #26

Updated by Anonymous over 14 years ago

Hey Tino, I think that now you have committer status you can close this if want :)

Actions #27

Updated by rodolfoosvaldobogado over 14 years ago

jejej shure

Actions #28

Updated by XTra.KrazzY over 14 years ago

  • Status changed from Accepted to Fixed
Actions

Also available in: Atom PDF