New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSX: Bug fixes and improvements #3458

Merged
merged 15 commits into from Sep 21, 2017

Conversation

Projects
None yet
@kd-11
Copy link
Contributor

kd-11 commented Sep 17, 2017

  • Fixes for backbuffer blits and complete removal of the flip hack when using openGL
  • Implementation of blit engine in hardware for vulkan backend
  • Reorganization of frame storage and heap management for vulkan [WIP, slight performance degradation]
  • RSX thread recovery in the event of an unknown command [WIP, still dies/loops infinitely if unmapped addresses are provided]
  • Unified texture cache for vulkan and openGL. This means that any bugs fixed for one backend should carry over making development easier
  • Removal of redundant classes in openGL and general cleanup of the texture framework for that backend. There were 2 separate texture classes for example with very different approaches which was awful
  • Implements draw call batching for the slow games that would throw thousands of small draws at the hardware. Significantly speeds some some games. There is an AMD driver bug that will cause missing graphics but I have reported this upstream.
  • Adds support for split draw ranges which would otherwise assert in RSXThread
  • Fixes for some shader decompiler bugs (DBZ Raging Blast games)
  • Improve mesa compatibility for openGL

This is alot of new code so take your time testing. Try not to report duplicates to make my work a little easier.

@alex88510

This comment has been minimized.

Copy link

alex88510 commented Sep 17, 2017

With this PR, Trails of Cold Steel shows black screen with GPU texture scaling ON.
This game needs GPU texture scaling or Write Color Buffer to shows graphics properly.
I tried with Write Color Buffer ON but still showing black screen.

capture

RPCS3.log1.gz

Vulkan with Write Color Buffer ON is still showing black screen.
It is working fine on master.

@Sylfayn

This comment has been minimized.

Copy link

Sylfayn commented Sep 17, 2017

With this, Persona 4 Arena shows a black screen on both Vulkan and OpenGL and seems to freeze completely after the opening video in OpenGL.
RPCS3.log.gz

@Illynir

This comment has been minimized.

Copy link

Illynir commented Sep 17, 2017

Nier doesn't works on this PR, black screen with 0 FPS and nothing. On OGL and Vulkan, with and without GPU scaling. With and without shader cache.

image

On master it's good.

RPCS3.zip

Emulator is also very unstable, crash often, always in background after closing, etc...

@Illynir

This comment has been minimized.

Copy link

Illynir commented Sep 17, 2017

ON KH 1 with GPU texture scaling ON with Vulkan:

image

Without it's good however but i'm saying it just in case.

@MarioSonic2987

This comment has been minimized.

Copy link

MarioSonic2987 commented Sep 17, 2017

image
image
image

Fixes blackscreen regression in Worms 2: Armageddon, Worms Revolution and Worms Crazy Golf.

image
But with GPU scaling ON, there are glitched textures (2D).

@MarioSonic2987

This comment has been minimized.

Copy link

MarioSonic2987 commented Sep 17, 2017

E {rsx::thread} RSX: No valid program bound to pipeline. Skipping draw

Spams this in Worms Ultimate Mayhem with Vulkan.
image

@Renusek

This comment has been minimized.

Copy link

Renusek commented Sep 17, 2017

NPEB00388 shows more now, but still glitched.
obraz

NPJB80690 is now crashing on loading screen (BLJM61149 too) [Vulkan]
obraz

@Lardian

This comment has been minimized.

Copy link

Lardian commented Sep 17, 2017

Demon's Souls [BLUS30443] gets error right after loading into the game
F {PPU[0x1000005] Thread (HighGraphics) [0x00a662f0]} class std::runtime_error thrown: Verification failed:
(in file c:\rpcs3\rpcs3\emu\rsx\vk../Common/texture_cache.h:59)

And error, after starting a new game.
F {rsx::thread} class std::runtime_error thrown: Verification failed:
(in file c:\rpcs3\rpcs3\emu\rsx\vk../Common/texture_cache.h:59)
RPCS3.log.gz

@HenningJW

This comment has been minimized.

Copy link

HenningJW commented Sep 17, 2017

I'm experiencing a pretty big performance regression in Catherine (BLES01459) with exactly the same settings on an 2500k@4GHz HD7850 Vulkan (1 SPU Thread, SPU Loop Detection ON, 0 SPU Delay Penalty, Strict Rendering Mode).

