RPCS3 / rpcs3

PS3 emulator/debugger
https://rpcs3.net/
GNU General Public License v2.0
14.55k stars 1.85k forks source link

rsx: Enable multisampling #6055

Closed kd-11 closed 4 years ago

kd-11 commented 4 years ago
Xcedf commented 4 years ago

Resistance 2 AA Auto E {RSX [0x6c0e4b4]} RSX: Resolve shader:

version 420

extension GL_ARB_separate_shader_objects : enable

extension GL_ARB_shader_stencil_export : enable

layout(std140, set=0, binding=0) uniform static_data{ ivec4 regs[8]; }; layout(set=0, binding=1) uniform sampler2DMS fs0; layout(set=0, binding=2) uniform usampler2DMS fs1; layout(pixel_center_integer) in vec4 gl_FragCoord;

void main() { ivec2 out_coord = ivec2(gl_FragCoord.xy); ivec2 in_coord = (out_coord / regs[0].xy); ivec2 sample_loc = out_coord % ivec2(regs[0].xy); int sample_index = sample_loc.x + (sample_loc.y * regs[0].y); float frag_depth = texelFetch(fs0, in_coord, sample_index).x; uint frag_stencil = texelFetch(fs1, in_coord, sample_index).x; gl_FragDepth = frag_depth; gl_FragStencilRefARB = int(frag_stencil); }

F {RSX [0x7075ab4]} RSX: class std::runtime_error thrown: Verification failed (e=0x7f): (in file c:\projects\rpcs3\rpcs3\emu\rsx\vk\vkrendertargets.h:334)

AA Disabled just

F {RSX [0x7075ab4]} RSX: class std::runtime_error thrown: Verification failed (e=0x7f): (in file c:\projects\rpcs3\rpcs3\emu\rsx\vk\vkrendertargets.h:334)

Same for Killzone 2

kd-11 commented 4 years ago

Resolve shader message is unrelated. I just left it as log_error in case of compilation errors.

Xcedf commented 4 years ago

Well it's just verification fail then, and even if i disable it the game still ends with some error

kd-11 commented 4 years ago

Yea, looks like some files on my end are corrupted; I'm reinstalling some demos and re-running more tests. The verification crash at least is reproducible.

arabek commented 4 years ago

Killzone 2 fails for me too, even after nuking all the caches.

kd-11 commented 4 years ago

Fixed the VkRenderTargets.h crash caused by only testing MSAA x2 during development. MSAA x4 was completely broken which is what killzone 2 is using.

kd-11 commented 4 years ago

Several other issues identified by testers and under investigation (avoid repeating these):

Xcedf commented 4 years ago

Now that's what i always expected Resistance 2 (Native res) master 61 60

MarioSonic2987 commented 4 years ago

Comparisons:

