• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › General Discussion v
« Previous 1 ... 260 261 262 263 264 ... 368 Next »

Emulate Format Changes
View New Posts | View Today's Posts

Pages (2): 1 2 Next »
Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Emulate Format Changes
02-05-2011, 05:17 AM
#1
Xtreme2damax Offline
New & Improved
********
Global Moderators
Posts: 3,135
Threads: 91
Joined: Mar 2009
I usually keep a close eye on the forums, so if I missed any explanation I apologize. I'm just wondering what this option does, what benefits it has, what it fixes and what games depend on having this option enabled?
Find
Reply
02-05-2011, 06:04 AM (This post was last modified: 02-05-2011, 06:11 AM by neobrain.)
#2
neobrain Offline
"Wow, I made my code 1000x faster! That means I can make it 2048x slower now!"
**********
Developers (Some Administrators and Super Moderators)
Posts: 3,208
Threads: 50
Joined: Jun 2009
Tooltip:
"Enables reinterpreting the data inside the EFB when the pixel format changes.
Some games depend on this function for certain effects, so enable it if you're having glitches."

...

The most common (non-multisampled) EFB formats used are RGB8 (24 bits per pixel using 8 bits per component), RGBA6 (24 bits per pixel using 6 bits per component) and RGB565 (16 bits per pixel using 5 bits for red/blue and 6 bits for green). Sometimes, games switch between two formats during rendering, Super Mario Sunshine for example switches forth and back between RGB8 and RGBA6 (the only two switches which are implemented right now btw).
The GC/Wii don't do any conversion of the existing data inside the EFB (nor will it be cleared, the data just stays there), the byte data is just kept as it is. E.g. if you switch from RGB8 to RGBA6, the pixels will be "reinterpreted" from R[abcdefgh]G[ijklmnop]B[qrstuvwx] to R[abcdef]G[ghijkl]B[mnopqr]A[stuvwx]. As an example, if the source RGB8 pixel is 0x010101 (R value 1; G value 1; B value 1; no alpha channel), the destination RGBA6 pixel STILL has the value 0x010101 but this maps to 0b[000000][010000][000100][000001] (R value 0; G value 16; B value 4; A value 1; Not sure if I got the component order right, but you get the idea).
Now in Dolphin, we can't emulate this behavior directly: Firstly, the RGBA6 format isn't even supported by Direct3D (not sure about OGL, but I guess it's not supported there either) and second, you can only change texture formats by destroying the current texture and creating a new one (i.e. losing all of the texture's contents). Thus, we are always using an 32-bit RGBA8 buffer for storing the EFB data, which gives us some trouble. Video_Software doesn't have this problem since it just uses the native format (doing sw rendering anyway, so no limitations either Wink ). Apparently no one really noticed since it's somewhat hackish coding to change render target formats DURING rendering and even depending upon the correct hardware behavior for the render results. However, during my ClearScreen changes I noticed that it introduced a little glitch in Super Mario Sunshine. Upon further investigation I found out that the efb format change behavior was the culprit.

So what are we doing when the EFB format change emulation is enabled? Pretty simple actually. We're now keeping two render buffers (two EFBs so to speak) and when the game requests a format change, we copy the originial render buffer to the second (using a special conversion pixel shader which takes care of the byte data reinterpretation) and set the second texture as the active render target. It's quite slow if the game makes heavy use of format changes, which is why I added an option for it (esp. since most games don't depend on this at all but still do many format changes).
Turns out it fixed quite a few other games than just Sunshine by the way Wink

...

Erm, damnit wrote that much again... have fun reading. Tongue
My blog
Me on Twitter
My wishlist on Amazon.de
Find
Reply
02-05-2011, 06:13 AM
#3
elfidge Offline
Junior Member
**
Posts: 7
Threads: 1
Joined: Jan 2011
Thanks NeoBrain, appreciate you taking the time to go in to so much detail - as well as of course - your time spent improving the code.
Any further noobishness shall be reserved for this forum.

Keep up the good work dude!
Find
Reply
02-05-2011, 06:18 AM
#4
boogerlad Offline
Above and Beyond
*******
Posts: 1,134
Threads: 21
Joined: Apr 2009
great explanation. This is what commit logs should look like for new features!
Find
Reply
02-05-2011, 06:52 AM
#5
neobrain Offline
"Wow, I made my code 1000x faster! That means I can make it 2048x slower now!"
**********
Developers (Some Administrators and Super Moderators)
Posts: 3,208
Threads: 50
Joined: Jun 2009
And yet another piece of information without further commentary from my side:
Donko told me that some games (supposedly Wii Sports for example) use this kind of stuff for Depth-Of-Field effects Wink
My blog
Me on Twitter
My wishlist on Amazon.de
Find
Reply
02-05-2011, 07:00 AM
#6
Xtreme2damax Offline
New & Improved
********
Global Moderators
Posts: 3,135
Threads: 91
Joined: Mar 2009
Yeah I was looking for a more in depth explanation tha the tooltip provides, I don't really understand the technical aspect so the in depth explanation helps me understand what exactly the option is for and when it should be used.

Thanks for the explanation. Smile
Find
Reply
02-05-2011, 12:25 PM
#7
Fustigatem Offline
Junior Member
**
Posts: 10
Threads: 5
Joined: Jan 2011
(02-05-2011, 06:18 AM)boogerlad Wrote: great explanation. This is what commit logs should look like for new features!

I 2nd this comment ! very nice to read whats going on, on a project you follow . Instead of trying to squint a thought out of "Fixed windows build"

[Image: duckmansig.jpg]
Find
Reply
02-05-2011, 12:37 PM
#8
ayami6969 Offline
Member
***
Posts: 74
Threads: 6
Joined: Dec 2010
(02-05-2011, 12:25 PM)Fustigatem Wrote:
(02-05-2011, 06:18 AM)boogerlad Wrote: great explanation. This is what commit logs should look like for new features!

I 2nd this comment ! very nice to read whats going on, on a project you follow . Instead of trying to squint a thought out of "Fixed windows build"

I know what u mean. Recently if a build actually finishes compiling I'm like "OMG YEAH IT ACTUALLY BUILT!!!!1"
If the FPS is erratic, this option may help.
Find
Reply
02-05-2011, 12:52 PM
#9
The Hero of Time Offline
Junior Member
**
Posts: 40
Threads: 0
Joined: Oct 2010
I don't think it's a swell idea to critique the devs on their developing techniques.
Find
Reply
02-10-2011, 04:25 PM
#10
SomethingUnknown
Unregistered
 
i think what Fustigatem meant was simply its more informant to read what NeoBrain wrotte,
Rather then read a fast line of info at the download section,
I dont call that a "to critique the devs on their developing techniques"
More like a slight hint that it may need a lil improvement, or atleast a lil clear info on the actuall change.

I second all that, more info is nice, NeoBrain did a good job helping out.......... "gee"


This kind of info helps, thats why im here so *Thumbs Up* NeoBrain
(Now Where is that "Thanks Button"? Cant find it, Hmmmmm!)

Take Care, Ya´ll Peace Out
Reply
« Next Oldest | Next Newest »
Pages (2): 1 2 Next »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode