Commit graph

440 commits

Author SHA1 Message Date
eladash 6f770c8e35 Fix potential crash in begin_occlusion_query() while closing the Emu 2019-01-30 18:44:29 +03:00
kd-11 fb778e4821 rsx: Reimplement attrib divisor 2019-01-25 14:34:22 +03:00
kd-11 6fdc0fd7f0 rsx: Reimplement MSAA transparency
- Apply dither to edges that almost fail the straight-up alpha test
- Significantly improves alpha tested geometry far from the camera
- Also removes blend factor overrides/hacks as they give incorrect results due to background bleeding
2019-01-25 14:34:22 +03:00
kd-11 0f64583c7a rsx: Reimplement pitch lookup
- Remove the required_xxx_pitch constraint as it makes no sense. The pitch controls what can be written per line.
- It is possible to have a huge surface width but only render to a small region at the beginning and have a smaller pitch than can fit the surface (NFS carbon)
2019-01-06 10:44:40 +03:00
kd-11 64a8829614 rsx: Minor cleanup 2019-01-06 10:44:40 +03:00
kd-11 15488eb247 rsx: Avoid unnecessarily touching framebuffer memory
- Do not bind companion framebuffer when clearing single aspect; let the
  contest mechanism sort it out instead
- Do not prematurely tag framebuffers, instead only do so at
  write-confirmation time. Should avoid false tagging if setup does not
  allow a render to occur.
2019-01-06 10:44:40 +03:00
eladash db784556aa rsx: Evaluate cond render test at set_render_enabled 2018-12-30 15:04:59 +01:00
kd-11 f48abde14b rsx: Fixups for immediate rendering mode
- Immediate mode is isolated from the rest of the vertex configuration
- TODO: Verify register behaviour when immediate mode is used
  Check if per-primitive const register values are supported (likely are)
2018-12-24 09:05:19 +03:00
eladash 45ed58cdaf Fix rsx capture replay
Allow to capture non-increment cmd flag that was missing in command.reg
2018-12-15 19:40:18 +03:00
eladash 87988e9da8 rsx fifo: Stability improvements
* Restore stack in fifo error handling

* Update get register after the cmd execution

* Fix put pause in the middle of command

* Add restore points when branching to self

* Precise nopcmd detection

* Test all invalid cmds for early treatment of queue corruption
2018-12-15 19:40:18 +03:00
eladash 415b995a54 log rsx get ctrl 2018-12-15 19:40:18 +03:00
Nekotekina 476090a747 Detach VBlank and RSX Decompiler threads
Should fix exception handling in RSX Thread
2018-12-04 23:41:54 +03:00
kd-11 ec768afbd9 rsx: Flip workarounds for applications that flip via syscall
- Do not assume flip marks end-of-frame if executed via syscall
- Also disables skip_frame for these applications as there is no frame boundary
- NOTE: QUEUE_HEAD cannot be relied on as it is seemingly possible to flip the same head and not need to queue it
2018-11-30 23:51:25 +03:00
kd-11 2168159d03 gl: Fix flip regression
- Restore graphics state after flip (including active fbo) because flip can be made through a syscall
2018-11-30 23:51:25 +03:00
kd-11 5b6e1420f3 rsx: Pipeline barriers fixed up
- Ensure barriers are invoked even if no draw occurs!
-- Ensures that deferred commands are executed eventually
2018-11-30 23:51:25 +03:00
kd-11 1d19f71a46 rsx: Re-enable fifo error reset 2018-11-30 23:51:25 +03:00
kd-11 718a04c84f fixup: Clear disabled attrib entries 2018-11-30 23:51:25 +03:00
kd-11 833c25894f [WIP] rsx: Rebase cleanup 2018-11-30 23:51:25 +03:00
kd-11 5193c99973 rsx: Enable dynamic FIFO preprocessing
- Tries to detect when FIFO preprocessing is beneficial and only enables optimizations if the benefit outweighs the cost
- Current threshold is at least 500 draw calls saved at over 2000 draw calls to justify the overhead
- TODO: More tuning for other CPUs
2018-11-30 23:51:25 +03:00
kd-11 7b065d7781 rsx: Fixup; input attributes blob decoding
- Use an unstructured blob and index into the vec4 structures to extract the real data
2018-11-30 23:51:25 +03:00
kd-11 846daadd5d rsx: Fixups
- Improve vertex attribute layout format. Allows for full 16-bit attribute divisor
- Use actual pitch when declaring framebuffer rsx pitch instead of register value in case of swizzle? rendering
2018-11-30 23:51:25 +03:00
kd-11 2e32777375 rsx: Scrap the prebuffered queue approach
- Basically starting over
- The cost of making command copies into the queue has a measurable impact
2018-11-30 23:51:25 +03:00
kd-11 1ad76ad331 rsx: Restructure programs
- Also re-enable pipeline optimizations
2018-11-30 23:51:25 +03:00
kd-11 677b16f5c6 rsx: Fixups
- Also fix visual corruption when using disjoint indexed draws

- Refactor draw call emit again (vk)

- Improve execution barrier resolve
  - Allow vertex/index rebase inside begin/end pair
  - Add ALPHA_TEST to list of excluded methods [TODO: defer raster state]

- gl bringup

- Simplify
  - using the simple_array gets back a few more fps :)
2018-11-30 23:51:25 +03:00
kd-11 e01d2f08c9 rsx: Refactor FIFO
- Removes fifo structures from common RSXThread
- Sets up a dedicated FIFO controller
- Allows for configurable queue optimizations
2018-11-30 23:51:25 +03:00
eladash 37b6afaf2c rsx: inlined array stride fix 2018-11-11 23:17:07 +03:00
eladash 75221a6078 rsx: Fix inlined vertex array validation 2018-11-04 22:57:18 +03:00
Megamouse d56c85fe01 RSX/Capture: fix filePath and remove strict mode check (#5283)
- Fixes regression introduced by kd-11 when merging in jarves' flip rework.
2018-10-27 13:06:50 +03:00
elad 6829fa0286 rsx: Improve inlined arrays (#5248)
* rsx: Implement register reads in inlined arrays

* rsx: Check for disabled streams in inlined arrays
2018-10-20 16:00:53 +03:00
Nekotekina 1b37e775be Migration to named_thread<>
Add atomic_t<>::try_dec instead of fetch_dec_sat
Add atomic_t<>::try_inc
GDBDebugServer is broken (needs rewrite)
Removed old_thread class (former named_thread)
Removed storing/rethrowing exceptions from thread
Emu.Stop doesn't inject an exception anymore
task_stack helper class removed
thread_base simplified (no shared_from_this)
thread_ctrl::spawn simplified (creates detached thread)
Implemented overrideable thread detaching logic
Disabled cellAdec, cellDmux, cellFsAio
SPUThread renamed to spu_thread
RawSPUThread removed, spu_thread used instead
Disabled deriving from ppu_thread
Partial support for thread renaming
lv2_timer... simplified, screw it
idm/fxm: butchered support for on_stop/on_init
vm: improved allocation structure (added size)
2018-10-19 22:22:35 +03:00
Nekotekina da6ce80f4f Make vm::get_super_ptr return contiguous memory
Cleanup RSX code complexity
2018-09-27 23:37:13 +03:00
eladash 72ba062b1a rsx: Fix pfifo ret opcode 2018-09-27 17:47:32 +03:00
eladash a47ebad24c rsx: Fix pfifo nop cmd 2018-09-27 17:47:32 +03:00
Nekotekina 306f95a9ae New named_thread template (preview)
Old class named_thread renamed to old_thread
It's too hard to move in a single commit
2018-09-27 14:04:16 +03:00
kd-11 6a9f234dc7 rsx: Fixup flip behaviour
- handle_emu_flip is very heavy, only fire
2018-09-26 19:41:50 +03:00
kd-11 f72157bcec rsx: Fix vertex attrib parsing 2018-09-25 22:03:35 +03:00
kd-11 a3d44b5e1f rsx: Cleanup changes for the flip patch 2018-09-24 16:44:02 +03:00
Jake 699eadc84f rsx: Move render flip from rsx queue command to flip command 2018-09-24 16:44:02 +03:00
Rui Pinheiro 35139ebf5d Texture cache cleanup, refactoring and fixes 2018-09-24 15:26:40 +03:00
Rui Pinheiro f3029b2b42 Change Cell->RSX map/unmap notifications
This allows for further flexibility on the RSX side, allowing us to fix
some bugs and crashes in later commits.
2018-09-24 15:26:40 +03:00
eladash e0a676a3fe rsx: Fix vertex arrays fetch with inlined draws 2018-09-24 13:25:05 +03:00
eladash e6b68b260a rsx: Improve FIFO mem faults handling
increase the delay between faults, reduce log spam by allowing the messages to stack up
2018-09-20 01:05:40 +03:00
eladash a8ea576b22 rsx/cellgcm: Implemet initialization registers reset 2018-09-20 01:05:40 +03:00
elad d24f9194f7 typo fix
shader's location is decremented by one to match cellGcm's constants.
2018-09-13 16:49:58 +03:00
eladash b9ad578b00 rsx: Add a default shader address state 2018-09-13 16:49:58 +03:00
scribam 4cb98014a2 rsx: tiny zcull optimizations 2018-09-13 12:43:40 +03:00
eladash efbd77deb4 rsx: dont silently ignore null shader address 2018-09-12 00:40:20 +03:00
Nekotekina ca5158a03e Cleanup semaphore<> (sema.h) and mutex.h (shared_mutex)
Remove semaphore_lock and writer_lock classes, replace with std::lock_guard
Change semaphore<> interface to Lockable (+ exotic try_unlock method)
2018-09-03 23:00:36 +03:00
kd-11 2e0ecb556c rsx: Possible fix for UB data type consistency 2018-09-03 18:24:20 +03:00
kd-11 6399833182 rsx: Fix endianness order when immediate mode register is updated, but used as register lookup
- Simplify the code by unifying all the register-backed memory
2018-09-03 18:24:20 +03:00