Commit graph

39 commits

Author SHA1 Message Date
kd-11 f45343a345 rsx: Handle DMA block init where empty pages exist in the range 2022-03-29 12:35:32 +03:00
kd-11 254ddcad51 vk/dma: Initialize COW DMA block contents to avoid leaks
- It is possible to lose data when uploading since the result of map_dma can change types and handles.
- Consider sync-on-exit for inherited spans

Not a problem when using passthrough DMA, but this extension does not work properly on NVIDIA + windows
2022-02-16 16:33:27 +03:00
kd-11 88abf3a6ba vk: Introduce the concept of VRAM allocation pools
- Each buffer or image has to declare which pool it belongs to. This will aid with memory management down the line.
2021-07-15 18:05:35 +03:00
kd-11 763828837b
vk: Forcefully unmap DMA blocks before destroying them (#10359)
- While the vulkan spec explicitly allows destroying mapped blocks, GPUOpen vma_alloc does not.
- Strangely, this issue does not afflict linux users, only windows.
2021-05-27 23:03:46 +01:00
kd-11 f9d9d12f11 vk: Fix slow bo upload + copy when using RADV
- This reverts commit dbcf1b5a03bfef18f404aa6827515af319abd744.
- Avoid unmapping buffers used for GPU upload/download. It is very slow
  on some platforms.
2021-05-27 22:49:13 +03:00
kd-11 a736350859 rsx/vk: Use backend configuration to track options that can be modified on a per-device basis 2021-05-25 20:54:17 +03:00
kd-11 156b092dc9 vk: Lock passthrough DMA behind the async streaming option
- Without async streaming this option can introduce artifacts.
  The correct fix for it is to use async streaming which allows the GPU to process texture data in parallel with rendering.
  Without streaming enabled the GPU can sometimes pull stale data via DMA when rendering and find the CPU has modified it.
2021-05-25 20:54:17 +03:00
kd-11 122bb4d829 vk: Avoid repeated chip_class lookup by using generic global function 2021-05-25 20:54:17 +03:00
David Carlier 7618e7f3fb FreeBSD/clang update proposal.
silence few build warnings, VKDMA: disable Intel chipset for host buffer as it requires root privilege.
2021-04-18 19:56:21 +03:00
kd-11 7d5a72c9e0 vk: Add options to system configuration 2021-03-12 02:27:05 +03:00
kd-11 b4e821c28d vk: Flip on async texture uploads 2021-03-12 02:27:05 +03:00
arabek bdefeaf6f9 Use maybe_unused macro for chip var
Var chip is only used in the WIN32 ifdef block - use maybe_unused to silence the compiler warning about unused variable.
2021-03-11 14:33:04 +03:00
xddxd 6d91a9fe6f Possible workaround for mobile Kepler chips 2021-03-08 15:46:03 +03:00
Nekotekina 87af905018 Enable -Wunused-parameter 2021-03-06 18:07:08 +03:00
kd-11 3632412c48 vk/dma: Simplify map_dma interface 2021-02-23 00:04:53 +03:00
kd-11 b7c2bfbcde vk: Fix cyclic read-write in dma_block::load/flush
Some DMA block entries are stubs whose parents are DMA_block_EXT
entries.
Performing load() in this case becomes a memcpy(address,
same_address_again, length) which wastes performance and introduces
bugs.
2021-02-22 01:13:31 +03:00
Nekotekina 8e6e57de86 Enable -Wunused-function warning 2021-02-15 14:39:53 +03:00
kd-11 b8311caa6b vk: Silence some compiler warnings 2021-02-14 20:42:34 +03:00
kd-11 22584fb2d1 vk/dma: Disable pasthrough DMA for NVIDIA+windows
- The driver seems to cache page mapping as long as allocation has not been removed
- This is undesirable as we cannot stop the emulator to remove stale allocations every time a page is unmapped
2021-01-24 14:24:55 +03:00
kd-11 90ac9165e2 vk/dma: Unmap pages from GPU when they are unmapped in Cell 2021-01-24 14:24:55 +03:00
kd-11 f93cb262ba vk/dma: Fix multiple logical bugs
- Fix range chaining.
- Add validation checks that no overlaps exist.
2021-01-24 14:24:55 +03:00
kd-11 67949bb5b7 vk/dma: Allow interoperability between pass-through and write-back DMA caching types 2021-01-24 14:24:55 +03:00
kd-11 e56da4eb46 vk: Workaround for amdgpu kernel driver 2021-01-24 14:24:55 +03:00
kd-11 7de0ff337b vk: Polishing and cleanup
Some spec violations fixes
Make the option dynamic
2021-01-24 14:24:55 +03:00
kd-11 e1c0a917fa vk/dma: Modify default page size to 64k 2021-01-24 14:24:55 +03:00
kd-11 58d367d704 vk: Add host-imported DMA buffers 2021-01-24 14:24:55 +03:00
kd-11 59e46f09b7 vk/dma: Disable memory inheritance
- It is not possible to emulate passthrough memory cleanly, and we don't need to
  A stupid race condition appears when trying to synchronize DMA blocks with memory inheritance.
  Since the usage pattern is to acquire a range and then load or write+flush, this new data is going to be..
  overwritten by the commandbuffer execution sequence later. Acquiring a scratch buffer to hold CPU content during the transition is not worth the effort..
  as the data will be destroyed anyway during the transfer process immediately afterwards.

  Fixes data corruption when moving data around using the emulated DMA passthrough
2021-01-24 14:24:55 +03:00
kd-11 7766076042 rsx/vk: DMA stuff 2021-01-24 14:24:55 +03:00
Nekotekina db8e6fe7a7 Enable -Wunused-variable 2021-01-12 14:34:14 +03:00
kd-11 c2cbc62be6 vk: Refactor some uber-headers
- VKHelpers was the rug everything was swept under for a long time.
  This commit essentially deprecates its usage across most of the backend.
2021-01-10 12:04:31 +03:00
Nekotekina a8e0d261b7 types.hpp: more cleanup
Also fix compilation.
2020-12-22 19:08:09 +03:00
Nekotekina eec11bfba9 Move align helpers to util/asm.hpp
Also add some files:
GLTextureCache.cpp
VKTextureCache.cpp
2020-12-18 18:07:42 +03:00
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
Nekotekina e055d16b2c Replace verify() with ensure() with auto src location.
Expression ensure(x) returns x.
Using comma operator removed.
2020-12-09 15:43:38 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +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
Maksim Derbasov 1abdee242a small improvement (#7288)
* small improvement

* comments addressed

Co-authored-by: kd-11 <15904127+kd-11@users.noreply.github.com>
2020-01-22 12:28:48 +00:00
kd-11 212ac19c11 vk: Reimplement DMA synchronization 2019-09-12 23:32:21 +03:00