RPCS3 / rpcs3

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

BLJM60571 Texture Corruption #8150

Open tobyc11 opened 4 years ago

tobyc11 commented 4 years ago

Quick summary

Untitled

Details

The texture is in B8G8R8A8_UNORM and optimal tiling. The fragment shader just samples the texture straight onto screen, so it shouldn't be the shader's problem. This looks like a texture format issue to me, but I don't know how RSX works so I am not sure.

I don't have time to dig down further, but I hope the corruption pattern will ring a bell to people who are familiar with RSX like @kd-11.

kd-11 commented 4 years ago

I need more context, e.g which title is this? Also need some logs and RSX capture. Note that RSX has its own tiling format, but it is unlikely to break like this as a decoder for it is fully implemented.

tobyc11 commented 4 years ago

It's a 2D Japanese visual novel, which only renders sprites.

The full log of a few minutes of gameplay and the RSX capture is here: logandcapture.zip

Also, this is what that texture normally should look like, and to the right is the correct framebuffer result: normal_renderdoc

Thanks for looking into this if you've got time.

kd-11 commented 3 years ago

The texture in question is marked as swizzled during rendering, but is actually stored in linear format.

tobyc11 commented 3 years ago

Lol that clarifies a lot. Thanks!

kd-11 commented 3 years ago

The swizzle operation is not being done using blit engine and is loaded straight from memory as-is, but the texture configuration registers are clearly expecting a swizzled input, right down to pitch not being set. There are only two ways to use the PS3 GPU to swizzle, one being blit engine and the other being swizzled RTTs. Ofc we cannot do swizzled RTTs on PC, at least not in user space without some extra work being done. I could not find any commands relating to this however, but it is possible that this is done once when the program first loads and the generated textures reused throughout.

kd-11 commented 3 years ago

Just to update, I was right, the game is using a swizzled raster to generate the texture but we only support linear readback. I haven't had time to complete the fix, but it should be finished soon.

kd-11 commented 3 years ago

Should be fixed by https://github.com/RPCS3/rpcs3/pull/8664

RainKikyou commented 3 years ago

still have some errors, but most of errors are fixed The character problem under the following should happen randomly QQ截图20200802213242 QQ图片20200802214356 QQ截图20200802215657

kd-11 commented 3 years ago

This is a completely different problem now, looks like broken synchronization to me. I'll get back around to this at some point.

kd-11 commented 3 years ago

Retry with https://github.com/RPCS3/rpcs3/pull/8696 which fixes some problems with the last patch. If that doesn't fix it, at least provide a save for this game as it is torture trying to get ingame every time you change something in the code.

RainKikyou commented 3 years ago

very strangely, I tried rsx caputure, but it turned out to be correct to open rsx caputure QQ图片20200809083527 QQ截图20200809084135

i save the savedata in here QQ图片20200809083812 QQ截图20200809083806 QQ图片20200809085821

this rsx caputure+ savedata https://drive.google.com/file/d/1zBA8_2Ii4hxbNXHu09q4HiNi6hE6zSIM/view?usp=sharing

kd-11 commented 3 years ago

Please retest this. The texture subsystem has been rewritten since the last time I touched this issue.

kd-11 commented 3 years ago

Closing. Request to reopen if you can still reproduce.

13xforever commented 1 year ago

it's still an issue unfortunately image

with opengl image

in the prologue it's one specific scene with one specific animation, same character will look fine after few dialog lines

log with several runs (vk normal, vk in strict mode, ogl in strict mode) RPCS3.log.gz

Triticum0 commented 6 months ago

Retested with v0.0.30-15914-2a1af17f. No changes

granderx commented 6 months ago

Still got the same problem, keep waiting