Screenshot taken on the second night in the bar, the first one shows 30fps and is smooth, but a slight adjustment to the camera (right analog stick) drops frames significantly like in the second screenshot. This happen in a lot of places and is repeatable. On master everything is at 30fps no matter where. I am not sure if the amount of object cause the drop or specific types of objects. edit: to clarify the second screenshot has ~24fps all the time on that angle.

image

image

RPCS3.log.gz

If you want further testing or you want a savegame I am happy to assist.

edit: tested with b770b3d, retesting with the last two commits now
edit2: yes it is also present on the current state of this pr (e73252d) also found even better screenshot

@AniLeo

This comment has been minimized.

Copy link
Contributor

AniLeo commented Sep 17, 2017

Lord of the Rings Conquest regressed, now dies right before character select on both backends with

F {rsx::thread} class std::runtime_error thrown: Verification failed (e=0x1e7):
(in file C:\rpcs3\Utilities\VirtualMemory.cpp:83)

@CesarAxe

This comment has been minimized.

Copy link

CesarAxe commented Sep 18, 2017

I tried SAW II Flesh and Blood [BLES01050] and got this error during the game: (Vulkan)

F {rsx::thread} class std::runtime_error thrown: Working buffer not big enough, buffer_length=67108864 allocated=63470080 requested=9296 guard=65536 largest_pool=10240
(in file c:\rpcs3\rpcs3\emu\rsx\d3d12../Common/ring_buffer_helper.h:74)

In the current master branch I do not get this problem.
RPCS3.log.gz

* Clipping and fitting lookup funcrions
* surface_overlaps - returns true if surface overlaps a given surface address and returns the relative x and y position of the surface address within the surface
* address_is_bound - returns true if the surface at a given address is actively bound
* get_surface_subresource_if_available - returns a sectiion descriptor that allows to crop surfaces stored in memory

This comment has been minimized.

@hcorion

hcorion Sep 18, 2017

Contributor

A sectiion of this comment seems slightly off. 😄

@Zardas81

This comment has been minimized.

Copy link

Zardas81 commented Sep 18, 2017

Sword Art Online: Lost Song (BLAS50790): Has the same "4 mini windows" as some other games, maybe the extra log helps. Looks pretty much the same regardless of settings.
clipboard-1
RPCS3.log1.gz

@ghost

This comment has been minimized.

Copy link

ghost commented Sep 18, 2017

Nice! Fighting climax works again in opengl! Though with GPU scaling on it looks sort of like that Worms 2: Armageddon screen shot with the distorted textures. Turning it off restores the games half missing characters and the menu textures are fine

@GeniusMage

This comment has been minimized.

Copy link
Contributor

GeniusMage commented Sep 18, 2017

Tales of Vesperia has new crashes on Vulkan.
F {MFC Thread} class std::runtime_error thrown: Verification failed (e=0x57):
(in file c:\rpcs3\rpcs3\emu\rsx\vk../Common/texture_cache.h:59) (with GPU texture scaling)
F {SPU[0x2000001] Thread (SpursTLGraphicsCellSpursKernel1)} class std::runtime_error thrown: Verification failed (e=0x57):
(in file c:\rpcs3\rpcs3\emu\rsx\vk../Common/texture_cache.h:59) (without GPU texture scaling)

This crash happens when you reach the fountain, if you have no shaders cache. If you do have a cache, you may get a crash to Windows.

Seems to thave the same cause as Lardian's crash in Demon's Souls.
RPCS3.log.gz

EDIT: Seems fixed.

@bjakja

This comment has been minimized.

Copy link

bjakja commented Sep 18, 2017

On Fuel i noticed on last build some black and blue glitches. Game freezes after 2 minutes with
E {rsx::thread} HLE: Getting the real address failed. (addr=0xffff368c)
E {rsx::thread} RSX: Invalid FIFO queue get/put registers found, get=0xFFFF368C, put=0x1F7FF4
This build also give me fps impact about 40%.

@Illynir

This comment has been minimized.

Copy link

Illynir commented Sep 18, 2017

New error on Nier at launch with last commit:

F {rsx::thread} class std::runtime_error thrown: Verification failed:
(in file c:\rpcs3\rpcs3\emu\rsx\vk../Common/texture_cache.h:59)

Without GPU scaling.

@Sylfayn

This comment has been minimized.

Copy link