God of War III (E3 2009 Demo) - Minor improvement ![image](https://cdn.discordapp.com/attachments/272875751773306881/587548405287485440/unknown.png) ![image](https://cdn.discordapp.com/attachments/272875751773306881/587548155441315840/unknown.png)
Midnight Club: Los Angeles (200% scaling) ![image](https://user-images.githubusercontent.com/20027681/59053636-2b9fb380-8892-11e9-8902-1d7ed14c0008.png) ![image](https://user-images.githubusercontent.com/20027681/59053641-2d697700-8892-11e9-8c53-3e46affffd8b.png)
Racedriver: Grid (200% scaling) ![image](https://user-images.githubusercontent.com/20027681/59353133-95044400-8d22-11e9-99a4-0ab7d0b9e167.png) ![image](https://user-images.githubusercontent.com/20027681/59353144-9b92bb80-8d22-11e9-9dd9-a08e731f9a1a.png)
Red Dead Redemption (200% scaling) ![image](https://user-images.githubusercontent.com/20027681/59052057-846d4d00-888e-11e9-88f0-1a03741a44d8.png) ![image](https://user-images.githubusercontent.com/20027681/59052064-8800d400-888e-11e9-8be6-96fe164c5712.png)
Tekken Tag Tournament 2 ![image](https://user-images.githubusercontent.com/20027681/59048690-b37fc080-8886-11e9-9036-37bfc5799755.png) ![](https://cdn.discordapp.com/attachments/272875751773306881/586222252127813632/unknown.png)
Uncharted 2: Among Thieves ![image](https://cdn.discordapp.com/attachments/272875751773306881/586254385105993729/unknown.png) ![](https://cdn.discordapp.com/attachments/272875751773306881/586254405909741599/unknown.png)
Kravickas commented 4 years ago

Crysis Approve 👍 pr master

stride21 commented 4 years ago

Master: Master Ratchet PR: ratchet pr Master: resis master PR: resis 3 pr fixed

MsDarkLow commented 4 years ago

MSAA seems to work as intended in 4. However, I noticed a difference in colors in Yakuza 3, 4 and Ishin, they seem to show up incorrectly.

Yakuza 3 (Doesn't seem to support MSAA) Master ![Y3Master](https://user-images.githubusercontent.com/9060436/59065876-a920ef00-88a5-11e9-91a0-9d9188c7e6a6.png) PR ![Y3](https://user-images.githubusercontent.com/9060436/59065883-ab834900-88a5-11e9-8ef8-90a79377ae1a.png)
Yakuza 4 Master ![Y4Master](https://user-images.githubusercontent.com/9060436/59065974-dff70500-88a5-11e9-89df-83b387e92b66.png) PR MSAA ![Y4Msaa](https://user-images.githubusercontent.com/9060436/59065977-e1283200-88a5-11e9-9b7e-b5681947e18c.png) PR ![Y4](https://user-images.githubusercontent.com/9060436/59065984-e5544f80-88a5-11e9-96fd-41b4d134b750.png)
Yakuza Ishin (Doesn't seem to support MSAA???) Master ![IshinMaster](https://user-images.githubusercontent.com/9060436/59066359-c6a28880-88a6-11e9-9eec-1027ec49b1df.png) PR MSAA ![IshinMsaa](https://user-images.githubusercontent.com/9060436/59066374-d3bf7780-88a6-11e9-9270-fad21f8c8e6b.png) PR ![Ishin](https://user-images.githubusercontent.com/9060436/59066376-d5893b00-88a6-11e9-917f-de1c5fae965e.png)
e1489 commented 4 years ago

;=; how do I try this?

Artins90 commented 4 years ago

;=; how do I try this?

Click show all checks below. Select details near appveryor Open artifacts and dowload the 17MB file The antialising option is in the GPU options section, select auto to activate it.

raven02 commented 4 years ago

D3D12 renderer selection box will be removed as well ?

AniLeo commented 4 years ago

d3d12 is not yet fully removed

kd-11 commented 4 years ago

@MsDarkLow

However, I noticed a difference in colors in Yakuza 3, 4 and Ishin, they seem to show up incorrectly.

Maybe show the differences clearly? I cannot spot any differences since I'm not familiar with those games. There are some tweaks to the fragment decompiler based on hardware testing on a PS3, but I still have doubts as to the accuracy; if the commit is wrong compared to PS3 I can revert it from the PR and submit it separately at a later date.

anseesaw commented 4 years ago

What does this mean for d3d12,Improve or delete? 1 2

RainbowCookie32 commented 4 years ago

DX12 isn't being improved. I'd say that we are one step closer to removal with this PR (I think)

MarioSonic2987 commented 4 years ago

TTT2 still crashes in Fallen Garden with MSAA enabled: Log TTT2 Broken 2

Killzone 2 has flickering shadows and blurred graphics.

Master: image

This PR: image

MsDarkLow commented 4 years ago

@kd-11

Maybe show the differences clearly? I cannot spot any differences since I'm not familiar with those games. There are some tweaks to the fragment decompiler based on hardware testing on a PS3, but I still have doubts as to the accuracy; if the commit is wrong compared to PS3 I can revert it from the PR and submit it separately at a later date.

I got a better scenario with Ishin which is way more clear. Took screenshots in the main menu including how it looks on a PS3.

Yakuza Ishin PS3 ![PS3_Like_A_Dragon_Ishin](https://user-images.githubusercontent.com/9060436/59145665-f2c12500-89de-11e9-8780-9a70c37891f0.png) Master ![IshinMaster](https://user-images.githubusercontent.com/9060436/59145671-fb196000-89de-11e9-84df-70cde65413d5.png) PR (both OpenGL & Vulkan look like this) ![IshinPR](https://user-images.githubusercontent.com/9060436/59145679-02d90480-89df-11e9-8590-13150473ed66.png)
kd-11 commented 4 years ago

@MsDarkLow I changed the decompiler again about an hour ago; need new comparison with the updated code.

MsDarkLow commented 4 years ago

Looks relatively the same. image

kd-11 commented 4 years ago

I'll have to check it in a regression tracker; its highly unlikely to get resolved in this PR.

Artins90 commented 4 years ago

Looks relatively the same.

Maybe it's hard to notice without a screen with good color reproduction. In the PS3 and master images there is a yellow glow on the character and the blue of the sky is less dark. Maybe it has something to do with post processing.

In this other image the top part of the wall on the left side of the screen has a faint blue tint: https://user-images.githubusercontent.com/9060436/59066374-d3bf7780-88a6-11e9-9270-fad21f8c8e6b.png

Margen67 commented 4 years ago

Water isn't rendered when anti-aliasing is enabled in Bigduck Sample: On image Off image

Sandvichero commented 4 years ago

Nier has incorrect colors in this pr. LOG

Master: Nier Master

PR: Nier PR

raveskirza commented 4 years ago

Regression in SC5

Characters are messed up with AA on/off image

In Master, Characters look fine

MarioSonic2987 commented 4 years ago

RDR has missing lamps with MSAA enabled.

Images **Master**: ![image](https://user-images.githubusercontent.com/20027681/59200478-9efa3b80-8b98-11e9-8fc3-e4b0416adba0.png) **PR (MSAA disabled)**: ![image](https://user-images.githubusercontent.com/20027681/59200481-a1f52c00-8b98-11e9-87c7-1e8a22fb884a.png) **PR (MSAA enabled)**: ![image](https://user-images.githubusercontent.com/20027681/59200483-a4f01c80-8b98-11e9-80c7-4130c2a1bd87.png)
AizerMortenort commented 4 years ago

Getting Exception errors RPCS3.log

AizerMortenort commented 4 years ago

Desktop Screenshot 2019 06 10 - 19 13 58 39 Here is the error of the crash i get

kd-11 commented 4 years ago

I have dropped the shader decompiler fixes for now. I'll submit in a separate PR as the issue seems to require more testing. Should fix the graphics glitches in Yakuza and Soul Calibur back to matching master.

darkdragonz12 commented 4 years ago

soul Soulcalibur V Fix lastcommit

GreyWing3 commented 4 years ago

Eternal sonata over-blooming with anti-aliasing on. No issues with it off

Screenshot 2019-06-10 20 44 52

MarioSonic2987 commented 4 years ago

RDR now renders fine without MSAA, but lamps are still missing with MSAA.

RDR regression ![image](https://user-images.githubusercontent.com/20027681/59288152-624f4280-8c73-11e9-815c-ec22dc955057.png) ![image](https://user-images.githubusercontent.com/20027681/59288158-64b19c80-8c73-11e9-846f-68b722d4596d.png)

Killzone 2 regression is still present (is caused by MSAA on), but renders fine (like master) without MSAA.

Killzone 2 ![image](https://user-images.githubusercontent.com/20027681/59288487-32546f00-8c74-11e9-91d5-cff71834f808.png) ![image](https://user-images.githubusercontent.com/20027681/59288630-84959000-8c74-11e9-84f0-ae3757ec68df.png)
kd-11 commented 4 years ago

Pushed a few more fixes. 3D and cubemaps (reflections) are still broken in some corner cases; I'm working on that.

MarioSonic2987 commented 4 years ago

Lamps are now fixed in RDR with MSAA.

image

Killzone 2 regression is now fixed. image

But Racedriver: Grid still has this "repeated" image with MSAA and no longer reaches title screen without MSAA: image

Log Grid Broken (w/o MSAA)

Aurez commented 4 years ago

Thanks! Most of my games are working well and better than before :) But TTT2 is still crashing

kd-11 commented 4 years ago

@MarioSonic2987 I don't have the repeating image. image

GreyWing3 commented 4 years ago

Eternal sonata fixed

MarioSonic2987 commented 4 years ago

RenderDoc Grid (Broken)

kd-11 commented 4 years ago

@MarioSonic2987 Retest please.

MarioSonic2987 commented 4 years ago

Now looks correct with MSAA and can reach title screen without MSAA. image

kd-11 commented 4 years ago

@Aurez Confirm if TTT2 crash is fixed.

legend800 commented 4 years ago

Crowd is missing again on Backbreaker Vengeance. I actually prefer it this way since they're only half rendered on Master, but just letting you know since it's an accuracy thing.

PR (AA on/off): pr

Master: 2019-06-12 08_30_22-

Margen67 commented 4 years ago

Bigduck Sample is now rendering correctly with MSAA enabled.

Aurez commented 4 years ago

Just tested again and TTT2 is still crashing Image RPCS3.zip

Parthorisian commented 4 years ago

msaa Disabled and Auto SH: Downpour [BLUS30565]: master - goes ingame(sometimes)/menu b02 PR - nothing SH_Downpour_RPCS3.ZIP b03 WET [BLUS30403]: master - goes ingame(sometimes)/menu b11 PR - nothing WET_RPCS3.zip b05 Ninja Gaiden Sigma 2 b05 b04 Ninja_Gaiden_Sigma2.zip

kd-11 commented 4 years ago

Those issues seem unrelated. The last one is a crash in main_thread for example. Also, SH Downpour works just fine. image

kd-11 commented 4 years ago

@Aurez Install the vulkan SDK from here: https://vulkan.lunarg.com/sdk/home#windows After that, go to debug settings for the game and enable "debug output" option and run the game. You'll know if it works because your fps should be terrible. Play the game as usual, when it crashes, attach the logfile here. It's the only way to actually debug a DEVICE_LOST error.