64 Commits
Author SHA1 Message Date
LibretroAdmin 12d6192054 Pool Vulkan objects and vertex loaders; no play allocations
Common/ObjectPool.c (C89) keeps objects of one class in chunks, the first
made at backend start: a freed object is pushed on a lock-free stack, an
allocation takes the stack whole (an exchange, so no ABA) and pushes the
rest back, or else takes the chunks' next slot. A pool destroyed with
objects still out is freed with the last of them. Classes take it with
OBJECT_POOL_MEMBERS / OBJECT_POOL_DEFINE: VKPipeline, VKShader,
VKTexture, VKFramebuffer and the vertex loaders, which are now their
own bucket list nodes. Vulkan's descriptor pool and cleanup lists get
their first room at boot.

Play allocations: 58 to 1 on the core's thread, 172 to 1 on the compile
workers (both a first use).
2026-11-09 17:33:05 +01:00
LibretroAdmin 797c5e3e90 Framebuffers with one colour attachment; fixed Vulkan object tables
Nothing made a framebuffer with additional colour attachments, so they
go from AbstractFramebuffer, CreateFramebuffer and every backend, and
FramebufferState's additional_color_attachment_count (always 0) with
them: render passes, views, clears, RTVs and blending are for one
colour attachment, in fixed arrays rather than vectors.

Vulkan samplers are kept in an open-addressed table grown by doubling
and render passes in a fixed array, so looking one up never allocates.
Play allocations on the core's thread: 62 to 58.
2026-11-09 15:53:55 +01:00
LibretroAdmin b36a4a4b40 Vulkan: clears name their attachments in fixed arrays
ClearRegion and VKFramebuffer::SetAndClear list color, depth and the
additional color attachments (7 at most) in arrays on the stack, where
each built a vector at every clear. Allocations after boot over the
corpus fall from 6081 to 2720.
2026-11-09 05:14:46 +01:00
LibretroAdmin 4fad02d5f7 Vulkan: stream buffers in place, fences in a ring 2026-11-08 04:01:32 +01:00
LibretroAdmin eac19c3216 VideoCommon: textures, framebuffers and vertex formats as plain pointers 2026-11-08 03:21:36 +01:00
LibretroAdmin 361bcaf7a1 Video: textures and XFBs decode straight into the backend's upload memory
AbstractTexture::LendLoad lends the upload stream's memory for a level,
and CommitLoad uploads it: Vulkan for any rows, Direct3D 12 for rows at
its pitch alignment. The texture cache decodes textures and XFBs into
it; it decodes into its own buffer and Loads that where the backend
lends none, or when the arbitrary mipmap detection reads the levels
back. The detector keeps its levels in a fixed array.
2026-11-07 17:53:42 +01:00
LibretroAdmin 7ad9cb9289 Staging textures: transfer fence and persistent mapping as plain fields
A staging texture says whether its upload memory stays mapped, and
StagingTransferDone tells without waiting whether the GPU is done with
its last copy, from the Vulkan fence counter, the Direct3D 12 fence
value or the GL sync object. Direct3D 12 upload heaps stay mapped
through their copies.
2026-11-07 16:38:18 +01:00
LibretroAdmin 6fe348ec38 Vulkan: device memory from a heap of its own, in C
VKHeap.c takes large blocks from the driver and hands out offsets in
them: the lowest free span that fits, spans kept sorted so a free is a
binary search and a merge. The handle is a small struct kept by value,
so nothing is allocated per allocation. Host-visible blocks are mapped
once and stay mapped; stream buffers and staging buffers write straight
into the memory the GPU reads. Buffers and linear images keep to blocks
of their own, apart from optimal images. What the driver requires or
prefers dedicated, and anything of half a block or more, gets memory of
its own sized to fit. Host blocks are 16 MiB, device blocks 64 MiB, and
neither more than an eighth of its driver heap; one empty block of each
kind is kept and the rest go back to the driver.

The Vulkan Memory Allocator is gone, and with it the memory budget
extension only it used.
2026-11-07 06:06:08 +01:00
LibretroAdmin 64d3730c99 Vulkan: the 2D view the frontend reads made with the texture
A render target of one layer in a 2D array, which is what an XFB copy
is, gets a second view at creation, 2D, of that layer, and keeps it for
its life. Handing an XFB copy to the frontend in place uses it, so
presenting creates and destroys nothing: before, every new picture made
a view and queued the last one for destruction.
2026-11-06 20:47:20 +01:00
TellowKrinkle e599ae37c3 VideoBackends:Vulkan: Prevent hazards when restarting render passes 2025-10-18 05:24:37 -05:00
Jordan Woyak c18c039089 VideoCommon: Move backend_info out of VideoConfig struct. 2025-03-09 01:42:45 -06:00
iwubcodeandTellowKrinkle 12dd15c8dd VideoBackends / VideoCommon: add type enum to dictate whether a texture is a 2D texture, a texture array, or a cube map; support 2D texture type across backends
Co-authored-by: TellowKrinkle <[email protected]>
2023-12-15 11:06:02 -06:00
iwubcode e892b7f1ac VideoBackends: add support for cube maps for OGL, Vulkan, and D3D 2023-07-21 19:09:40 -05:00
Filoppi 0584f8ae2a Video: fix Vulkan RGBA10_2 format to the actual most common one (used as swapchain format) 2023-06-18 12:58:40 +03:00
Admiral H. Curtiss 092773ad0c Merge pull request #11859 from iwubcode/backend-multi-output
VideoBackends: add support to allow rendering to multiple output targets
2023-06-09 13:40:21 +02:00
Filoppi cdc53c046b Video: add R10B10G10A2 and R16G16B16A16F texture types (needed by PR 11850) 2023-06-08 03:17:20 +03:00
iwubcode 834f8f7b5c VideoBackends: add support to allow rendering to multiple output textures 2023-06-03 14:52:31 -05:00
JosJuice 90b676d368 Android: Fix armeabi-v7a build
This very much isn't a build configuration that we're going to ship,
but I want to be able to tell people that they can build it on their
own if they really want to see how terribly it performs :)

