Commit graph

55 commits

Author SHA1 Message Date
kd-11 314b63eebf vk: Drop unused native format ABGR8 2022-02-13 15:31:39 +03:00
nastys a0040e6fb1
macOS: Implement texture converter for Metal (2) (#11289)
* macOS: Implement texture converter for Metal (2)

* Fix texture conversion formatting
2021-12-24 15:46:37 +03:00
Megamouse 1f295bba5b VK: ReSharper warning fixes 2021-04-30 08:23:16 +02: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
Megamouse d9eb31000d VK: refactoring part 1 2020-12-31 22:57:17 +03:00
Nekotekina b382d3b3e9 Remove ASSUME macro
It's dangerous and sometimes bluntly misused feature.
Its optimization potential is near-zero.
2020-12-10 14:08:02 +03:00
Nekotekina 36c8654fb8 Remove HERE macro
Some cleanup.
Add location to some functions.
2020-12-10 12:30:22 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
kd-11 a90801e2aa vk: Add VK_FORMAT_D32_SFLOAT to format conversion table
- This format is required to emulate RSX_FORMAT_CLASS_D16_FLOAT
2020-10-18 19:30:40 +03:00
kd-11 af9e217fa4 vk: Improve D16F handling
- Adds upload and download routines. Mostly untested, which is why the error message exists
2020-08-30 09:26:37 +03:00
kd-11 65ead08880 rsx: Refactor and improve image memory manipulation routines 2020-08-27 12:52:28 +03:00
kd-11 a5ac5a9861 rsx: Separate uint depth formats from float depth formats 2020-08-27 12:52:28 +03:00
kd-11 faaf28b41d rsx: Basic support for creating depth float formats 2020-08-27 12:52:28 +03:00
kd-11 7e1b24224d rsx: Support XBGR flip image load from Cell memory 2020-08-12 20:19:19 +03:00
kd-11 56c63170b9 vk: Warn if GPU does not support RGBA8 natively 2020-08-12 20:19:19 +03:00
kd-11 b41349546c rsx: Proper support for typeless transform of ABGR framebuffers using the RGBA8 format 2020-08-12 20:19:19 +03:00
kd-11 c764925b4d rsx: Properly handle conversion of G8B8 and related formats
- These formats are 16-bit packed, not separate 8-bit channels. Conversion requires byteswap for them.
2020-06-16 22:36:38 +03:00
kd-11 118bfbbe98 rsx: Rewrite data texture remap expansion
- 16-bit channel formats have special 0x4|0xE encoding for only 2 channels, not 4
- float textures do not take any remapping and crash if you try it.
  Depth float textures work fine though.
2020-05-13 14:33:22 +03:00
Nekotekina c0f80cfe7a Use attributes for LIKELY/UNLIKELY
Remove LIKELY/UNLIKELY macro.
2020-02-05 10:42:34 +03:00
Nekotekina 377e7d2a73 C-style cast cleanup VI 2019-12-04 17:56:22 +03:00
kd-11 f40f2c6215 vk: Fix minification filter description for NEAREST_MIPMAP_NEAREST. Just a typo.
- Also remove mipmap filter for CONVOLUTION
2019-10-20 21:38:40 +03:00
kd-11 299b98b30a vk: Disable mipmap sampling if sampling mode is does not have a mipmap filtering mode.
- GL_LINEAR and GL_NEAREST always sample LOD0 so make vulkan behave the same way
2019-10-18 14:46:37 +03:00
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
JohnHolmesII 23094b48bb Fix warnings related to -Wswitch
Add default cases.
Move default breaks to newline
Add proper handling in some instances.
Add missing enums to switches
2019-06-28 01:40:52 +03:00
kd-11 a5ed30a8c0 rsx: Fixups for data cast operations via typeless transfer 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
Dzmitry Malyshau 4e09573937 [vk] Check for BGRA8 linear image to support blitting 2018-09-07 22:02:02 +03:00
kd-11 7e32e7343a vk: Reorganize handling of formats support
- Formats support is linked to the physical device and by extension the logical device derived from it
  It therefore makes no sense to track this as a separate object.
  Simplifies parameter passing and template specialization.
  Also avoids corner cases with AMD hardware (where D24S8 is not supported)
2018-04-25 19:14:36 +03:00
kd-11 40ae5e605d vk: Fix border color selection 2018-04-25 19:14:36 +03: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 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
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 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 798f90dac2 rsx/ui: Make a few settings configurable via the GUI 2017-06-22 23:36:15 +03:00
kd-11 0fd888a42e vk: Fix DRGB8 format 2017-03-06 18:56:46 +03:00
kd-11 1e71285de8 gl/vk/dx12: Implement forced channel remapping
gcc fix
2017-03-06 14:34:29 +03:00
raven02 44b8556dc6 Vulkan: fix G8B8 texture swizzle (#2181) 2016-10-01 17:02:10 +08:00
kd-11 1c9718389f gl/vk: Vertex attribute uploading and texture swizzle fixes (#2174)
* gl/vk: Properly upload vertex attributes

* vk: Fix cmp type

* vk: Remap all texture formats
2016-09-29 15:16:00 +08:00
kd-11 867e9210d7 gl/vk: Enable vertex texture fetch (#2127)
* gl: Enable vertex textures

* rsx: use textureLod instead of generic texture sample

* rsx: handle uploading of W32_X32_Y32_Z32

* gl: Re-enable proper shader logging

remove old logging method that overwrites single file

* gl: Declare texture_coord_scale for vertex samplers

* gl: texture remap fixes; enable remap for vertex textures

* gl: offset texture indices to base layer 16

* rsx: Fix W32_Z32_Y32_X32_FLOAT subresource layout

* vk: Enable vertex textures

* rsx: define special calls for vertex texture fetch

* gl: improved vertex texture fetch setup

* vk: Fix texture formats and component mapping

* vk: Implement vertex texture fetch functions properly

* vk/gl: proper fix for primitive restart index

revert inadvertent decompiler update

* gl: Disable filtering for vertex textures
2016-09-20 22:23:56 +08:00
Nekotekina a7e808b35b EXCEPTION macro removed
fmt::throw_exception<> implemented
::narrow improved
Minor fixes
2016-08-08 19:19:32 +03:00
Nekotekina 5a36c57c57 Formatting system improved
`unveil<>` renamed to `fmt_unveil<>`, now packs args to u64 imitating va_args
`bijective...` removed, `cfg::enum_entry` now uses formatting system
`fmt_class_string<>` added, providing type-specific "%s" handler function
Added `fmt::append`, removed `fmt::narrow` (too obscure)
Utilities/cfmt.h: C-style format template function (WIP)
Minor formatting fixes and cleanup
2016-08-04 21:34:00 +03:00
raven02 7ac9d3b679 D3D12/Vulkan : swizzle texture format G8B8 (#1931)
* D3D12: swizzle texture format G8B8

* Vulkan: swizzle texture format G8B8
2016-07-18 20:16:11 +08:00
raven02 d69a4173fa vk: push back border color to sampler (#1832)
* vk: push back border color to sampler

* use approximate color

* Add TODO for VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK
2016-06-26 21:25:25 +08:00
raven02 7779742ac1 GL: fix few texture swizzle remap (#1823)
* GL: fix few texture swizzle remap

* GL: add texture format HILO8 & HILO_S8

* VK: add mapping for X32_FLOAT
2016-06-25 20:15:10 +08:00
kd-11 60a7f9b3f2 vk: Fix rtt formats and component sampling
vk: Fix for rtt image sampling
2016-06-03 17:07:48 +03:00
Raul Tambre 5ad060f150 Vulkan/DX12: Texture format fixes
DX12 also had a couple fixes
2016-04-07 21:34:32 +03:00
Vincent Lejeune 73233fd347 rsx/common: Use typed class for texture filters. 2016-03-30 20:03:50 +02:00
Vincent Lejeune d971c4e0f6 rsx/common: Use typed enum for max anisotropy. 2016-03-30 20:03:50 +02:00