aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/textures/texture.h
Commit message (Collapse)AuthorAgeFilesLines
* video_core: read texture handles as header offsets only on Switch 2Sssnowyyy32 hours1-4/+4
| | | | | | | | | | | | | | 049c9633ed made TextureHeaderIndex take index / 32 for any texture index past the pool that is a multiple of 32, in VisitImageView and in the shader environment. That was written for Switch 2 handles that hold a header byte offset, but it ran for Switch 1 games too, where such an out-of-range index used to give a null view (and fail the shader environment's range check) and now binds an unrelated header. Pass whether the memory manager uses native tiling, which is how Switch 2 titles are set up, and keep the previous behaviour otherwise. Follow-up to 049c9633ed. Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
* nx2: read texture handles that hold a header byte offsetTakoroka4 days1-0/+11
| | | | | | | | | | | | | Switch Sports' scenery shaders take their 64-bit texture handles from a uniform register, and the texture part of those handles is the header's byte offset in the pool (index * 32), not its index: 0x96e46000 names header 8960 (a 640x152 2D texture), while the plain reading, 286720, runs far past the 33067-entry pool. Eden skipped them at draw time (null view) and built the shaders for a garbage header, so the island's ground, cliffs and buildings drew black. When a handle's index falls past the pool but index / 32 lands inside it, take that header, both when building the shader and when binding the view. Handles that already resolve keep their meaning.
* [vulkan] Removal of QCOM sampler limiters + CustomBorderColor and ↵CamilleLaVey2026-08-251-0/+5
| | | | | | | | | | ColorBorderSwizzle adjustments (#4301) This PR removes the artificial limit added for QCOM drivers based on a sampler budget limit (based on #3280 work), removes the ban on CustomBorderColor/BorderColorSwizzle for also QCOM driver, reduce the amount of combination required to created a sampler with custom border color/ color border swizzle; adds cases on R16 formats not able to swizzle on BGR565 formats; degrades samplers and color combinations when there's no color border swizzle available; fixes the srgb (LUT) values from legacy and now all the color variations are cached in the same key, instead of having 7 different handlers for them. In resume, rather than performance (due to the reduced amount of process on duplicated/ synced code on pipeline/texture cache), it's a graphica accuracy work that will improve image quality at the cost of almost 0 performance hit, rather than certain hitch if the color combination wasn't cached before. This applies to all platform. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4301 Reviewed-by: Samuel <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* video_core: Update texture formatFeng Chen2023-03-101-35/+35
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* video_core: eliminate constant ternaryValeri2021-08-191-1/+1
| | | `via_header_index` is already checked above, so it would never be true in this branch
* shader: Initial OpenGL implementationReinUsesLisp2021-07-221-0/+9
|
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-108/+131
| | | | | | | | | | | | | | The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage.The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage. This commit aims to address those issues.
* video_core: Resolve more variable shadowing scenarios pt.3Lioncash2020-12-051-1/+1
| | | | | Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
* video_core: Rearrange pixel format namesReinUsesLisp2020-07-131-26/+23
| | | | | | Normalizes pixel format names to match Vulkan names. Previous to this commit pixel formats had no convention, leading to confusion and potential bugs.
* video_core: Add MSAA registers in 3D engine and TICReinUsesLisp2020-04-121-0/+15
| | | | | This adds the registers used for multisampling. It doesn't implement anything for now.
* video_core/textures: Move GetMaxAnisotropy to cpp fileReinUsesLisp2020-04-071-19/+1
|
* video_core/texture: Use a LUT to convert sRGB texture bordersReinUsesLisp2020-04-071-9/+2
| | | | | | | | | | | | | | | | | | This is a reversed look up table extracted from https://gist.github.com/rygorous/2203834#file-gistfile1-cpp-L41-L62 that is used in https://github.com/devkitPro/deko3d/blob/04d4e9e587fa3dc5447b43d273bc45f440226e41/source/maxwell/tsc_generate.cpp#L38 Games usually bind 0xFD expecting a float texture border of 1.0f. The conversion previous to this commit was multiplying the uint8 sRGB texture border color by 255. This is close to 1.0f but when that difference matters, some graphical glitches appear. This look up table is manually changed in the edges, clamping towards 0.0f and 1.0f. While we are at it, move this logic to its own translation unit.
* textures: Fix anisotropy hackReinUsesLisp2020-03-081-14/+16
| | | | Previous code could generate an anisotropy value way higher than x16.
* Create an "Advanced" tab in the graphics configuration tab and add ↵Morph2020-02-271-1/+23
| | | | anisotropic filtering levels.
* video_core: Silence implicit conversion warningsReinUsesLisp2019-11-081-3/+4
|
* shader/node: Unpack bindless texture encodingReinUsesLisp2019-10-291-0/+2
| | | | | | | | | Bindless textures were using u64 to pack the buffer and offset from where they come from. Drop this in favor of separated entries in the struct. Remove the usage of std::set in favor of std::list (it's not std::vector to avoid reference invalidations) for samplers and images.
* video_core/textures: Remove unused index entry in FullTextureInfoReinUsesLisp2019-10-281-1/+0
|
* textures: Fix texture buffer size calculationReinUsesLisp2019-07-181-1/+1
|
* surface: Correct format S8Z24Fernando Sahmkow2019-06-201-2/+2
|
* maxwell_3d: Partially implement texture buffers as 1D texturesReinUsesLisp2019-06-201-1/+17
|
* video_core: Use un-shifted block sizes to avoid integer divisionsReinUsesLisp2019-06-201-6/+3
| | | | | | | | | | | | Instead of storing all block width, height and depths in their shifted form: block_width = 1U << block_shift; Store them like they are provided by the emulated hardware (their block_shift form). This way we can avoid doing the costly Common::AlignUp operation to align texture sizes and drop CPU integer divisions with bitwise logic (defined in Common::AlignBits).
* maxwell_to_gl: Use GL_CLAMP to emulate Clamp wrap modeReinUsesLisp2019-05-301-1/+1
|
* video_core/texures/texture: Remove unnecessary includesLioncash2019-04-061-2/+0
| | | | | | Nothing in this header relies on common_funcs or the memory manager. This gets rid of reliance on indirect inclusions in the OpenGL caches.
* Merge pull request #2229 from ReinUsesLisp/vk-sampler-cachebunnei2019-03-141-24/+29
|\ | | | | vk_sampler_cache: Implement a sampler cache
| * vk_sampler_cache: Implement a sampler cacheReinUsesLisp2019-03-121-1/+1
| |
| * video_core/texture: Add a raw representation of TSCEntryReinUsesLisp2019-03-121-24/+29
| |
* | video_core/texture: Fix up sampler lod biasReinUsesLisp2019-03-131-1/+1
|/
* gl_rasterizer: Encapsulate sampler queries into methodsReinUsesLisp2019-03-091-5/+29
|
* Merge pull request #2042 from ReinUsesLisp/nouveau-texbunnei2019-02-061-1/+0
|\ | | | | maxwell_3d: Allow texture handles with TIC id zero
| * maxwell_3d: Allow texture handles with TIC id zeroReinUsesLisp2019-02-031-1/+0
| | | | | | | | | | Also remove "enabled" field from Tegra::Texture::FullTextureInfo because it would become unused.
* | video_core/texture: Fix BitField size for depth_minus_oneReinUsesLisp2019-02-051-1/+1
|/
* Implemented Tile Width SpacingFernandoS272018-11-261-0/+2
|
* fix sampler configuration, thanks to Marcos for his investigationRodolfo Bogado2018-11-171-1/+14
|
* set sampler max lod, min lod, lod bias and max anisotropyRodolfo Bogado2018-11-111-2/+11
|
* Implement sRGB Support, including workarounds for nvidia driver issues and ↵Rodolfo Bogado2018-10-281-0/+5
| | | | QT sRGB support
* Propagate depth and depth_block on modules using decodersFernandoS272018-10-131-0/+1
|
* Fixed block height settings for RenderTargets and Depth Buffers, and added ↵FernandoS272018-10-091-2/+15
| | | | block width and block depth
* Implemented Depth Compare and Shadow SamplersFernandoS272018-10-061-1/+12
|
* gl_rasterizer_cache: Implement render to cubemap.bunnei2018-09-301-0/+2
|
* gl_rasterizer_cache: Track texture depth.bunnei2018-09-081-2/+10
|
* gl_rasterizer: Implement texture border color.bunnei2018-07-231-4/+4
|
* video_core: Use nested namespaces where applicableLioncash2018-07-201-4/+2
| | | | Compresses a few namespace specifiers to be more compact.
* GPU: Support changing the texture swizzles for Maxwell textures.Subv2018-06-061-0/+16
|
* add all the known TextureFormat (#474)greggameplayer2018-05-281-2/+71
|
* GPU: Implemented the A1B5G5R5 texture format (0x14)Subv2018-05-271-0/+1
|
* GPU: Implement the A2BGR10 texture format.Subv2018-04-211-0/+1
|
* GPU: Implemented the B5G6R5 format.Subv2018-04-181-0/+1
|
* GPU: Allow using a configurable block height when unswizzling textures.Subv2018-04-181-0/+7
|
* GPU/TIC: Added the pitch and block height fields to the TIC structure.Subv2018-04-181-1/+16
|