Sylfayn commented Sep 18, 2017

Persona 4 Arena now shows graphics on Vulkan with a small black bar at the top and no longer freezes after the opening, however the entire emulator now ends up freezing once you hit the loading screen for the main menu. OpenGL now shows graphics again, but it still freezes after the opening.
p4avulkan

RPCS3.log.gz

@Zardas81

This comment has been minimized.

Copy link

Zardas81 commented Sep 18, 2017

That fixed the P4A Vulkan crashes. The game still crashes on OpenGL though. One glitch haven't seen mentioned before: a purple triangle appears instead for exactly one frame in each character's animation.
2017-09-18 22_35_39-fps_ 60 61 _ vulkan _ 0 0 3-5880-head _ persona 4 arena _ blus30985
RPCS3.log.gz

@Zardas81

This comment has been minimized.

Copy link

Zardas81 commented Sep 18, 2017

SAO: view is mostly fixed now. There are two black bars on left and right, and colors are weird.
2017-09-18 23_00_46-fps_ 19 81 _ vulkan _ 0 0 3-5880-head _ sword art online -lost song- _ blas5079
It's supposed to look like this:
2017-09-18 23_07_02-sword art online_ lost song _ episode 1 _ press start return to alo - youtube
RPCS3.log.gz

@SakataGintokiYT

This comment has been minimized.

Copy link
Contributor

SakataGintokiYT commented Sep 18, 2017

@Zardas81
GPU Settings:
Enable: Stretch To Display Area

@greentop

This comment has been minimized.

Copy link

greentop commented Sep 18, 2017

Ubuntu 16.04 / Nvidia 384.69 / LLVM 4 / (PR3458 as of 188381c)

RPCS3 GPU Additional Settings:
Enabled - Invalidate Cache Every Frame & Use GPU Texture Scaling

Game: ToCS BLUS31572

PR3458 Vulkan: The right half of the game renders black. RPCS3 drags the OS to a crawl, requiring an forced end process to return Ubuntu to normal operation.
PR3458 OpenGL: The right half of the game renders black.

Game: ToCS2 BLUS31597

PR3458 Vulkan: The right half of the game renders black. RPCS3 hangs shortly after game start beyond the save load. Very low fps observed.
PR3458 OpenGL: The right half of the game renders black. The snow fall effects are now working. The RPCS3 process sometimes does not end after closing the RPCS3 window, which requires the user to end the process manually.

PR3458 RPCS3 logs and Screenshots.zip

tocs_vulkan_pr3458

@Sylfayn

This comment has been minimized.

Copy link

Sylfayn commented Sep 18, 2017

@Zardas81 Odd, my rip of Persona 4 Arena still crashes on Vulkan on the same loading screen, I can only guess it's my rip or something to do with my processor or graphics card. Strange.

@raveskirza

This comment has been minimized.

Copy link

raveskirza commented Sep 18, 2017

@Asinin3 Disable Write color buffers on

@kd-11

This comment has been minimized.

Copy link
Contributor

kd-11 commented Sep 21, 2017

@greentop Looks like ToCS2 is leaking memory. Strict rendering mode is kinda broken right now - will investigate that issue separately, as well as the random lockups when using vulkan (and sometimes openGL)

kd-11 added some commits Aug 13, 2017

rsx/vk/gl: Refactoring and reimplementation of blit engine
Fix rsx offscreen-render-to-display-buffer-blit surface reads
- Also, properly scale display output height if reading from compressed tile

gl: Fix broken dst height computation
- The extra padding is only there to force power-of-2 sizes and isnt used

gl: Ignore compression scaling if output is rendered to in a renderpass

rsx/gl/vk: Cleanup for GPU texture scaling. Initial impl [WIP]
- TODO: Refactor more shared code into RSX/common
rsx/vk: Bug fixes
- Make each frame context own its own memory
- Fix GPU blit
- Fix image layout transitions in flip

