PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.78k stars 1.63k forks source link

[GSdx hardware regression] Distorted icon texture in War of the Monsters' character select menu. #1269

Closed Aced14 closed 8 years ago

Aced14 commented 8 years ago

PCSX2 version:

PCSX2 options: Defaults. No options modifications affect this issue.

Plugins used: Defaults (GSdx32-AVX, LyliPad, SPU2-X, cdvdGigaherz, USBnull, FWnull and DEV9ghzdrk). No particular plugins affect this issue.

Plugin settings: GSdx (Direct3D11/OpenGL hardware modes).

Description: While doing research in the lead-up to issue #1267, I noticed a distorted icon texture in my "good" screenshot of War of the Monster's character select menu. Specifically, the third character select icon looks black/distorted. It's supposed to look like a praying mantis. I determined it wasn't related to #1267 and set out to create a separate issue for it.

It should be noted that this issue can only be observed by enabling one of GSdx's hardware renderers before booting War of the Monsters. Toggling between renders at runtime (even re-initializing the same hardware renderer the game was booted with) will fix the distorted texture.

The commit that introduced this regression is from July 1, 2015. The automated build for that day's first commit is fine. At the end of the day (51 commits later), this regression was in place. Unfortunately, there are only 3 automated builds available from that day. One is for that day's first commit. The other 2 are for that day's final 2 commits. Here's a list of all 51 relevant commits and what they changed.

To resolve this, a developer will need to pinpoint the specific commit or recognize a change that could've caused it amongst the aforementioned commits. It's probably something minor, given that all the other character select menu's icons appear properly and since re-initializing the same renderer at runtime fixes it.

Screenshots:

How to replicate:

  1. Launch PCSX2.
  2. Open GSdx's plugin settings, select Direct3D11 or OpenGL's hardware renderer.
  3. Fast boot the game.
  4. Skip the intro FMVs and select "1 Player - adventure".
  5. The third monster's icon will appear to be solid black in OpenGL. In Direct3D11, it'll look like a pixelated orange-to-black gradient.
  6. Step 5 didn't work as expected. The third icon is supposed to resemble a praying mantis.

Last known version to work: v1.3.1-590-gcd8e31d (2015-07-01; 35081f922a08d5069e9e1f4c66a2b9f140f5ef97).

PC specifications: CPU: Intel Core i7 2600K @ 3.4GHz; GPU: XFX Radeon HD 6970 2GB; OS: Windows 7 SP1.

Other comments: @gregory38 @refractionpcsx2 FYI :). Looks like you two were responsible for virtually all of July 1, 2015's commits.

gregory38 commented 8 years ago
To resolve this, a developer will need to pinpoint the specific commit or recognize a change that could've caused it amongst the aforementioned commits. It's probably something minor, given that all the other character select menu's icons appear properly and since re-initializing the same renderer at runtime fixes it.

It would be very helpful if you can manage to build PCSX2 yourself and find the bad commit. (yes I know, I'm asking a lot).

In the meantime, could you

refractionpcsx2 commented 8 years ago

I'm sure all the builds will probably be available on the buildbot, it's a good idea to go there and look at the full list and try some builds to try and narrow it down.

willkuer commented 8 years ago

I don't think they are available. The buildbot skips revisions that are already outdated when he starts compilation. I could as well only find the version mentioned by op. Unfortunately we didn't have appveyor at that time.

I think compilation is the only possibility here.

refractionpcsx2 commented 8 years ago

I don't think they are available. The buildbot skips revisions that are already outdated when he starts compilation. I could as well only find the version mentioned by op. Unfortunately we didn't have appveyor at that time.

They are there, it goes back to 1.2.1 and they do download, just the descriptions are missing. so he will need to find out the short hash for the first commit in that period and search it on that page

turtleli commented 8 years ago

Well, it's a good thing I was experimenting with AppVeyor quite a while back, and the GSdx 1.0 PR (#628) just happened to be one of the things I was playing around with.

I built GSdx for each commit in the PR (+ memleak fix 8be32e4 when relevant), which is available at https://ci.appveyor.com/api/buildjobs/yl3xiduttwo791c2/artifacts/gsdx-plenty.7z (01 = latest PR commit, 50 = oldest PR commit).

Aced14 commented 8 years ago

@gregory38 Long ago I partially setup PCSX2's build system locally, but IIRC I ran into a few issues and haven't gotten around to resolving them as of yet.

Regarding your suggestions, I went through them all v1.5.0-dev-504-gf6ee945 (2016-03-28; f6ee94589ffe86ff61d72cf33a425fdf3bc93d4d):

@refractionpcsx2 Orphis' build bot doesn't build every single commit. As @willkuer mentioned, if multiple commits are made in quick succession, automated builds for older commits get skipped. This can sometimes leave large gaps between build revisions, especially in this case (50 commits came in one shot via PR #628).

I don't mean to rant too much about it, but it's really difficult to find and associate older Orphis builds to commits. For starters, the hashes beside its builds' revision numbers differ from the "real" commits on GitHub - even for the latest commits. That's not a big deal for newer builds, since authors/timestamps/commit messages are listed in the same rows. But for older commits, it's a nightmare because none of that kind of information is listed. It leaves very little to go on. While researching this issue, I ended up needing to download each older build to check their file modified dates (to get an idea as to which commits they were related to).

On another note, older Orphis builds aren't sorted properly. They're not in descending order. v1.2.1 and v1.3.1 builds are seemingly randomly intermixed with one-another. While researching, to get a descending order of older builds, I had to copy this whole table into LibreOffice Calc, make up a regex to insert leading zeroes into build numbers that contained fewer than 4 digits, then sort all the rows. Not very user-friendly :(.

@turtleli Thanks :)!!! It first started in Gsdx32-SSE2-23-4a65e5e.ddl from your 7-Zip archive. So, with that in mind...

First commit that introduced the regression: 85543db094af490a7b1dc3b2bfb3087cde92d9cb (2015-06-25).

Last known commit that worked: 4a65e5e723a9d58b1079803fccb9aca125426147 (2015-06-25).

willkuer commented 8 years ago

Building on your own is much easier after the build clean up of turtleli and micove (and possibly others). You should make sure to get the community version over the express version.

refractionpcsx2 commented 8 years ago

@Aced14 to give us a range, what is the first known broken commit you have there?

turtleli commented 8 years ago

Just to clarify since your post states it first started in 4a65e5e but you also state that commit as the last working commit:

gregory38 commented 8 years ago

I did a quick test on the dump. As I was afraid, I didn't manage to reproduce it :(

FlatOutPS2 commented 8 years ago

I didn't manage to reproduce it with the dump either, but I did see a similar regression when using a GSdx from one of the previous commits of the "black fmv" pull request(two or three commits ago, the latest is fine). Using that all but two of the character portraits turned black, not just the praying mantis.

gregory38 commented 8 years ago

Hum, just to be sure for the bad commit, Could someone test this small revert ? GSTextureCache.cpp around line 138. Replace

uint32 t_psm = (t->m_dirty_alpha) ? t->m_TEX0.PSM & ~0x1 : t->m_TEX0.PSM;

by

uint32 t_psm = t->m_TEX0.PSM;

The dirty alpha trick is enabled for for 24 and 16 bits buffer. Maybe we need to reduce it to 24 bits buffer only.

Aced14 commented 8 years ago

@willkuer I'll probably attempt to fully set myself up to properly compile my own builds in the near-future.

My previous attempt was in late March 2014 with Visual Studio 2010 Express. PCSX2's debugger was only available within debug builds back then and I was dying to try it out. I only partially setup some things needed for compilation. Was able to compile... but some plugins were missing and I ran into runtime errors that lead me to believe I botched it. A short time later, PCSX2's debugger became available by default in Orphis builds, so I stopped looking into it.

What's so advantageous about VS Community edition compared to Express? Would I only be capable of compiling recent commits with it? Where would I stand for compiling much older commits (like from as far back as ~2012) if I need to hunt down other older regressions?

@refractionpcsx2 @turtleli Sorry, my bad :(. 85543db094af490a7b1dc3b2bfb3087cde92d9cb is broken and 4a65e5e723a9d58b1079803fccb9aca125426147 is working.

@gregory38 If no one else has tried it before I become capable of properly compiling my own builds, I'll give it a shot and follow up. Might take a few days...

gregory38 commented 8 years ago

Check the PR #1271 , appveyor bot will provide build

mirh commented 8 years ago

@Aced14 VS community is pretty different from express. You get everything needed for a normal user and even more. On the other hand I remember Express versions often lacked some tools and even required specific workarounds.

Thankfully it's still free. And if you care for older builds I guess 2013 version should fit you better. As for difficulty, seriously the most difficult thing is adding include/libraries folders whenever it cannot find them (remember you'll need DX SDK). It's as simple as download and compile otherwise.

refractionpcsx2 commented 8 years ago

VS community is pretty different from express

Yep, Community is essentially a "Here have a full version of Visual Studio for free, just don't make loads of money else we will be after you" version.

Aced14 commented 8 years ago

@gregory38 I just tried out v1.5.0-dev-515-g39947de-master-776-vs2013-Win32-AppVeyor. Didn't improve things :(. I tried with both the DX11 and OGL hardware renderers. The character select menu still looks identical to the OP's GSdx hardware screenshots.

@mirh @refractionpcsx2 Thanks :). I'll give it a shot. Btw would there be any value if I installed both? 2013 for older stuff and 2015 for the absolute latest commits?

willkuer commented 8 years ago

First of all you probably don't need to compile newer versions if you don't plan developing yourself. We are using appveyor to build all pull requested branches. So everything that is considered to be valid is already compiled. Seldomly gregory asks people to compile by themselves for stacktraces or test of patches he can not do himself. So nothing to consider now.

The orphis buildbot provides a lot of relevant builds and is 95% of the time sufficient. For older builds i would use vs 2013 express as this was supported for a long time. I think older versions (maybe before pcsx2 1.2.1 - but unsure) don't support vs 2015 natively.

mirh commented 8 years ago

Pleease. VS 2013 has a community edition too. Don't recommend half assed tools.

And functionally, there shouldn't be any difference with VS 2015. EDIT: which iirc is supported only since #595

Aced14 commented 8 years ago

@willkuer @mirh Thanks :). I'm now capable of compiling my own builds in VS2013.

Aced14 commented 8 years ago

@refractionpcsx2 Any chance a Regression label could be added to this issue?

refractionpcsx2 commented 8 years ago

There you go.

Aced14 commented 8 years ago

@refractionpcsx2 Thanks :)!

MrCK1 commented 8 years ago

@Aced14 Any update on this?

Aced14 commented 8 years ago

@MrCK1 I just gave 86a6f5d67cfb75350d7019441d9fd0d5fdf4ccd8 a shot. It's now working fine in both Direct3D11 and OpenGL's hardware renderers.

@gregory38 Thanks :)! I presume #1605 fixed it.