Commit graph

220 commits

Author SHA1 Message Date
kd-11 c64935f9dd rsx: Clean up graphics state notifications and add notification for change in point size
- Adds a backend notification when point size changes.
- Refactors all those separate notifiers into one reusable template.
2020-02-08 18:13:05 +03:00
Nekotekina c0f80cfe7a Use attributes for LIKELY/UNLIKELY
Remove LIKELY/UNLIKELY macro.
2020-02-05 10:42:34 +03:00
Nekotekina 15391f45d0 Modernize RSX logging (rsx_log variable) 2020-02-01 11:52:22 +03:00
kd-11 adcc3e9c4b rsx: Optionally sync on texture read semaphore
- Some games use texture semaphore for zcull sync which is rather bizzare.
  However, it works on realhw as the depth test happens before fragment shader completion
- Due to the high performance penalty incurred by this act, this
behavior is only enabled by the "strict rendering mode" option.
2020-01-21 22:21:51 +03:00
Eladash 85695c8bac rsx: FIFO wake-up pause control 2020-01-15 19:54:23 +03:00
kd-11 7786681954 rsx: Improve MTRSX synchronization
- Properly synchronize DMA transfers when handling RSX pipeline
barriers. Texture read barrier is used to signify completion of DMA
routines and is often used to signal that Cell can overwrite vertex
data!
2020-01-03 10:35:53 +03:00
kd-11 5be7f08965 rsx: Restructure ZCULL report retirement
- Prefer lazy retire model. Sync commands are sent out and the reports will be
  retired when they are available without forcing.

- To make this work with conditional rendering, hardware support is
  required where the backend will automatically determine visibility by
  itself during rendering.