vk: Improve frame-local memory usage tracking to prevent overwrites
- Also slightly bumps VRAM requirements for stream buffers to help with running out of storage
- Fixes flickering and missing graphics in some cases. Flickering is still there and needs more work
vk: Up vertex attribute heap size and increase the guard size on it
vulkan: Reorganize memory management
vulkan: blit cleanup
vulkan: blit engine improvements
- Override existing image mapping when conflicts detected
- Allow blitting of depth/stencil surfaces
rsx: Several fixes and improvements
- Do not ignore non-centered pixel blitting
- Register method ac00+16
- Bump texture memory heap to account for GPU texture scaling requirements (vulkan)
- Explicit MRT location index output to better convey intent (openGL)
esx: Fixes to the texture cache
rsx: Blit engine improvements
- Always handle blits to and from framebuffers through the GPU
- Handle depth surfaces properly when using GL
- Check for format mismatches when blitting to the surface store [WIP]
rsx/fp: Shader decompiler fixes
- Requires proper 2-pass impl
rsx/fp: Catch hanging code blocks
rsx/fp: Don't pause on scaling error
rsx: Bug fixes and improvements
rsx: Try to skip unknown commands without discarding entire cb
rsx: Add support for batched multidraw
gl: Fix multidraw [WIP]
rsx: Ignore vertex base when data source is generated using arithmetic
vk: Check pending flag before doing fence poke
vk/gl: Fix for inlined array and immediate draws
rsx: Collapse joined draws when batching
rsx: Texture cache fixes and improvments
gl/vk/rsx: Refactoring; unify texture cache code
gl: Fixups
- Removes rsx::gl::texture class and leave gl::texture intact
- Simplify texture create and upload mechanisms
- Re-enable texture uploads with the new texture cache mechanism
rsx: texture cache - check if bit region fits into dst texture before attempting to copy
gl/vk: Cleanup
- Set initial texture layout to DST_OPTIMAL since it has no data in it anyway at the start
- Move structs outside of classes to avoid clutter
gl: Minor optimizations
rsx: Texture cache - improvements to locking
rsx: Minor optimizations to get_current_vertex_program and begin-end batch flushes
rsx: Optimize texture cache storage
- Manages storage in blocks of 16MB
rsx/vk/gl: Fix swizzled texture input
gl: Hotfix for compressed texture formats
rsx: Fix multidraw range splits again
rsx: Hotfix for disjoint range detection
rsx: Texture cache improvements
- Limits buffer size to min 720 in the Y axis (1024 section causes conflicts in some cases - TODO)
rsx: Fixups to allow large textures for blit operation
- Also includes checks for both leaking sections and blit regions for vulkan
hotfix for hanging when using WCB
addendum - unlock both ro and no blocks before attempting to copy memory blocks
gl: Fixups for ARB_explicit_uniform_location
- Forces glsl v 430 to make use of the extension
rsx/vk: Rework texture cache to minimize recursive access violations
- Also modifies the vulkan commandbuffer begin/end/submit mechanism
gl: Fix cached_texture_section::is_flushable to take memory protection into account
rsx: Fix blit dst offset calculation
rsx: Add support for non-projective shadow sampling
- Fixes missing shadows in persona 5

vk: Enable polygon depth bias a.k.a polygonOffset
- Fixes shadow acne in persona 5
rsx: Texture cache fixes and improvements
rsx: Conditional lock hack removed
vulkan - Fixes
- Remove unused texture class
- Fix native pitch calculation (WCB)
rsx: Catch hanging begin/end pairs when flushing deferred draw calls
vulkan: Register DXT compressed formats
vulkan: Register depth formats
gl: Workaround for 'texture stitching' when gathering flip surface
- TODO: Add a proper flip hack option
rsx: Fix texture memory size calculation
- DXT textures dont have real pitch. Since pitch is used to calculate memory size, make sure it always evaluates to rsx_size
rsx: Fix cpu copy detection
rsx: Validate blit dst surface and dont make assumptions about region blit order
- Also relax restrictions on memory owned by the blit engine if strict rendering is not enabled
rsx: Fix depth texture detection
rsx: Do not manually offset into dst. The overlapped range check does so automatically
rsx: Minor optimizations
rsx: Minor fixes
- Fix to detect incompatible formats when using GPU texture scaling and show message
- Better 'is_depth_texture' algorithm to eliminate false positives

@kd-11 kd-11 force-pushed the kd-11:fbo_fixes branch from 37a5dcc to d6ed2d9 Sep 21, 2017

@kd-11 kd-11 merged commit 3499d08 into RPCS3:master Sep 21, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Psycho-A

This comment has been minimized.

Copy link

Psycho-A commented Sep 24, 2017

Still there's no shadows and it's broken lighting in Silent Hill: Downpour (uses UE3 Engine)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment