June 2015 Progress Report
#1

image description


As promised in last month's update, welcome to PCSX2's very first monthly progress report! Sorry that it's a bit later than I had said - totally my fault! Let's start things off with a bang, shall we? A question that often gets asked on the forum to a surprising degree is a variation of the following: “How can I get XYZ Snowblind engine game working in hardware mode?” the answer up until very recently was “You can't, use software mode and expect it to be ridiculously demanding.” For those of you unfamiliar with it, the Snowblind engine was used for games like Baldur's Gate: Dark Alliance, Champions of Norrath, Champions: Return to Arms, and a few miscellaneous others. The Snowblind engine does some pretty crazy stuff on the PS2, like using 2x Super Sample Anti Aliasing! Because of that, it's very demanding and even ultra powerful rigs would have issues running these games in software mode. Running them in hardware mode would result in only half the screen being visible because of the way the engine achieves the 2x SSAA.

GSdx: Hardware rendering Snowblind Game fix by Gregory & Refraction.

However the situation has changed drastically thanks to Gregory. Snowblind engine games are now supported in hardware mode! Now these popular games can be enjoyed in HD resolutions and without owning a super computer! It is important to note however that they are still relatively demanding, just not quite as much as before.

Aside from that, June has once again seen a host of GSdx improvements! Most of these improvements have been on the accuracy side of things this time, with Gregory taking on the GS and Refraction taking on the VU. There is quite a lot to cover, so let's get started!

GSdx: Usage of programmable blending instead of fixed blending by Gregory

To understand the following issues and their solutions, you must understand the difference between Fixed function and Shader based function.

With Fixed function programming, as the name suggests, the functionality is fixed and hence it's not very flexible to work with when trying to emulate the GS, which is not at all similar to a normal GPU.

Here's an example comparing clamping behavior of a normal GPU and the GS:

Channel colors are coded in the 0-255 luminance range. There are four channels - red, green, blue, alpha. Also it's important to remember that the output of the blending unit can be out of the valid range. Normally this is no problem - a GPU will clamp it. But things get a little different in the case of the GS which also wraps it.


Standard GPU
Blending unit (Output)Result
-10 0
300 255


Graphics Synthesizer
Blending unit (Output)Result
-10 246
300 44

In order to remedy this discrepancy between GS and standard GPU behavior we are using a shader that emulates the blending in a proper way with respect to the GS, instead of the fixed function unit of the GPU. However, wrapping is only one difference between the GS and GPU - there are still a lot more differences. Here is a graphical breakdown of the difference between the GS and a GPU in this regard:

Note: Standard GPU behavior is a bit more complex, the diagram is only made to showcase how PCSX2 deals with some of the differences between the GS and a GPU.

[Image: gpu-gs-chart_s.png][Image: gpu-gs-chart2_s.png]

Since we have already seen examples of accurate blending in our previous developer blogs and accurate color clipping was explained just now, all that's left is the accurate framebuffer mask.

The standard GPU blending unit allows masking the shader output only channel by channel. The problem is that as the image shows, the GS can do it bit by bit. Yes, that means it's possible to write only the most significant bit of the channel on the GS. Again this issue can be solved by using a shader to emulate this feature instead of doing it on the fixed function unit of the GPU. Accurate frame buffer mask is just a feature for handling bit masking instead of channel masking. It's important to note that the new features which use shaders in place of the fixed function unit do so at the expense of some speed. High end machines should have no problems, but people with weaker machines may experience some slowdown when using a lot of the accurate options.

Now let's take a look at how some of the games look with a shader that properly emulates blending [Accurate options enabled] compared to normal GPU Blending [Accurate options disabled].

[Image: fbmask_fixed_s.jpg][Image: fbmask_broken_s.jpg]

[Image: castlevania_fixed_s.jpg][Image: castlevania_broken_s.jpg]

[Image: moh_fixed_s.jpg][Image: moh_broken_s.jpg]

[Image: nemo_fixed_s.jpg][Image: nemo_broken_s.jpg]

[Image: fifa_street_fixed_s.jpg][Image: fifa_street_broken_s.jpg]

[Image: hulk_fixed_s.jpg][Image: hulk_broken_s.jpg]

Lastly, it should be noted that accurate date isn't the same as the other accurate options. Accurate date implements an even more accurate algorithm to compute GS destination alpha testing.

The only drawback of the current situation is that there are lots of settings for the user to tweak in order to check which accurate option helps with which game. This will be changing in the future, since Gregory is currently working on a branch merging all the separate options into a single one called "Blending Unit Accuracy" with different modes with respect to it's accuracy and impact on performance. You can follow the progress here.


Log message and Title bar for showcasing Renderer change by Turtleli & ssakash.

[Image: gsdx_renderer_displ.png][Image: gsdx_console_displ.png]


The following feature had been requested a few times but was very low priority, since the setting could easily be identified by taking a look at the GSdx Plugin settings. But this wasn't actually as simple a case as it could have been. There is a Shortcut key (F9) for toggling the mode of a specific renderer from software to hardware mode. Using said shortcut key and changing the renderer in the plugin settings can lead to a lot of confusion and keeping track of what's what can get messy. Because of that the title bar status was added by Turtleli and the console message was added by ssakash.

Relevant PR:

Stuart Little 3: VIF-MFIFO Stall Issue & Dev9ghz: Unique MAC by Refraction.

This issue was a regression which happened sometime between 1.0.0 and 1.2.1. The issue was quickly fixed by Refraction.

The issue was actually caused by a VIF interrupt firing on a "Wait for GS Paths" instruction before the flushing was complete which caused the emulator to hang. The condition check has been made a lot more stable now so such issues should never happen again.

In some unrelated work, there was an issue while using the Dev9ghz plugin where users were being kicked from online servers because of having similar MAC address. This was fixed by generating a unique MAC based on the host's MAC address.

Relevant commit:

Dev9ghz: Improvement in Log file handling by TheLastRar.

Previously the Dev9ghz plugin used the system registry for saving settings. This has now been replaced by usage of an .ini file like all the modern plugins. Furthermore, the plugin looks in the registry for old settings and if it finds them, they are imported into an .ini file and then deleted from the registry.

There were also instances of crashing when the ethernet adapter was not selected, this was fixed by TheLastRar by using a conditional statement.

Relevant PR:
Custom Patches to fix game crashes/hangs by prafull

The number of PS2 games playable with PCSX2 has vastly increased over the years but there are still some games which crash/hang at the Intro scenes/Menus/Ingame and as a result are considered "Unplayable" in the game database. Accurate debugging to find the conflict takes time, but of course developers intend to fix them properly in the future. In the mean time some of these unplayable games are now playable in PCSX2 using custom patches. Such a custom patch might not seem like an ideal solution from a developer's perspective, but it will surely be good news for users who were waiting to play these games.

Games that have become playable with patches this month include:
  • Spongebob Squarepants - The Movie
  • Neo Contra
  • World Rally Championship 3
  • The Incredibles
  • The Incredibles - Rise of the Underminer
  • Dead or Alive 2 Hardcore
  • NHL 2K8


These new patches have been merged into the GameDB so that every user can make use of them by enabling "Automatic Gamefixes" option when playing the game. This option is enabled by default. The patch is applied by matching the game's serial with the list present in our database. Thanks to Prafull for spending countless of nights fixing these games. You can check the progress on the patches here.

Lastly, a brief mention of something exciting. Along with these changes, GSdx was bumped to version 1.0. On the OGL side of things, this negated the need for a lot of game specific hacks. Once someone ports those changes to the DX backend, those hacks can be removed entirely! Exciting stuff!

Thanks to all the GIT contributions during the month of June and to all the active testers who encourage development to continue!
[Image: XTe1j6J.png]
Gaming Rig: Intel i7 6700k @ 4.8Ghz | GTX 1070 TI | 32GB RAM | 960GB(480GB+480GB RAID0) SSD | 2x 1TB HDD
Reply

Sponsored links

#2
Thanks for the the report! I agree it's hard to figure out which "accurate" options you have to select, for a game to run optima-forma (and I don't want to enable accurate options which lead to performance loss, without any benefits). Therefor, the "Blending Unit Accuracy" with different modes would be great! Seems like a challenge to make default settings for a "group" of games, but I totally think Gregory is up for the challenge Smile

Good stuff!

edit: would be great to be able to click on the comparison pictures for a fullsized version; they're kinda small now
Reply
#3
(07-26-2015, 08:54 AM)bankai Wrote: edit: would be great to be able to click on the comparison pictures for a fullsized version; they're kinda small now

right click >>View Image and it should display the original size of the Image.
We're supposed to be working as a team, if we aren't helping and suggesting things to each other, we aren't working as a team.
- Refraction
Reply
#4
(07-26-2015, 08:54 AM)bankai Wrote: edit: would be great to be able to click on the comparison pictures for a fullsized version; they're kinda small now

You can see some larger images in the main article on the site by clicking on them:
http://pcsx2.net/270-june-2015-progress-report.html

Or directly in the post with right click -> view image(in Firefox, should be similar in others).

The images are fullsize in post, but reduced with arguments to the image tag. In my last report I left them fullsize and let the software auto resize, but I got some complaints on them being too big XD

Edit: ninja'd by ssakash
[Image: XTe1j6J.png]
Gaming Rig: Intel i7 6700k @ 4.8Ghz | GTX 1070 TI | 32GB RAM | 960GB(480GB+480GB RAID0) SSD | 2x 1TB HDD
Reply
#5
+1 Finally we can start the 'when do we get the july report????'-nagging Tongue2
Reply
#6
All images are now clickable and thumbnails are loaded from the website Wink
[Image: newsig.jpg]
Reply
#7
(07-26-2015, 08:54 AM)bankai Wrote: Thanks for the the report! I agree it's hard to figure out which "accurate" options you have to select, for a game to run optima-forma (and I don't want to enable accurate options which lead to performance loss, without any benefits). Therefor, the "Blending Unit Accuracy" with different modes would be great! Seems like a challenge to make default settings for a "group" of games, but I totally think Gregory is up for the challenge Smile

Yes the idea is to select between speed or accuracy.

Good news, I manage to greatly reduce the speed penality of accurate_colclip Smile So the choice will be easier in the future Tongue2
Reply
#8
Great progress. Where is the "automatically managed Folder Memory Card" feature? Or is it coming next report?
Reply
#9
Next one Wink
[Image: newsig.jpg]
Reply
#10
Thank you very much for the report.

(07-26-2015, 05:06 AM)Blyss Sarania Wrote: Now let's take a look at how some of the games look with a shader that properly emulates blending [Accurate options enabled] compared to normal GPU Blending [Accurate options disabled].

Only for OpenGL?
Reply




Users browsing this thread: 3 Guest(s)