2019-12-29 13:49:46 +03:00
kd-11 8dfea032f2 rsx: Remove deprecated do_method path that has been superceded by c++ inheritance for many years 2019-12-29 13:49:46 +03:00
Eladash 6a926daee7 rsx: Delay FIFO recovery point creation if is in in_begin_end scope (#7080) 2019-12-12 15:38:56 +03:00
Eladash 7260af032e rsx: Ignore or recover from unknown primitives
This also fixes a bug when recovering FIFO or creating such recovery point inside in_begin_end == true scope.
2019-12-11 00:11:12 +03:00
Nekotekina 377e7d2a73 C-style cast cleanup VI 2019-12-04 17:56:22 +03:00
kd-11 2a8f2c64d2 rsx: Implement report transfer deferring
- Allow delaying report flushes triggered by image_in or buffer_notify
- When the report is ready, all the delayed transfers will automatically
be done.
- TODO: Make this configurable?
2019-11-04 18:48:41 +03:00
Emmanuel Gil Peyrot 69e9ee26f6 rsx: Make input_is_swizzled a template parameter
This lowers the relative cost of this function from ~2.25% to ~1.80% on
gcc 9 which I found quite surprising, some of it probably gets inlined
better in the callers, but I haven’t been able to isolate which parts.
2019-10-28 13:28:51 +03:00
Eladash 5de0005f5a rsx: Report full method range on invalid methods
Also report full command on fifo desync event for the first time
2019-10-21 15:31:45 +03:00
eladash 730e9cde84 sys_rsx: Improve allocations and error checks
* allow sys_rsx_device_map to be called twice: in this case the DEVICE address retrived from the previous call returned
* Add ENOMEM checks for sys_rsx_memory_allocate and sys_rsx_context_allocate
* add EINVAL check for sys_rsx_context_allocate if memory handle is not found
* Separate sys_rsx_device_map allocation from sys_rsx_context_allocate's
* Implement sys_rsx_memory_free; used by cellGcmInit upon failure
* Added context_id checks
* Throw if sys_rsx_context_allocate was called twice.
2019-10-21 15:31:45 +03:00
Eladash 397007cf8b rsx: Fix FIFO_DRAW_BARRIER substituation 2019-10-11 12:34:53 +03:00
Eladash 9242f16560 rsx: Improve FIFO recovery from flip 2019-10-10 19:34:23 +03:00
Eladash 06017cb14e rsx: Recover from invalid writes to CELL_GCM_NV4097_SET_INDEX_ARRAY_DMA
Also: Trigger a FIFO recovery when encountering an invalid method.
2019-10-10 19:34:23 +03:00
Eladash 2eaf5df60b rsx: Register some more methods 2019-10-10 19:34:23 +03:00
Eladash 0b2fa6ffdc rsx: Flush FIFO GET before smeaphore_acquire 2019-09-30 17:30:15 +03:00
Nekotekina bd1a24b894 Tidy endianness support (se_t) implementation
Move se_t and se_storage to util/endian.hpp
Use single template instead of two specializations.
Add minor optimization for MSVC.
Remove v128 dependency.
Try to enable intrinsics for unaligned data.
Fix minor bug in u16/u32/u64 specializations.
2019-09-28 15:39:50 +03:00
kd-11 7fdb4976d8 rsx: Remove log spam for cond render 2019-09-12 14:08:21 +03:00
kd-11 f8617500b5 rsx/methods: Warnings cleanup 2019-09-01 18:59:50 +03:00
kd-11 2962e05f26 rsx: Implement per-RTT color masks
- Also refactors and simplifies some common code in surface store and rsx core
2019-08-27 21:59:02 +03:00
Eladash 7fda07eb5b rsx: UB fix (signed vs unsigned mismatch) 2019-08-13 20:48:50 +01:00
Eladash 519fe9309e rsx: Fix nv0039::buffer_notify 2019-08-13 20:48:50 +01:00
Eladash 527b1bb071 rsx: Fix overlapping transfer of nv3089::image_in when out_pitch != in_pitch
or out_pitch != out_bpp * out_w
2019-08-13 20:48:50 +01:00
kd-11 8866a3d6a9 rsx: Cleanup for blit engine fixes 2019-08-10 16:45:02 +01:00
kd-11 033836d88c rsx: Minor fixup for nv3089::image_in
- Typo scale_x->scale_y
- Remove convoluted temp buffer creation and just use vector instead
2019-08-08 15:48:22 +03:00
kd-11 f0bd0b5a7c rsx: Conditional render sync optimization
- ZCULL queue was updated to one-per-cb but the conditional render sync hint was not updated.
- Do not unconditionally flush the queue unless the upcoming ref is contained in the active CB.
- This avoids spamming queue flush, which frees up resources and improves performance
2019-07-30 21:13:42 +03:00
Eladash fcc75c8b0f rsx: Write atomically semaphore updates and fix zcull timestamp 2019-07-26 21:27:55 +03:00
kd-11 b5a2f0df68 rsx: Implement separate viewport raster clipping
- Merge viewport raster window and scissor into one clipping region
- Viewport raster clip is different from viewport geometry clipping in
hardware as the latter is configurable separately
2019-07-19 14:21:19 +03:00
kd-11 7840cd914e rsx: Fixup nv3089::image_in
- Correct pitch when sourcing from temp block
- Remove obsolete? double transfer that also introduced a stale pointer reference to freed memory
2019-07-09 16:27:59 +03:00
msuih 146e43b6ec Do not use negative unsigned literals 2019-07-01 04:33:23 +03:00
Eladash 2bce367488 Fixup for fixup (#6153)
* Fixup for fixup

* Fix memory ordering for MTRSX

volatile doesnt block reordering.

* ugh
2019-06-30 12:47:42 +03:00
Eladash 43f919c04b Fixup after #6143 (#6146)
vm::spu max address was overflowing resulting in issues, so cast to u64 where needed. Fixes #6145.
    Use vm::get_addr instead of manually substructing vm::base(0) from pointer in texture cache code.
    Prefer std::atomic_thread_fence over _mm_?fence(), adjust usage to be more correct.
    Used sequantially consistent ordering in semaphore_release for TSX path as well.
    Improved memory ordering for sys_rsx_context_iounmap/map.
    Fixed sync bugs in HLE gcm because of not using atomic instructions.
    Use release memory barrier in lwsync for PPU LLVM, according to this xbox360 programming guide lwsync is a hw release memory barrier.
    Also use release barrier where lwsync was originally used in liblv2 sys_lwmutex and cellSync.
    Use acquire barrier for isync instruction, see https://devblogs.microsoft.com/oldnewthing/20180814-00/?p=99485
2019-06-29 18:48:42 +03:00
Eladash 1ee7b91646 Refactoring (#6143)
Prefer vm::ptr<>::ptr over vm::get_addr.
    Prefer vm::_ptr/base over vm::g_base_addr with offset.
    Added methods atomic_t<>::bts and atomic_t<>::btr .
    Removed obsolute rsx:🧵:Read/WriteIO32 methods.
    Removed wrong check in semaphore_release.
    Added handling for PUTRx commands for RawSPU MFC proxy.
    Prefer overloaded methods of v128 instead of _mm_... in VPKSHUS ppu interpreter precise.
    Fixed more potential overflows that may result in wrong behaviour.
    Added io/size alignment check for sys_rsx_context_iounmap.
    Added rsx::constants::local_mem_base which represents RSX local memory base address.
    Removed obsolute rsx:🧵:main_mem_addr/ioSize/ioAddress members.
2019-06-29 01:27:49 +03:00
JohnHolmesII 23094b48bb Fix warnings related to -Wswitch
Add default cases.
Move default breaks to newline
Add proper handling in some instances.
Add missing enums to switches
2019-06-28 01:40:52 +03:00
JohnHolmesII be521ff0ab Fix warnings related to parentheses 2019-06-25 20:36:32 -07:00
Lassi Hämäläinen 499035512b Split Emu/Memory into more logical headers
- Add vm_locking.h and vm_reservation.h and move relevant functions
  and types to these headers.
- Change include order and make vm_ptr.h, vm_var.h and vm_ref.h headers
  usable invidually and them including vm.h instead of other way around
- Because usage of vm::ptr now requires including vm_ptr.h instead of
  vm.h updated multiple #includes
- Added additional #includes to vm_reservation.h and vm_locking to
  where vm::reservation_* and locking related functions are used
2019-06-25 17:11:10 +03:00
Eladash cd0ef99df5 Fix BE endianess arch support in semaphore_406e (#6116)
Add raw() methods for endianness support types and make use of it.
2019-06-21 19:29:49 +03:00
Nekotekina 9abb303569 vm: expand reservation lock bit area to 7 bit
This is minor change.
2019-05-19 17:46:55 +03:00
kd-11 3c7d8a1099 rsx: Minor texture/surface scanning optimization
- Also re-enable optimization in blit engine accidentally disabled during debugging
2019-05-16 19:25:26 +03:00
kd-11 6feffe6ff6 rsx: Ignore transfer offsets when wrapping behaviour is expected 2019-05-01 15:36:21 +03:00
eladash f25587d24c rsx: Write vblank semahpre, minor semaphore acquire optimization 2019-04-20 01:04:41 +03:00
kd-11 df3b46a611 rsx: Improve texture sourcing and clipping when reverse scanning is enabled
- When reverse scanning, offsets are inverted and offset value of 0 is logically equivalent to an offset of -1
- Add an explicit message if clipping happens to avoid silent errors/bugs
2019-04-12 15:36:21 +03:00
kd-11 443fde760f rsx: Blit engine clipping fixes
- Do not round up sub-pixel offsets, round down instead
- Do not allow incomplete sources for hw blit transfer
- Reimplement src clipping (slice_h)
- Check 'area' of incoming texels and correct for them before RTT lookup/transfer
- Filter out incomplete targets when performing RTT lookup (1 texel or less contribution)
2019-04-09 13:40:54 +03:00
kd-11 17c49d21a5 rsx/blit: Remove workarounds/hacks added for master. Start implementation/stubs for blit engine rotations in GPU 2019-03-17 21:50:11 +03:00
elad ce8c92262d Treat X8R8G8B8 format as A8R8G8B8 in image_in, Fixes #5510 2019-03-08 23:44:46 +03:00
eladash bc27f5f75c Implement invalid NV4097_NOTIFY context handling 2019-01-13 12:59:00 +03:00