Commit graph

1648 commits

Author SHA1 Message Date
Jake 3a9428a88e rsx: Fix alpha test on VK/GL
Moving alpha test outside of fp_main. This enforces alpha test is still done even if shader asm has early return
2018-03-09 18:06:20 +03:00
Jake 7233640cf0 rsx: add vertex data base to offset and mask before translating address 2018-03-07 16:57:20 +03:00
Megamouse 6141bc5598 Fix firmware installation for vfs 2018-02-28 17:27:06 +04:00
kd-11 4c6ceeff11 rsx/vk: Cleanup
- Silence some warnings, remove dprints
2018-02-21 14:59:46 +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 ee88e7f948 rsx/gl: Hotfix for GL format compatibility check when high precision depth buffers is enabled 2018-02-16 16:14:54 +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 a8ab408f64 rsx: Account for null blit ops (memcpy)
- Do not perform extra memory tasks if no actual image copy was performed
2018-02-16 16:14:54 +03:00
kd-11 661b8b006f rsx: Add texture readback statistics to the texture cache and debug overlay 2018-02-16 16:14:54 +03:00
kd-11 1bd77c2f51 rsx: Add cache pattern checking to blit engine resources
- Feature was implemented long ago but was not functional due to bugs
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
kd-11 3bbecd998a infinitesimal fixes 2018-02-16 16:14:54 +03:00
kd-11 3406cc9886 gl: Fix save binding state for cube textures 2018-02-16 16:14:54 +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
kd-11 a64bea1286 rsx/fp: Discard shaders with undefined (non-existent) writes. On nvidia+vulkan, undefined writes autofill with blue color 2018-02-16 16:14:54 +03:00
kd-11 b67f28e00d rsx/texture_cache: Do not access non-existent components 2018-02-16 16:14:54 +03:00
kd-11 89c548b5d3 rsx: fbo fixes 2.5
- Implement flush-always behaviour to partially fix readback from a currently bound fbo
  - Without this, only the first read is correct, as more draws are added the results become 'wrong'
  - Fixes WCB and cpublit behviour
- Synchronize blit_dst surfaces to avoid data loss when gpu texture scaling is used
  - Its still faster in such cases to disable gpu texture scaling but some types cannot be disabled without force cpu blit (e.g framebuffer transfers)
- Memory management tuning
  - rsx: on-demand texture cache rescanning for unprotected sections
  - rsx: Only framebuffer resources are upscaled
  - Do not resize regular blit engine resources
  - Lazy initialize readback buffer when using opengl
  -- These measures should help minimize vram usage
2018-02-16 16:14:54 +03:00
kd-11 02e571adbc gl: Cleanup some more things
- Avoid referencing GL's null texture
- Improve texture creation helpers
- Remove useless __glcheck from GLHelpers.cpp
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
kd-11 f20fd217f8 rsx: Reorganize framebuffer setup code
- Fixes some fast paths for framebuffer creation and binding
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 cce0ad0c35 Clean vm::ps3 namespace use 2018-02-09 17:49:37 +03:00
Nekotekina 76be7d40ac Remove PSP2 2018-02-09 15:24:46 +03:00
kd-11 e7537cded5 vk: Also discard background if window is too small in vertical axis 2018-02-02 10:07:55 +03:00
kd-11 ea8bdda9a3 rsx/gl/vk: Support for swizzled? context surfaces
- For some surfaces, dimensions are passed via the log2 bits rather than surface pitch
-- This is similar to the setup for nv406e and probably means the surfaces are padded and swizzled
2018-02-02 10:07:55 +03:00
kd-11 eeb6e29e39 vulkan: implement proper texture read barriers 2018-02-02 10:07:55 +03:00
kd-11 b9cca71c47 gl: API compliance fixes
- Do not assume texture2D when creating new textures
- Flag invalid texture cache if readonly texture is trampled by fbo memory.
  Avoids binding a stale handle to the pipeline and is rare enough that it should not hurt performance
2018-02-02 10:07:55 +03:00
Zion Nimchuk 70fe0cc224 Install and load icons from Icons in executable directory, fixes local builds using Icons 2018-01-31 01:01:33 +04:00
kd-11 4f7d3e5dc1 vk: Stuff
- Remove subpass dependencies; transitions are handled via exicit imagememrybarriers
- Reuse sampler objects whenever possible; create/delete cycles are not free
2018-01-30 21:16:43 +03:00
kd-11 33bcdd476c glsl/fp/vp: Avoid shader clutter
- Do not add unused subroutines in shaders unless necessary
-- makes shaders easier to read and disassembled spir-v has less clutter
- glsl: Replace switch block with lookup table
2018-01-30 21:16:43 +03:00
kd-11 2e04dceaf0 rsx: misc fixes
- Supply explicit options for spv emit allowing optimizations (not yet compiled into the backend)
- Add epsilon fix to glslcommon
- Fix shader dialog crash when using qt (race condition)
2018-01-30 21:16:43 +03:00
kd-11 648fc92184 rsx/fp/vp: Epsilon value is too large!
- Original epsilon value was 1.E-10 which nvidia linux driver could not read properly
-- Restores the original value represented in decimal notation
2018-01-30 21:16:43 +03:00
kd-11 c05d164eee gl: Implement swap control on linux 2018-01-30 21:16:43 +03:00
Juhn d37aa466ff Fix native UI save_dialog when there are no saves (#4113)
- Also implements single action list view with cancel action only
2018-01-30 16:26:00 +03:00
ZeroZero2018 cd8e97a7c6 Fix to B8 format render target swizzling (#4123) 2018-01-29 21:58:25 +03:00
Zangetsu38 c8965564e4 vk/ogl: Fix regression for G8B8 2018-01-24 20:20:28 +03:00
Jake efe6a6cf53 rsx: fixed emulated primitive restart 2018-01-24 16:28:09 +00:00
Jake 2f414f96bf rsx: fix potential hang during thread close 2018-01-24 16:28:09 +00:00
kd-11 4f01794713 Minor fixes
- vulkan: Do not assume an aux frame context must exist in a well defined state as set in init_buffers() since the request might be external (via overlays path)
- gl: Do not bother waiting for idle before servicing external flip requests
- gl: Queue overlay cleanup requests to ensure only glthread attempts touching the context
- overlays: Do not compute size metrics for invalid/unsupported glyphs
2018-01-22 11:43:35 +03: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 fcd702c8a6 rsx: Texture format fixes
- Implement low bit decode override flags for 2-component textures
- Properly implement alot of texture remaps according to the autotest results

rsx: Do not unnecessarily shuffle WZYX->RGBA unless we have proof
- From looking at format swizzles, this is incorrect
2018-01-22 11:43:35 +03:00
kd-11 743928b379 vk/gl: Preserve clamped z precision to some extent
- Use edges of depth range to map clamped stuff

Disable range compression on regular draws vs extended range draws
- Some applications require full 0-1 usage without compromises.
-- TODO: This leaves the extended range z values to fight with regular draws in the .99 - 1.0 range
2018-01-22 11:43:35 +03:00
Zion Nimchuk 49e64b9e82 install icons to /usr/share and load them from there 2018-01-19 12:44:01 +03:00
kd-11 6828fbf658 rsx/texture_cache: Remove hacks; it has been proven that in offsets are in x16 fixed point 2018-01-19 12:03:57 +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 1a6e53ec98 overlay: Fixes
- Add fallback fonts including attempting to find glyphs in dev_flash
- Fix vulkan hang on startup if icons are not present
2018-01-19 12:03:57 +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 cbc8bf01a1 cell/scheduler: Manage thread placement depending on cpu hardware 2018-01-19 12:03:57 +03:00