Commit graph

347 commits

Author SHA1 Message Date
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
7627ad04f1 rsx: Disable gamma control on WZYX textures
- Gamma is seemingly used for (D/X/A)RGB only. Data textures are unaffected
2018-03-29 13:52:11 +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
9fc1740608 rsx/fp: Fragment program overhaul
- Separate TXB from TXL: They are completely different!
- Properly perform TMU emulation in the fragment shader. Implemens SRGB conversion and alphakill at the moment
- Properly perform ROP emulation in the fragment shader. Implements FRAMEBUFFER_SRGB. While support on the chip looks to be incomplete (and wierd), it does work
- Document some more bits in SHADER_CONTROL register
2018-03-25 13:31:06 +03:00
kd-11
27552891ad rsx/fp: Improvements
- Export some debug information in the free texture register space components zw
  Very useful when analysing renderdoc captures
- Enable shadow comparison on depth as long as compare function is active and texture is uploaded for depth read
  Some engines (UE3) read all the components in the shader and use mul/mad with the result
2018-03-25 13:31:06 +03:00
kd-11
5f047034ae rsx: Disable async count verification to avoid lockup due to zombie reports in ZCULL 2018-03-13 18:55:03 +03:00
kd-11
f00d9a7c7f rssx" Halfplement alpha-to-coverage AA transparency 2018-03-13 18:55:03 +03:00
kd-11
2dce55d036 rsx: ZCULL synchronization fixes
- Track asynchronous operations in RSX core
- Add read barriers to force pending writes to finish.
  Fixes zcull delay flicker in all UE3 titles without forcing hard stall
- Increase zcull latency as all writes should be synchronized now
2018-03-13 18:55:03 +03:00
kd-11
315798b1f4 rsx: ZCULL rewrite and other improvements
- ZCULL unit emulation rewritten
- ZCULL reports are now deferred avoiding pipeline stalls
- Minor optimizations; replaced std::mutex with shared_mutex where contention is rare
- Silence unnecessary error message
- Small improvement to out of memory handling for vulkan and slightly bump vertex buffer heap
2018-03-13 18:55:03 +03:00
kd-11
dece1e01f4 rsx: Improve transform constants management
- Removes the duplicate local_transform_constants
- Resets the transform constants on every context reset
- Simplifies the code abit which should make it faster
- NOTE: Transform constants are persistent across context re-init events (VF5)
2018-03-13 18:55:03 +03:00
kd-11
0c8e4c0887 rsx: Improve FIFO commandlist flattening
- TODO: Alot of work is still needed to execute draw commands out of order
  Thats the only solution to games sending many draw calls with high frequency of state changes
2018-03-13 18:55:03 +03:00
kd-11
84b8a08d26 rsx: Basic performance counters 2018-03-13 18:55:03 +03:00
kd-11
af1b13550b rsx/vk: More optimizations
- Do not bother rechecking the dirty sampler pool for hits. Its faster to create new sampler than to search the pool
- Reserve some memory on vertex layout struct to reduce reallocation penalty
2018-03-13 18:55:03 +03:00
Jake
7233640cf0 rsx: add vertex data base to offset and mask before translating address 2018-03-07 16:57:20 +03:00
kd-11
bd297d079d rsx: Minor optimizations 2018-02-16 16:14:54 +03:00
kd-11
a5500ebfa4 rsx: Fix disjoint draw range splitting
- Fixes flickering and missing draws in R&C and other games such as Motorstorm Apocalypse and Okami HD when strict mode is disabled
2018-02-16 16:14:54 +03:00
Nekotekina
cce0ad0c35 Clean vm::ps3 namespace use 2018-02-09 17:49:37 +03:00
Jake
2f414f96bf rsx: fix potential hang during thread close 2018-01-24 16:28:09 +00:00
kd-11
3d9e3a16f1 rsx/gl/vk: Fixes and optimizations
- opengl driver optimization for nvidia. On nvidia glTextureBufferRange performance is horrendous
-- Initialize texture buffer to whole buffer at startup and use absolute offsets to read data instead
-- Over 2x performance in some cases (Resogun, TNT racers)
- gl/vk: Do not flip non-existent display buffers. Fixes spec violation at boot in TNT racers demo
- whitespace fixes for sys_rsx
2018-01-22 11:43:35 +03:00
kd-11
0a2992839b rsx/gl/vk: Simulate z clipping with selective depth clamp
- The scale offset matrix is fine but on real hardware the z results seem to be independent of near/far clipping distances
-- If depth falls within near/far, clamp depth value to [0,1]
2018-01-19 12:03:57 +03:00
kd-11
cbc8bf01a1 cell/scheduler: Manage thread placement depending on cpu hardware 2018-01-19 12:03:57 +03: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
0477f8ed3c rsx: add log for potential source of error 2018-01-14 20:50:55 +03:00
Jake
7ca2c444cc rsx: Fix depth clipping 2018-01-14 20:50:55 +03:00
kd-11
ee009ec99c rsx: Robustness fixes
- Track last working state and reset to it if RSX starts to desync
-- This is especially useful when running vulkan since the renderer will easily outpace the rest of the system when merely recording draw commands
- Ignore empty sets
-- Mark empty/invalid IB sets as having 0 element counts.
2018-01-02 21:17:56 +03:00
kd-11
0d0821e914 rsx: Pause FIFO queue when changing ctrl registers 2017-12-18 10:45:37 +03:00
kd-11
90c2324e47 rsx: Program cache fixes
- Reorganize storage hash vs ucode hash
- Scan for actual fragment program start in case leading NOPed code precedes the actual instructions
-- e.g FEAR2 Demo has over 32k of padding before actual program code that messes up hashes
2017-12-04 18:22:18 +03:00
kd-11
90a3f3af30 rsx: Discard queue if RET is found without CALL 2017-12-01 21:00:50 +03:00
kd-11
de5a4fe083 rsx: Reimplement depth <-> RGBA reinterpretation code
- Implements proper channel order for fp24-ARGB8 conversion
- Takes swizzle remap into account when reconstructing source bytes
2017-12-01 21:00:50 +03:00
kd-11
ccc0383f75 vulkan: Implement overlay shader passes
- Implements vk::overlay_pass and vk::depth_convert_pass
- Also added a sanity check in RSX core for depth replace shaders
2017-12-01 21:00:50 +03:00
kd-11
680ca1d12a rsx: Zcull refactoring and vulkan implementation 2017-12-01 21:00:50 +03:00
kd-11
0aaae000b3 rsx: Minor improvements 2017-12-01 21:00:50 +03:00
Zion Nimchuk
3a9ae2df9e silence warnings in RSX stuff 2017-11-30 18:07:19 +03:00
Nekotekina
dbc9bdfe02 Implement set_ideal_processor_core (linux) 2017-11-15 21:00:02 +03:00
kd-11
1fa18757fc rsx: Implement render-to-cubemap; Also simplify unnormalized samplers [WIP, DELETE SHADER CACHE, VERY SLOW]
- Enables real-time cubemap reflections
- TODO: Vulkan is broke; rsx is very slow with this feature
2017-11-08 13:15:34 +03:00
kd-11
0961a43997 rsx: Implement 1D<->2D image type casts 2017-11-08 13:15:34 +03:00
kd-11
bbcb6b6851 rsx: Fbo fixes 2
- Use AA mode to predict surface compression. Compression mode is useless without AA activated
- Rewrites most image subresource fetch routines to use the new heuristic
- Fix rsx:🧵:find_tile. FEED000(X) can be substituted for (X) in the code
-- Fixes alot of failures when looking for tiled regions

rsx: Fix antialiased unnormalized coords
- scaling factors are inverse to allow proper coordinates to be computed in fs
2017-11-08 13:15:34 +03:00
kd-11
173d05b54f rsx: Optimizations
- Reimplement fragment program fetch and rewrite texture upload mechanism
-- All of these steps should only be done at most once per draw call
-- Eliminates continously checking the surface store for overlapping addresses as well

addenda - critical fixes
- gl: Bind TIU before starting texture operations as they will affect the currently bound texture
- vk: Reuse sampler objects if possible
- rsx: Support for depth resampling for depth textures obtained via blit engine

vk/rsx: Minor fixes
- Fix accidental imageview dereference when using WCB if texture memory occupies FB memory
- Invalidate dirty framebuffers (strict mode only)
- Normalize line endings because VS is dumb
2017-11-08 13:15:34 +03:00
Jake
e0d1ac676e rsx: invalidate surface store address when tile is unbound 2017-10-28 12:46:20 +03:00
Jake
626b9f93c4 rsx: make dmactrl get 'readonly' 2017-10-28 12:46:20 +03:00
kd-11
9c9495621c rsx: Fix critical bug concerning transient data layout in memory 2017-10-26 00:35:45 +03:00
kd-11
5db45c3699 rsx: More fixes
- Workaround for AMD glMultiDrawArrays bug
- Disable disjoint command submission when multidraw support is disabled
2017-10-19 12:22:52 +03:00
kd-11
86bf61ad35 rsx: Fix memory protection
- Fixes hanging when wcb is enabled
2017-10-14 14:19:14 +03:00
kd-11
c570410e06 rsx: Stop executing broken command queues if the application fails to recover in 3 retries 2017-10-12 13:51:29 +03:00
kd-11
9af71699a4 rsx: Minor fixes
- Dont skip cb if a problem occurs, just spin on it instead to allow possibility of recovery
- Vulkan cleanup for the die_with_error helper
2017-10-12 13:51:29 +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
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
3836b40bf7 rsx: Fixups 2017-09-21 16:17:06 +03:00
kd-11
571dbfb7b1 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
2017-09-21 16:17:06 +03:00