Skip to content

GS/DX12: Use Enhanced Barriers API#13792

Merged
lightningterror merged 2 commits into
PCSX2:masterfrom
TheLastRar:D3D12-EB
Jan 21, 2026
Merged

GS/DX12: Use Enhanced Barriers API#13792
lightningterror merged 2 commits into
PCSX2:masterfrom
TheLastRar:D3D12-EB

Conversation

@TheLastRar
Copy link
Copy Markdown
Contributor

@TheLastRar TheLastRar commented Jan 8, 2026

Description of Changes

Detect and use D3D12 enhanced barriers

Rationale behind Changes

Enhanced barriers allow us to specify the needed sync/access of a resource with greater control.
On hardware that is able to take advantage for this information, we see a significant speed increase.

Additionally, these barriers allow us to use the same resource for feedback, using simultaneous access textures with the common layout, we can specify the access flags we need for feedback.
Note: This does hit a validation bug that is currently only fixed in the agility version of D3D12Core.

Texture states are also represented using an enum, which may allow us to take advantage of the more fine grained control over sync/access during transitions.

Use of Agility SDK
The Agility SDK is required to support enhanced barriers on Windows 10.

The recommended way to use the Agility SDK is unsuitable for us, as it requires us to bundle the redistribution files.
As we are GPL, We can't bundle these files (or force the user to provide them), so an alternative method is used here.
We use ID3D12SDKConfiguration1, to load the Agility SDK only if the user provides it, falling back to the OS D3D12 if missing.
This is supported on the latest version of Win10 22H2 and Win 21H2 LTS.
SDK 1.608.0 is the oldest version loadable with this method, which happens to be the first version with enhanced barriers.

We could provide a separate download in future, much like what is currently done for ffmpeg.
After discussion on the discord, it seems it's fine to bundle the Agility SDK
The CMake/MSBuild scripts and loader still make it an optional dependency.
Download and extraction is done as per other dependencies, instead of using nuget/dotnet CLI

Suggested Testing Steps

Test games using the DX12 renderer.

Did you use AI to help find, test, or implement this issue or feature?

No

Comment thread pcsx2/GS/Renderers/DX12/GSDevice12.cpp Outdated
@JordanTheToaster
Copy link
Copy Markdown
Member

Some benchmarks on an RX 9060XT without and with enhanced barriers.

image image image

@Felipefpl
Copy link
Copy Markdown

The recommended way to use the Agility SDK is unsuitable for us, as it requires us to bundle the redistribution files. As we are GPL, We can't bundle these files (or force the user to provide them), so an alternative method is used here. We use ID3D12SDKConfiguration1, to load the Agility SDK only if the user provides it, falling back to the OS D3D12 if missing. This is supported on the latest version of Win10 (via an update during 2023), but I'm unsure if it's supported on Win10 LTSC. SDK 1.608.0 is the oldest version loadable with this method, which happens to be the first version with enhanced barriers.

I have the LTSC version, i hope it wont be unsupported. :/

@TheLastRar
Copy link
Copy Markdown
Contributor Author

I have the LTSC version, i hope it wont be unsupported. :/

If you are able, can you run the PR build, start either Big Picture Mode or a game in DX12 and check if
D3D12: Agility SDK configuration is not available is logged or not.

@lextra2
Copy link
Copy Markdown

lextra2 commented Jan 9, 2026

For anyone wondering, Windows 11 IoT Enterprise LTSC Version 24H2 OS build 26100.1742 prints the following log:

D3D12: Agility version: 612
D3D12: Enhanced Barriers: Supported

@TheLastRar TheLastRar force-pushed the D3D12-EB branch 10 times, most recently from 05b352c to 8fe8e52 Compare January 11, 2026 20:29
@lightningterror lightningterror added this to the Release 2.8 milestone Jan 12, 2026
@TheLastRar TheLastRar force-pushed the D3D12-EB branch 3 times, most recently from b7bd861 to 007c66c Compare January 16, 2026 01:19
@TheLastRar TheLastRar marked this pull request as ready for review January 16, 2026 01:36
@TheLastRar
Copy link
Copy Markdown
Contributor Author

For those with concerns about Win10 LTSC
It was tested and found working by a couple testers.