Just like before, you'll need to edit two lines in app/build.gradle to
define ENABLE_GENERIC=ON and actually enable armeabi-v7a if you want an
armeabi-v7a build. This commit just fixes some compilations errors that
crop up if you do so.
2023-02-17 16:58:24 +01:00
Scott Mansell ccf92a3e56 Merge pull request #11522 from phire/KillRendererWithFire
Kill Renderer (with phire)
2023-02-09 19:59:16 +13:00
Scott Mansell e98ab0784d Merge pull request #11501 from iwubcode/abstract_texture_load_specify_layer
VideoBackends: add a way to load data into a specific level AND layer
2023-02-01 00:03:59 +13:00
Scott Mansell 2a2014af09 Implement AbstractGfx for Vulkan 2023-01-31 19:41:23 +13:00
iwubcode 7bea39b39e VideoBackends: add a way to load data into a specific level AND layer, default to layer 0 2023-01-27 18:46:53 -06:00
iwubcode 271c60781b VideoBackends: update Vulkan's 'CopyRectangleFromTexture' to copy one layer, copying more than one layer doesn't make sense given that we provide both the source/destination layer 2023-01-27 18:41:52 -06:00
Robin Kertels 1ba58e83ca VideoBackends:Vulkan: Use VMA for stream buffer 2022-10-23 03:21:29 +02:00
Robin Kertels 0532f4a05a VideoBackends:Vulkan: Use VMA for staging buffers 2022-10-23 03:21:14 +02:00
Robin Kertels 81c817c54d VideoBackends:Vulkan: Workaround slow vkCmdCopyImageToBuffer on QCom driver 2022-09-30 21:13:42 +02:00
OatmealDome 28f3cb3d97 VKTexture: Only set texture name if supported 2022-01-31 01:17:40 -05:00
OatmealDome a720083a7e Revert "Vulkan: Check for vkSetDebugUtilsObjectNameEXT before using it"
This reverts commit 2ab66390f8.
2022-01-31 01:17:40 -05:00
JosJuice 2ab66390f8 Vulkan: Check for vkSetDebugUtilsObjectNameEXT before using it
Fixes a crash that has been present on Android (and probably also
macOS) since f6883a0.
2022-01-03 20:17:57 +01:00
Pokechu22 2025763420 Treewide: Adjust order of includes 2021-12-10 14:49:57 -08:00
iwubcode 1f2f505373 VideoBackends / VideoCommon: allow the ability to set debug names for shaders / textures. These names are visible in applications like RenderDoc 2021-08-30 13:47:48 -05:00
Pierre Bourdon e149ad4f0a treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
Shawn Hoffman d7fd892fde normalize common filenames in VideoBackends/Vulkan 2021-01-27 14:29:48 -08:00
Lioncash 139d4fc76e General: Convert PanicAlerts over to fmt equivalent
Converts lingering panic alert calls over to the fmt-capable ones.
2020-12-02 13:38:33 -05:00
Lioncash 21dd7a8ebb Vulkan: Migrate logging over to fmt
Migrates the vulkan backend over to the fmt-capable logger.
2020-11-09 03:26:16 -05:00
Ganael Laplanche d456e2e391 Resolve VkDeviceMemory/nullptr type mismatch to fix build on FreeBSD i386 2020-11-03 07:47:43 +01:00
Stenzek c557aa4a15 Vulkan: Add strict flag to memory type selection 2019-10-02 21:27:32 +10:00
Stenzek 2698e311aa Vulkan: Use correct aspect for D24S8 textures 2019-07-31 15:33:05 +10:00
Stenzek 427dd45151 Vulkan: Simplify command buffer fence tracking 2019-03-29 20:54:44 +10:00
Dzmitry Malyshau 4173a8f545 Use proper view type of framebuffer images 2019-03-15 12:24:39 -04:00
Stenzek f039149198 Move most backend functionality to VideoCommon 2019-02-19 16:57:54 +10:00
Stenzek e03b8e899e Vulkan: Move texture upload buffer to ObjectCache 2019-01-25 11:15:57 +10:00
Stenzek a0653a1a34 Vulkan: Fix incorrect fence being assigned to staging texture 2018-11-12 01:02:32 +10:00
Stenzek 8e2c063d62 TextureCache: Implement deferred/batched EFB copies 2018-11-07 16:25:01 +10:00
Stenzek b30342d38f VideoBackends: Support D24S8 abstract texture format 2018-07-19 21:47:42 +10:00
spycrab 40bb9974f2 Reformat all the things! 2018-04-12 21:28:39 +02:00
Lioncash 75f5fcdfee Assert: Remove unused parameter from DEBUG_ASSERT
This brings the macro in line with the regular ASSERT macro, which only has one
macro parameter.
2018-03-16 13:01:11 -04:00
Lioncash 50a476c371 Assert: Uppercase assertion macros
Macros should be all upper-cased. This is also kind of a wart that's
been sticking out for quite a while now (we avoid prefixing
underscores).
2018-03-14 22:03:12 -04:00
Stenzek 4c24a69710 VideoCommon: Add support for Abstract Framebuffers 2018-03-02 20:20:48 +10:00
Stenzek 2a6d9e4713 AbstractTexture: Add support for depth textures/formats 2018-03-01 17:31:24 +10:00