Commit graph

72 commits

Author SHA1 Message Date
kd-11 463b1b220d rsx: Improve accuracy of shadow compare Ops when non-integer depth formats are used
- The fixed-point D24S8 format does special Z clamping during compare which matches PS3 behaviour
- D32S8 is a floating point format and comparison with Dref > 1 always fails causing black edges/borders
2019-04-25 16:23:05 +03:00
kd-11 366e4c2422 rsx: Preliminary support for format conversions using typeless resolve 2019-04-09 13:40:54 +03:00
kd-11 d731c07ade vk: Fix typeless resource management
- Fixes bugs that appear with high resolution scaling
2019-03-22 21:27:15 +03:00
kd-11 a49a0f2a86 vk/gl: Synchronization improvements
- Properly wait for the buffer transfer operation to finish before map/readback!
- Change vkFence to vkEvent which works more like a GL fence which is what is needed.
- Implement supporting methods and functions
- Do not destroy fence by immediately waiting after copying to dma buffer
2019-03-17 21:50:11 +03:00
kd-11 19ff95da70 vk: Fix usage of VK_IMAGE_LAYOUT_GENERAL
- Properly synchronize when transitioning to/from GENERAL layout.
- General layout requires full pipeline dependency since its used in a 'general' sense. As such, its use is to be largely avoided.
2019-02-07 11:40:17 +03:00
kd-11 3bfa564ef8 vk/windows: Try to keep msq thread from ever stopping
- NVIDIA drivers hook into the msq before our nativeEvent handler. This means NV is aware of events before rpcs3 is aware of them and sometimes stops until a new event is triggered.
  If rpcs3 is inside a driver call at this time, the system will deadlock since the driver waits for msq which waits for the renderer which waits for the driver.
- Use explicit hook management to control window events
- Add fence timeout to attempt detection of surface loss events
2019-01-31 21:53:02 +03:00
kd-11 fa9b448686 vk: Spec fixups
- Disable DEPTH<->RGBA typeless transfers for now as they require a lot more work to work for all vendors
- Do not allow switching layouts to UNDEFINED/PREINITIALIZED formats
2019-01-25 14:34:22 +03:00
kd-11 2a62fa892b rsx: Texture cache refactor
- gl: Include an execution state wrapper to ensure state changes are consistent. Also removes a lot of required 'cleanup' for helper methods
- texture_cache: Make execition context a mandatory field as it is required for all operations. Also removes a lot of situations where duplicate argument is added in for both fixed and vararg fields
- Explicit read/write barrier for framebuffer resources depending on
  usage. Allows for operations like optional memory initialization before
  reading
2019-01-06 10:44:40 +03:00
kd-11 9c45ce6d37 vk: Reimplement typeless memory allocation to handle resolution upscaling 2019-01-06 10:44:40 +03:00
kd-11 815f4aa63b vk: Improve logging of device names and driver versions 2018-09-03 18:24:20 +03:00
kd-11 e23435a190 vk: whitespace fix only 2018-09-03 18:24:20 +03:00
kd-11 21e1911112 vk: Improve fence wait logic 2018-08-24 14:52:22 +03:00
kd-11 f0a91484a0 vk: Implement double-buffered heaps for platforms without universal support for host visibility (APPLE) 2018-08-23 22:54:56 +03:00
kd-11 cc7848b3ef vulkan: Fix blit engine transfer to ARGB8 render target memory 2018-08-18 16:14:30 +03:00
kd-11 5fb4009a07 vk; Add more compute routines to handle texture format conversions
- Implement le D24x8 to le D32 upload routine
- Implement endianness swapping and depth format conversions routines (readback)
2018-06-26 20:07:20 +03:00
kd-11 2afcf369ec vk: Add synchronous compute pipelines
- Compute is now used to assist in some parts of blit operations, since there are no format conversions with vulkan like OGL does
- TODO: Integrate this into all types of GPU memory conversion operations instead of downloading to CPU then converting
2018-06-18 17:32:22 +03:00
kd-11 0d5c071eee vk: Implement typeless image transport 2018-06-18 17:32:22 +03:00
kd-11 63f803b68a Refactoring
- Make the memory allocator a unique child of the render device.
  Fixes object lifetime issues with swapchain management due to cyclic dependencies
2018-06-08 22:17:50 +03:00
kd-11 fc18e17ba6 vk: Implement depth scaling using hardware blit/copy engines
- Removes the old depth scaling using an overlay.
  It was never going to work properly due to per-pixel stencil writes being unavailable
- TODO: Preserve stencil buffer during ARGB8->D32S8 shader conversion pass
2018-06-08 22:17:50 +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
pauls-gh f8a0be8c3e Performance enhancement - Vulkan memory allocator (#4635)
* Incorporates the vulkan memory allocator from the AMD GPUOpen project
2018-05-23 17:02:35 +03:00
scribam 04ad49de4d typos 2018-05-14 21:14:39 +04:00
kd-11 9d1f4a2538 vk: Include RADV POLARIS and RADV VEGA in the primitive restart
blacklist
2018-05-13 14:44:14 +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 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 fca6c4fb7f vk: Improve compatibility workarounds
- Disable fence reset on gcn1 - gcn3
- Enable polaris+ workarounds on linux if proprietary driver is used
2018-03-28 11:30:11 +03:00
kd-11 5817f9fe3f rsx: Texture format fixes
- Implement SRGB (gamma corrected) textures (DXT1, DXT3, DXT5, RGBA8 only)
- Fix channel map decode for XY data texture formats
- Fix remap layout for X16 textures (verified with Mass Effect 3)
2018-03-25 13:31:06 +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 053ab585f4 gl/vk: Clean up some format casts
- TODO: Byte ordering considerations on data casts
2018-03-13 18:55:03 +03:00
kd-11 705820c430 rsx: Nvidia driver compatibility workarounds
- Sanitize NaN values before they reach the driver. On nvidia (X * NaN = X)
2018-03-13 18:55:03 +03:00
kd-11 77f2b521e1 vulkan: Swapchains reimplemented
- Adds support for abstract implementations
- Adds native windowing implementations for WIN32 and X11 as fallbacks
  when present support is lacking (headless configs)
2018-02-21 14:59:46 +03:00
kd-11 ebb9fc7cd9 vk/drivers: Restore polaris+ patch to disable primitive restart 2018-02-16 16:14:54 +03:00
kd-11 32f0e91893 vulkan: Improve primitive restart workaround for vega/polaris
- For some reason the hardware forgets that primitive restart is enabled and tries to actually read vertex index 65535
- Works correctly if uint32 vertex indices are used instead of uint16 for cases where primitive restart is active
2018-02-16 16:14:54 +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
Nekotekina d2652aedd2 VK: add two options (workarounds)
Force FIFO present mode option is workaround for recent MESA drivers
Force primitive restart flag should also work on said drivers
2018-02-11 19:52:14 +03:00
Nekotekina 76be7d40ac Remove PSP2 2018-02-09 15:24:46 +03:00
kd-11 eeb6e29e39 vulkan: implement proper texture read barriers 2018-02-02 10:07:55 +03:00
kd-11 9ec2337192 rsx: Synchronization improvements
- Always flush the primary queue and wait if not involking readback from rsx thread
-- Should fix some instances of device_lost when using WCB
-- Marked remaining case as TODO
-- TODO: optimize amount of time rsx waits for external threads trying to read
2018-01-19 12:03:57 +03:00
kd-11 4872be9de3 rsx/vk: Synchronize access to queue submit calls
- Should prevent concurrent access on the present/graphics queue
2017-12-31 12:43:40 +03:00
kd-11 8b31a9448a vulkan: Tweaks to sampler state fallback paths
- Make all texture access on non-existent textures return 0
- If border color is closer to 0, then set alpha to 0 as well (might break some corner cases with alpha test)
- Zero initialize null sampler
2017-12-22 20:08:14 +03:00
kd-11 8f324dfc0a vk: Enable primitive restart workaround for polaris and vega on linux as well
- Looks like it might be a hardware erratum
2017-10-22 00:14:40 +03:00
kd-11 d8ee6a2edb add RX 550 to AMD vulkan cards with restart bug 2017-10-19 12:22:52 +03:00
kd-11 ddcacb8258 general fixes; Force u32 return type for index_count and add RX Vega to primitive restart blacklist 2017-10-19 12:22:52 +03:00
kd-11 3d05e61f7e rsx/vk: Workaround for polaris primitive restart bug 2017-10-19 12:22:52 +03:00
kd-11 a11d66f52d update vulkan submodules (#3600) 2017-10-15 14:37:52 +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 91ef202ee7 vulkan: Better VkResult handling 2017-10-10 12:10:41 +03:00
kd-11 23ad687e7e vk: New images always should be UNDEFINED or PREINITIALIZED 2017-09-23 16:46:41 +03:00
kd-11 a04ecdbe0a vulkan: Use frameid to determine texture storage to discard 2017-09-23 16:46: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