Also, after discussing with the team is seems we can just bundle the Agility SDK, provided it's still an optional dependency (which it is with the current PR code).

Copy link
Copy Markdown
Member

@JordanTheToaster JordanTheToaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good and fast.

@lightningterror lightningterror merged commit 5ff1eed into PCSX2:master Jan 21, 2026
12 checks passed
@TheLastRar TheLastRar deleted the D3D12-EB branch January 21, 2026 10:36
Hancock33 added a commit to Hancock33/batocera.piboy that referenced this pull request Jan 25, 2026
------------------------------------------------------------------------------------------
rocknix-abl.mk 41156820a11869c4b6950d873c403d532ef0779b # Version: Commits on Jan 20, 2026
------------------------------------------------------------------------------------------
Update ABL, remove battery stats and white list,

-------------------------------------------------------------------------------------
azahar.mk 46429f9c02ff6e6ec73d7d6ee62e34a6ce4b5617 # Version: Commits on Jan 21, 2026
-------------------------------------------------------------------------------------
Update PR template to use master branch,

-----------------------------------------------------------------------------------
cemu.mk a20032ffb52315832ef5a996da8c7014c4e99c04 # Version: Commits on Jan 21, 2026
-----------------------------------------------------------------------------------
Latte/Metal: Exclude more Metal only logic on non-Apple platforms and cleanups (#1781),

-----------------------------------------------------------------------------------
eden.mk 338ea4e9d5fb48a0ea29c231fd6ec7d5b9433ce1 # Version: Commits on Jan 21, 2026
-----------------------------------------------------------------------------------
[texture_pass] Re-Add caching optimization for Texture_Pass (#3356)

--------------------------------------------------------------------------------------
openmsx.mk efedc874a948deee3637265b2476562af4208667 # Version: Commits on Jan 21, 2026
--------------------------------------------------------------------------------------
Clarify that auto guess mapper type may fail.

Closes #2073.,

---------------------------------------------------
pcsx2.mk v2.7.57 # Version: Commits on Jan 21, 2026
---------------------------------------------------
- [GS/DX12: Use Enhanced Barriers API](PCSX2/pcsx2#13792)

,

-------------------------------------------------------------------------------------
ppsspp.mk 7f553bf9b014c4aef127f4d853e861d254bfff44 # Version: Commits on Jan 21, 2026
-------------------------------------------------------------------------------------
Merge pull request #21138 from hrydgard/sdl-correct-word-wrap-height

SDL: Fix measuring of multi-line strings.,

------------------------------------------------------------------------------------
rpcs3.mk 3e49c32c9c59b2bdf6bb29ec7d1e44074ffad4e5 # Version: Commits on Jan 18, 2026
------------------------------------------------------------------------------------
USB: Summonride updates,

-----------------------------------------------------
ryujinx.mk 1.3.244 # Version: Commits on Jan 20, 2026
-----------------------------------------------------
Canary-1.3.244

-------------------------------------------------------------------------------------
vita3k.mk 275d9ad3953a1745b7d369694156144c6e939f8f # Version: Commits on Jan 21, 2026
-------------------------------------------------------------------------------------
gui/bgm player: Fix uninitialized prefs in Cubeb stream params.

- The BGM player was creating cubeb_stream_params without initializing the prefs field.

- This caused random loopback flags depending on stack garbage.

Co-authored-by: bookmist <roshst@yandex.ru>,

-------------------------------------------------------------------------------------
ikemen.mk b321f542b6e5d90e32b24c2b5fd3b96bbc9498b9 # Version: Commits on Jan 21, 2026
-------------------------------------------------------------------------------------
Merge pull request #3166 from ikemen-engine/fix5

fix: layers order,

-------------------------------------------------------------------------------------------
moonlight-qt.mk 05ef938e2ce0d98c67726500e371f8aaa0b3672e # Version: Commits on Jan 21, 2026
-------------------------------------------------------------------------------------------
Add support for LTR ACK control messages,

---------------------------------------------------------------
ruffle.mk nightly-2026-01-21 # Version: Commits on Jan 21, 2026
---------------------------------------------------------------
## What's Changed

* build(deps): bump the cargo-minor group with 5 updates by @dependabot[bot] in ruffle-rs/ruffle#22813

* build(deps-dev): bump the npm-minor group in /web with 12 updates by @dependabot[bot] in ruffle-rs/ruffle#22809

**Full Changelog**: ruffle-rs/ruffle@nightly-2026-01-17...nightly-2026-01-21,

-----------------------------------------------------------------------------------------
rpi-eeprom.mk 5fa9a43d66c0004d55f7c2c7bd8bdd48c2efc020 # Version: Commits on Jan 21, 2026
-----------------------------------------------------------------------------------------
pieeprom-2026-01-21: 2712: Fix bad HMAC arguments lockup (latest)

* rpi-fw-crypto: Fix bad hmac arguments lock-up

  Improve argument validation so that a bad key-id or invalid private key

  can no longer cause a lock-up during HMAC operations.,

----------------------------------------------------------------------------------------
pironman5.mk 628e4a3b7c065bdaf53726aad0c35543ed6af86b # Version: Commits on Jan 21, 2026
----------------------------------------------------------------------------------------
Merge branch 'max',

-----------------------------------------------------------------------------------------
sdl3_mixer.mk b2665ab0265c7addf93851dd19f1681317e92a29 # Version: Commits on Jan 21, 2026
-----------------------------------------------------------------------------------------
release: there is no longer a SDLMIXER_TESTS CMake option,

---------------------------------------------------------------------------------------
alephone.mk 6ad54fdb82a22dcf2ee226e3eb29cc2034244f03 # Version: Commits on Jan 21, 2026
---------------------------------------------------------------------------------------
Update CodeQL github action to v4, v3 will be deprecated in december,

------------------------------------------------------------------------------------
box64.mk 3ec5de03c786333ed8d5a51c5b35a8bd6e22b229 # Version: Commits on Jan 21, 2026
------------------------------------------------------------------------------------
[INTERP] Fixed F0 66 BA opcodes,

-----------------------------------------------------------------------------------------
catacombgl.mk 700aa85c7eda3cb830d3ecdc4a81e601c84fc1f4 # Version: Commits on Jan 20, 2026
-----------------------------------------------------------------------------------------
Add stand before gate screen for Catacomb Abyss v1.12,

---------------------------------------------------------------------------------------
etlegacy.mk b9f1c5ef2bfde39392defadb594336ce1fa58f35 # Version: Commits on Jan 21, 2026
---------------------------------------------------------------------------------------
cgame: don't draw smoke/blood puffs for self 1P,

----------------------------------------------------------------------------------------
openmohaa.mk e1f49207d26f7b63996d65c5132900d4beb37d31 # Version: Commits on Jan 20, 2026
----------------------------------------------------------------------------------------
fix(fgame)!: rename sv_botxname to `g_botx_name` for consistency

The name of bots are game-specific settings, so it must be prefixed with `g_` rather than `sv_`, plus the setting name should properly separated by an underscore for clarity.

Some allocation variables like `sv_numbots` and `sv_maxbots` start with `sv_` even though they are read by game. It's because they interfere with the server's allocation of clients.,

---------------------------------------------------------------------------------------
mangohud.mk 6dfe40c10fb2118766d18cdbffc3de55c9b0ac27 # Version: Commits on Jan 21, 2026
---------------------------------------------------------------------------------------
battery: ensure discharge power is always positive,

-------------------------------------------------------------------------------------------------
shadps4-qtlauncher.mk 60e39def38262de5ef37743c7972077d02d5735e # Version: Commits on Jan 21, 2026
-------------------------------------------------------------------------------------------------
New translations en_us.ts (Czech) (#236),

---------------------------------------------------------------------------------------------
rocknix-joypad.mk 7647fdb0fc89cd69b284903bf7707e861df5dc7e # Version: Commits on Jan 20, 2026
---------------------------------------------------------------------------------------------
Merge pull request #12 from sydarn/cansleep

Take sleeping gpios into account, cansleep,

----------------------------------------------------------------------------------------
retroarch.mk 6131f07c4c79a08cbe4ab2c45831116440939bfd # Version: Commits on Jan 07, 2026
----------------------------------------------------------------------------------------
minor vulkan tweaks,

----------------------------------------------------------------------------------------
doomretro.mk c419d5e1c37d186fe92736c154716325142eab67 # Version: Commits on Jan 21, 2026
----------------------------------------------------------------------------------------
More minor tweaks,

--------------------------------------------------------------------------------------
vkquake.mk 53300b653920b1d8a78915f1311d2fc876b9c480 # Version: Commits on Jan 21, 2026
--------------------------------------------------------------------------------------
Replace descriptor sets with device addresses for animation update compute shaders (#860),

-----------------------------------------------------------------------------------------
sonic3-air.mk 4118fb70304f291065bc67b7f86ad668588facba # Version: Commits on Jan 20, 2026
-----------------------------------------------------------------------------------------
Updated metadata.json to fit version.inc,

----------------------------------------------------------------------------------
trx.mk f6f238c412209eb4cb2f0ab20c27cb00051da247 # Version: Commits on Jan 21, 2026
----------------------------------------------------------------------------------
lua: add rooms.flip() and rooms.flip_effect()

Resolves #4704.,

------------------------------------------------------------------------------------------
xash3d-fwgs.mk b83d763a509486a2d9dcae84146448d0857ddca8 # Version: Commits on Jan 21, 2026
------------------------------------------------------------------------------------------
3rdparty: mainui: update,

---------------------------------------------------------------------------------------------
libretro-citra.mk 07119967fb0e9bb7339bb681917301ace52eee60 # Version: Commits on Jan 18, 2026
---------------------------------------------------------------------------------------------
libretro core

* Bringing citra libretro implementation over

* libretro: hook up vulkan renderer

* libretro: github actions

* libretro: gyro

* libretro: core options v2

* libretro: on ios turn off shader jit if unavailable

* moltenvk 1.3.0 introduces 8-bit indexes but allocates 16-bit for metal; this ends up allocating stream buffer * 2 = 132MiB. Instead, just use 16-bit indexes. (This will be necessary for standalone when bumping moltenvk version.),

--------------------------------------------------------------------------------------------------
libretro-clownmdemu.mk 9947f719a4107cc4cc71f2507419360325a7a4c9 # Version: Commits on Jan 20, 2026
--------------------------------------------------------------------------------------------------
Update common.,

---------------------------------------------------------------------------------------------
libretro-fbneo.mk be0d01f2cd8d93c14002a554034482c9c213a364 # Version: Commits on Jan 20, 2026
---------------------------------------------------------------------------------------------
(libretro) update files,

--------------------------------------------------------------------------------------------------
libretro-gearcoleco.mk 202386555d2a7a178ac65cb92b03cff378a60831 # Version: Commits on Jan 21, 2026
--------------------------------------------------------------------------------------------------
[libretro] Fallback to coleco.rom if colecovision.rom is not found,

-------------------------------------------------------------------------------------------------
libretro-geargrafx.mk 14c88c138bd35c8a1bf7e827096d7a2a7324b64e # Version: Commits on Jan 21, 2026
-------------------------------------------------------------------------------------------------
Fix PC-CD audio loading in big endian systems. #91,

--------------------------------------------------------------------------------------------------------------
libretro-genesisplusgx-expanded.mk 108e86e0c6b558b6215ae06857579fd11ef1f752 # Version: Commits on Jan 20, 2026
--------------------------------------------------------------------------------------------------------------
MAX_ROM_SIZE,

----------------------------------------------------------------------------------------------
libretro-ppsspp.mk 7f553bf9b014c4aef127f4d853e861d254bfff44 # Version: Commits on Jan 21, 2026
----------------------------------------------------------------------------------------------
Merge pull request #21138 from hrydgard/sdl-correct-word-wrap-height

SDL: Fix measuring of multi-line strings.,

--------------------------------------------------------------------------------------------
slang-shaders.mk 342450fc597a3519fac42340f59b2a0d6067ad8a # Version: Commits on Jan 21, 2026
--------------------------------------------------------------------------------------------
Add pixel_transparency-simpletex_lcd preset (#834)

Combines simpletex_lcd with pixel_transparency shader, with

BACKGROUND_INTENSITY set to 0 to disable the paper texture.,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants