Thread Closed 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
power vr
03-11-2013, 12:07 AM
Post: #31
RE: power vr
No, that game is drawing 8x times, it's a timing issue or something not blocking, etc.

-[Unknown]
Find all posts by this user
03-11-2013, 01:35 AM
Post: #32
RE: power vr
this sound promising thanks carter 07 u made my day m8Smile
Find all posts by this user
03-11-2013, 06:06 AM (This post was last modified: 03-11-2013 06:34 AM by Carter07.)
Post: #33
RE: power vr
(03-10-2013 11:35 PM)Henrik Wrote:  Ah, interesting Smile I'm sure the problem is that PSP games forget to disable alpha test and draw lots of solid geometry with it on, as on PSP it doesn't cost anything, while it hurts us badly on PVR. So if we can detect for example when games are using fully opaque textures and no alpha in vertices, then we can disable the alpha test for that drawing. And maybe we can do more specific hacks for some games. It will be complicated but likely worth it for many mobile GPUs.
Ah so it's not possible to use Alpha Blend Mode instead?

I found this:

"It should also be noted that if a shader contains the ‘discard’ keyword then any object that shader
is applied to will suffer the cost of alpha test, even if the keyword is inside a conditional block that the
developer knows will not be hit for a draw call. The GPU cannot know the result of the conditional
without executing the fragment shader and so has to assume that the ‘discard’ keyword may be
hit. The solution to this is to move the use of ‘discard’ into a separate shader.
Under fixed function APIs it is essential that ‘alpha test’ be disabled for objects that do not require it.
It is common for ‘alpha test’ to be switched on at the beginning of a scene and left on for the entire
scene. This is strongly discouraged is it may severely harm performance.
The same visual effect as ‘discard’ can often be achieved through the use of the correct Alpha
Blend Mode, and setting the Alpha value to ‘0’ where ‘discard’ would be used.
If ‘discard’ or ‘alpha test’ cannot be avoided then objects using these techniques should be
submitted after all opaque geometry is submitted."

Hope something can be done because it's a worth opt for a lot of mobile phones since powervr are widely used Smile, even apple users will like this when the jit works for them.
Find all posts by this user
03-11-2013, 06:50 AM
Post: #34
RE: power vr
Well, it's already only compiled in when the game specifies it wants an alpha test, that's the trouble - games say yes because this performance problem doesn't exist on the PSP. So the trick is finding a way to know that the game is being lazy and it's safe to ignore it.

-[Unknown]
Find all posts by this user
03-11-2013, 02:26 PM
Post: #35
RE: power vr
Ah damm, so it's more tricky to fix this.
Hope a good solution can be found. Smile
Find all posts by this user
03-11-2013, 02:31 PM (This post was last modified: 03-11-2013 02:34 PM by Henrik.)
Post: #36
RE: power vr
We can easily detect and remove a few silly cases like if the game enables the test, but sets the test function to ">=" and specifies 0 (min) as the value to compare with. Hopefully the games do that a lot Smile
Find all posts by this user
03-11-2013, 04:53 PM
Post: #37
RE: power vr
I added detection of very simple cases of this, and it triggers on Lumines, so that should now work faster on your PowerVR device.
Find all posts by this user
03-11-2013, 05:15 PM (This post was last modified: 03-11-2013 05:16 PM by stodag.)
Post: #38
RE: power vr
thx Henrik I never realised how much hard work went into developing an emulator.. enouph respect for all contributing.

if I had more than one device I would donate again. Smile
Find all posts by this user
03-11-2013, 05:16 PM (This post was last modified: 03-11-2013 05:40 PM by Carter07.)
Post: #39
RE: power vr
Well done! thanks Henrik Big Grin
Here some testing (all with ubuffered rendering) sorted by efficacy:

Great increase (perf as not using discard at all):
Lumines: 25 fps -> 60 fps
Tenchu: 35 fps: -> 44 fps (now cpu limited)
Asterix: 36 fps -> 44 fps (now cpu limited)

Modest increase:
Ridge Racer: 17 fps -> 25 fps (was doing 37 with no discard)

No or little change:
Dead to Rights: 17 fps -> 18 fps (was doing 40 with no discard)
Obscure: 21 fps (was doing 34 with no discard)


So it definitevely solved the gpu perf problem on some games, you were right that most games abuse of alpha test.
Hope there is more to do. Smile
Find all posts by this user
03-11-2013, 05:19 PM
Post: #40
RE: power vr
Thanks for finding the issue, always fun to get easy speed gains Smile

Will look into other methods of detecting this later, but that's pretty good already for like 10 minutes of work!
Find all posts by this user
03-11-2013, 06:03 PM (This post was last modified: 03-11-2013 06:08 PM by Carter07.)
Post: #41
RE: power vr
Ahaha, 10 minutes..you're a genius. Cool
Yep now it's better to focus on final fixes before releasing 0.7, no hurry. Big Grin

EDIT:
Emh, with last version perf returned exactly back to normal, not a single fps more, even Lumines is again at 25 fps.
Find all posts by this user
03-11-2013, 06:28 PM
Post: #42
RE: power vr
It caused some breakage so I had to disable parts of it, apparently the parts that mattered Tongue

We'll simply have to look at the texture data to determine if it's opaque before applying the optimization. That will have to wait until after the 0.7 release though.
Find all posts by this user
03-11-2013, 08:16 PM (This post was last modified: 03-11-2013 08:18 PM by Carter07.)
Post: #43
RE: power vr
Arghh Big Grin
Umh in the games i tried i didn't see something broken, trasparency was also right (unlike when disabling completely alpha test).
I agree, 0.7 first. Smile
Find all posts by this user
03-17-2013, 10:39 AM (This post was last modified: 03-17-2013 10:45 AM by Carter07.)
Post: #44
RE: power vr
Just an idea:
Could be possible to break objects (particularly for sprites) into opaque sections to be rendered and alpha tested sections?
or do you think that it may introduce too much overhead?
Find all posts by this user
03-17-2013, 02:13 PM
Post: #45
RE: power vr
Im havin half decent speeds now on some games but i feel im missin out due to my gpu, would be nice if there was a slution Smile
Find all posts by this user
Thread Closed 


Forum Jump: