Commit graph

56 commits

Author SHA1 Message Date
kd-11
141072023b rsx: Fix handling of ARGB8 memory
- Load into memory as straightforward BGRA
- Fixes a bug in vulkan caused by byte shuffling in blit engine vs shader access
- Removes the need for memory shuffling when transferring into a rendertarget
2019-08-21 21:17:15 +03:00
kd-11
a0f0c418d7 gl:Implement proper support for packed 16-bit rendertargets
- Also some minor refactoring
2019-08-15 14:00:17 +03:00
kd-11
7f85b18b46 gl: Add support for 4444 typeless texture 2019-08-15 14:00:17 +03:00
kd-11
956270d9be gl: Add readback/writeback config for format GL_R16 2019-07-09 16:27:59 +03:00
Malcolm Jestadt
b5d5113803 gl: Workaround slow PBO usage with Mesa
-Mesa is currently fastest with GL_STREAM_COPY
-See a338dc0186
-Also see https://bugs.freedesktop.org/show_bug.cgi?id=111043
2019-07-03 11:28:29 +03:00
kd-11
c32c1b0a62 gl: Minor API tweaks
- Avoid spamming the driver with samplerParameter calls unless the parameters have actually changed
2019-06-25 20:50:54 +03:00
Lassi Hämäläinen
c963c51a60 Remove unnecessary header includes
- Manually removed lot of unneeded #includes to clean code and reduce
  compilation time
- Reordered some of the #includes to be in more logical order
2019-06-25 17:11:10 +03:00
kd-11
c3b234f972 gl: Fix staging buffer size calculation 2019-05-22 01:18:46 +03:00
kd-11
a5ed30a8c0 rsx: Fixups for data cast operations via typeless transfer 2019-04-09 13:40:54 +03:00
kd-11
cc3809fbfe gl: Register a few more missing formats for conversion 2019-04-09 13:40:54 +03:00
kd-11
3249000511 rsx: Improvements to texture scanning
- Removes CPU-only transforms that broke GPU-side code.
 -- Channels in GPU compute are laid out in cell-order, but CPU was uploading in favorable order and compensating with swizzles.
 -- This leads to 2 different layouts depending on the location of the data (CPU vs GPU)
- Implement R8G8_R8B8 interleaved format decode
- General improvements
2019-04-09 13:40:54 +03:00
kd-11
38887bc03e gl/vk: Improvements to overlay rendering
- gl: Properly initialize and manage sampler states
- gl/vk: Snap overlay elements to pixel grid by aligning to pixel centers
- overlays: Disable grid snapping in stb since its now handled in the backend
2019-02-05 12:15:12 +03:00
kd-11
521969bcc3 gl: Remove GL_R 'format'. There is no GL_R format, it part of the S-T-Q-R enums for texture coordinate space 2019-01-25 14:34:22 +03:00
kd-11
97704d1396 rsx: Fix texture size calculations 2019-01-06 10:44:40 +03:00
kd-11
4b79ef1ad9 rsx: Implement stencil mirror views
- Implements a mirror view of D24S8 data that accesses the stencil components.
  Finishes the implementation of TEX2D_DEPTH_RGBA as the stencil component was previously missing from the reconstructed data
- Add a few missing destructors
  Image classes are inherited a lot and I forgot to make the dtors virtual
2018-12-24 09:05:19 +03:00
eladash
fa723f6dc4 rsx: Fix texture depth read 2018-10-03 20:57:46 +03:00
eladash
a92ae827c1 rsx: Remove texture mipmap hack 2018-10-03 20:57:46 +03:00
kd-11
8695f95267 rsx: Reimplement cached textures and their views 2018-07-22 17:19:59 +03:00
kd-11
fa55a8072c rsx: Improve vertex textures support
- Adds proper support for vertex textures, including dimensions other than 2D textures
- Minor analyser fixup, removes spurious 'analyser failed' errors
- Minor optimizations for program state tracking
2018-07-12 18:02:28 +03:00
scribam
04ad49de4d typos 2018-05-14 21:14:39 +04: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
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
6d46ac1ad6 gl: Reimplement textures
- Separate texture data from texture views
2018-04-25 19:14:36 +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
pauls-gh
fd8d2ecbf4 Remove Volume Texture Compression (VTC) tiling for Vulkan, DX12 and ATI (OpenGL). 2018-03-23 12:01:30 +03:00
kd-11
d13584f858 rsx: fixups
gl/vk: Bump shader cache version
gl/vk: Disable anisotropic override when strict mode enabled as it is proven to alter some games negatively
gl: Clamp buffer view range to not exceed the backing buffer size. Also add assert for the same condition
2018-03-19 12:13:34 +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
Zangetsu38
c8965564e4 vk/ogl: Fix regression for G8B8 2018-01-24 20:20:28 +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
4a0c4259f0 c++ is hard
- Remove unnecessary const definitions
2017-12-22 20:08:14 +03:00
kd-11
6891323c18 rsx: framebuffer textures do not have mipmaps!
- Force mipmap count to 1 if sampling from an RTV/DSV
- TODO: Better wcb flush detection, it should be better to re-upload the texture after it has been dwnloaded if expected mipmaps are > 1
2017-12-18 10:45:37 +03:00
kd-11
6dfe32c6d2 fix linux builds 2017-12-18 10:45:37 +03:00
kd-11
ac0022483a rsx: Implement delayed swizzle remap for blit engine resources
- Fixes remap vectors for memory copied via blit engine as it has no context
2017-12-18 10:45:37 +03:00
kd-11
e9f293f522 rsx: Improve separate treatment of write exceptions vs read exceptions
- Optimizes search functionality and avoids thrashing valid sections
2017-10-24 22:59:09 +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
6e8107a5cb rsx: Implement AF override 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
45d0e821dc gl: Minor optimizations
rsx: Texture cache - improvements to locking
rsx: Minor optimizations to get_current_vertex_program and begin-end batch flushes
rsx: Optimize texture cache storage
- Manages storage in blocks of 16MB
rsx/vk/gl: Fix swizzled texture input
gl: Hotfix for compressed texture formats
2017-09-21 16:17:06 +03:00
kd-11
e37a2a8f7d rsx: Texture cache fixes and improvments
gl/vk/rsx: Refactoring; unify texture cache code
gl: Fixups
- Removes rsx::gl::texture class and leave gl::texture intact
- Simplify texture create and upload mechanisms
- Re-enable texture uploads with the new texture cache mechanism
rsx: texture cache - check if bit region fits into dst texture before attempting to copy
gl/vk: Cleanup
- Set initial texture layout to DST_OPTIMAL since it has no data in it anyway at the start
- Move structs outside of classes to avoid clutter
2017-09-21 16:17:06 +03:00
kd-11
b2e906f4cc rsx: Code cleanup. Fixes several dozen warnings
- Wrap unused parameters as comments to prevent C1400
- Fix sized variable conversions with explicit casts
2017-06-22 23:36:15 +03:00
kd-11
69d3d47901 gl: Fix clip-space -> depth conversion. Fixes remaining depth read issues
- Also set some default values for samplers in a cleaner way using their 'natural' float values
2017-06-22 23:36:15 +03:00
kd-11
6a9eef0382 rsx/gl/vk: Enable use of native PCF shadows 2017-06-22 23:36:15 +03:00
kd-11
6d6d0e4e36 gl: Use the GPU to scale textures; use ARB_sampler_object
Improve scaling and separate sampler state from texture state

gl: Unify all texture cache objects under one structure separate by use case
gl: Texture cache fixes

- Acquire lock when finding matching textures
- Account for swizzled surfaces when deciding whether to cpu memcpy
- Handle swizzled images on the GPU
2017-04-08 23:12:09 +03:00
kd-11
0fba38f691 gl: Fix legacy clamp mode (#2612) 2017-03-30 19:37:49 +03:00
kd-11
ad12900397 gl: Force alignment of DXT textures 2017-03-29 23:06:17 +03:00
kd-11
1e71285de8 gl/vk/dx12: Implement forced channel remapping
gcc fix
2017-03-06 14:34:29 +03:00
kd-11
7c73c3b75c rsx/gl: Minor refactoring; prepare vulkan backend 2017-03-01 00:16:55 +03:00
kd-11
a1e725ffeb gl: Decode dxt textures to a staging buffer 2016-12-15 14:36:28 +03:00
kd-11
8454949eea gl/vk/rsx: Add a cross-platform overlay text; Minor perf improvements and rsx bugfixes (#2196)
* gl/rsx: Implement platform-agnostic text overlays

gl: Restore performance metrics using new text out helper

gl/rsx: Refactor text generation class

* vk: Enable text overlay

gl/vk: Polish overlay counters implementation

gl: Better resource shutdown for text writer

* gl: Optimization, do not rebind TIUs every frame. Speedup

* gl: Optimizations and improvements to vertex upload code

* gl/vk: Texture format swizzles

vk: Texture format fix

vk: Fix YX format swizzles

* rsx: Decode vertex texture index
2016-10-11 08:55:42 +08:00