Commit graph

164 commits

Author SHA1 Message Date
kd-11
7e33cdcb08 rsx: simple_array<T> improvements
- Implement move and copy ctors
2019-01-25 14:34:22 +03:00
kd-11
95245bdd83 rsx: Improve ARGB8->D24S8 casting
- Set up partial transfers
- Force clear of target before starting the transfer
2019-01-06 10:44:40 +03:00
kd-11
9c46386dd4 rsx: Check av configuration when selecting display buffers!
- Some applications have mismatch between video output configuration and display buffer sizes
2018-12-24 09:05:19 +03: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
45942c4962 Fix segfault when scaled image dimension is less than clip's 2018-12-04 13:01:29 +03:00
eladash
fa5652fceb rsx image_in: Implement negative scaling 2018-12-04 13:01:29 +03:00
kd-11
504ab5a6d4 rsx: Minor cleanup to silence stupid compiler warnings 2018-12-03 20:01:23 +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
eladash
a92ae827c1 rsx: Remove texture mipmap hack 2018-10-03 20:57:46 +03:00
Nekotekina
da6ce80f4f Make vm::get_super_ptr return contiguous memory
Cleanup RSX code complexity
2018-09-27 23:37:13 +03:00
kd-11
a3d44b5e1f rsx: Cleanup changes for the flip patch 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
Nekotekina
ed9fb8405b Move rotate/cntlz/cnttz helpers to Utilities/asm.h 2018-09-08 00:32:04 +03:00
Nekotekina
5afd12e8a4 [CMake] Use C++17 2018-08-24 16:44:19 +03:00
kd-11
f3d3a1a4a5 rsx: Rework section reuse logic 2018-08-22 17:22:54 +03:00
kd-11
38191c3013 rsx: Avoid acquiring the vm lock; deadlock evasion
- A possible deadlock is still present if rsx is trying to get a super_ptr whilst the vm lock holder is in an access violation
  This patch makes this scenario very unlikely since each block need only be touched once
2018-08-18 16:14:30 +03:00
kd-11
d266a25618 silence some annoying warnings 2018-07-09 13:06:00 +03:00
kd-11
2ca935a26b vp: Improve vertex program analyser
- Adds dead code elimination
- Fix absolute branch target addresses to take base address into account
- Patch branch targets relative to base address to improve hash matching
- Bumps shader cache version
- Enables shader logging option to write out vertex program binary,
  helpful when debugging problems.
2018-07-07 16:20:33 +03:00
Jake
00c9b323c2 rsx: fix image_in to use in_pitch when swizzling 2018-06-24 14:29:41 +04:00
kd-11
3150619320 rsx: Preserve read AA state separate from write AA state
- Some applications (e.g Backbreaker) use an evil hack to resolve MSAA.
  The application respecifies a formerly AA region as a region with no AA then performs a framebuffer feedback lookup.
  The old memory keeps AA during read, but writes back to itself with AA resolved.
  This is evil on several levels but it just happens to work on PS3
2018-06-08 22:17:50 +03:00
kd-11
0f24379c0e rsx: Obey MSAA resolve during memory persistence transfer
- Ugh. This is a bandaid on a festering wound, AA badly needs a rewrite

 Also silence some warnings
2018-06-08 22:17:50 +03:00
kd-11
b957eac6e8 rsx: Avoid calling any blocking callbacks from threads that are not rsx::thread
- Defers on_notity_memory_unmapped to only run from within rsx context
- Avoids passive_lock + writer_lock deadlock
2018-05-23 19:07:08 +03:00
kd-11
d2bf04796f Optimized cached write-through
- Allows grabbing an unsynchronized memory block if overwriting contents
anyway
- Allows flushing only specified range of memory
2018-05-23 19:07:08 +03:00
kd-11
fbf6581249 rsx: Fix segmented memory access for rsx::super_ptr 2018-05-23 19:07:08 +03:00
kd-11
8fcd5c1e5a rsx: Texture cache fixes
1. rsx: Rework section synchronization using the new memory mirrors
2. rsx: Tweaks
    - Simplify peeking into the current rsx::thread instance.
      Use a simple rsx::get_current_renderer instead of asking fxm for the same
    - Fix global rsx super memory shm block management
3. rsx: Improve memory validation. test_framebuffer() and
tag_framebuffer() are simplified due to mirror support
4. rsx: Only write back confirmed memory range to avoid overapproximation errors in blit engine
5. rsx: Explicitly mark clobbered flushable sections as dirty to have them
removed
6. rsx: Cumulative fixes
    - Reimplement rsx::buffered_section management routines
    - blit engine subsections are not hit-tested against confirmed/committed memory range
      Not all applications are 'honest' about region bounds, making the real cpu range useless for blit ops
2018-05-23 19:07:08 +03:00
kd-11
eccb57d4b8 vk: AMD primitive restart bug workaround
- Emulate primitive restart with degenerate triangles
2018-05-13 14:44:14 +03:00
kd-11
291a828217 fixups 2018-04-25 19:14:36 +03:00
kd-11
91a6091d26 rsx: Minor fixes
- vk: Clear dirty textures before copying 'old contents' in case the old data does not fill the new region
- rsx: Properly decode border color - seems to be in BGRA format
- vk: better approximation of border color to better choose between the presets
- vk: Individually clear color images outside render pass and without scissor
- vk: Fix renderpass selection for clear overlay pass
- vk: Include scissor region when emulating clear mask

NOTES:
- vk: Completely avoid using vkClearXXXXimage - its 'broken' on nvidia drivers
  Spec is vague about the function so its not an actual bug
  ClearAttachment is clearly defined as bypassing bound state which works correctly
- TODO: Implement memory sampling to simulate loading precleared memory if cell used memset to preinitialize the framebuffer
  Autoclear depth to 1|255 and color to 0 is hacky!
2018-04-25 19:14:36 +03:00
kd-11
a42b00488d rsx: Texture fixes
- gl/vk: Fix subresource copy/blit
- gl/vk: Fix default_component_map reading
- vk: Reimplement cell readback path and improve software channel decoder
- Properly name the subresource layout field - its in blocks not bytes!
- Implement d24s8 upload from memory correctly
- Do not ignore DEPTH_FLOAT textures - they are depth textures and abide by the depth compare rules
- NOTE: Redirection of 16-bit textures is not implemented yet
2018-04-25 19:14:36 +03:00
kd-11
63d9cb37ec rsx: Framebuffer fixes
Primary:
- Fix SET_SURFACE_CLEAR channel mask - it has been wrong for all these
  years! Layout is RGBA not ARGB/BGRA like other registers

Other Fixes:
- vk: Implement subchannel clears using overla pass
- vk: Simplify and clean up state management
- gl: Fix nullptr deref in case of failed subresource copy
- vk/gl: Ignore float buffer clears as hardware seems to do
2018-04-25 19:14:36 +03:00
kd-11
9abbbb79ae rsx: Blit engine fixes
- Ignore unlocked blit sections [TODO]
- Do not attempt blit on hw if bytesize is unsupported
- gl: Implement typeless memory transfers
  Uses pbo to handle type-agnostic memory transfer
2018-04-25 19:14:36 +03:00
kd-11
c5cd758700 rsx: Workaround for G8B8 render targets
- Mainly affected are colormasks and read swizzles

NOTES:
- Writes to G write to the second and fourth component (YW)
- Writes to B write to first and third component (XZ)
- This means the actual format layout is BGBG (RGBA) making RG mapping actually GR
- Clear does not seem to have any intended effect on this format (TLOU)
2018-04-25 19:14:36 +03:00
kd-11
53f2533a08 rsx: Implement proper Z-order curve in 3 dimensions
- Should fix garbage palette textures getting uploaded (LSD graphics)
2018-04-05 01:06:50 +03:00
Jake
6d6d6fa827 dx12/vk/gl: implement use of vertex_data_base_index when calculating index 2018-03-30 13:30:04 +03:00
kd-11
321c360dcb rsx: Overhaul rendertarget sampling/shuffles
- Reimplements render target views used for sampling
- Optimizes access using an encoded control token
- Adds proper encoding for 24-bit textures (DRGB8 -> ORGB/OBGR)
- Adds proper encoding for ABGR textures (ABGR8 -> ARGB8)
- Silence some compiler warnings as well
- TODO: Real texture views for OGL current method is a hack
2018-03-25 13:31:06 +03:00
kd-11
c6a2525c9b video out: Set up video configuration options in fxm
- TODO: Actually do something with the values
2018-03-25 13:31:06 +03:00
kd-11
c191a98ec3 vulkan API fixes
- Fix for texture barriers
- vulkan: Rework texture cache handling of depth surfaces
- Support for scaled depth blit using overlay pass
- Support proper readback of D24S8 in both D32F_S8 and D24U_S8 variants
- Optimize the depth conversion routines with SSE
- vulkan: Replace slow single element copy with std::memcpy
- Check heap status before attempting blit operations
- Bump guard size on upload buffer as well
2018-02-16 16:14:54 +03:00
kd-11
98e50d3064 gl: Reuse framebuffer textures whenever possible 2018-02-16 16:14:54 +03:00
Jake
efe6a6cf53 rsx: fixed emulated primitive restart 2018-01-24 16:28:09 +00:00
kd-11
71f69d1d48
rsx/overlays: Introduce 'native' HUD UI and implement some common dialogs (#4011) 2018-01-17 19:14:00 +03:00
Jake
ac53fc54dc rsx: fix image_in arg and swizzle fix 2018-01-14 20:50:55 +03:00
kd-11
08b829dc22 rsx: wcb scaling fixes 2017-12-01 21:00:50 +03:00
kd-11
be6b5922dd rsx: research native texel byte order on cpu readback (WCB) [WIP] 2017-11-20 15:18:57 +03:00
kd-11
3d05e61f7e rsx/vk: Workaround for polaris primitive restart bug 2017-10-19 12:22:52 +03:00
scribam
0129c54ab6 Move optional.hpp as a submodule 2017-10-12 18:00:24 +03:00
kd-11
fc0f98b5db rsx: Res scaling improvements
- gl: Reintroduce the wcb hw downscaling
- rsx: Clamp scalable render target size with a config var
2017-10-09 20:25:41 +03:00
kd-11
3fe37ede97 rsx: Fixups
- gl: Remove redundant texstorage1D call
- gl: Disable the wcb scaling code as it doesnt work right yet [WIP]
- vk: Fix wcb reads
2017-10-09 20:25:41 +03:00
kd-11
12ab03b0b5 rsx/gl: Implement resolution scaling
rsx: Revise wpos calculation to take resolution scale into account
2017-10-09 20:25:41 +03:00
kd-11
3499d089e7 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
2017-09-21 16:17:06 +03:00
kd-11
7ab1792ef7 rsx: Implement conditional locks 2017-08-06 14:29:42 +03:00