git: openjdk/jfx-sandbox: direct3d12: 4 new changesets

duke duke at openjdk.org
Mon Aug 4 10:28:54 UTC 2025


Changeset: 4e5a5eff
Branch: direct3d12
Author:    Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date:      2025-07-16 14:36:41 +0000
URL:       https://git.openjdk.org/jfx-sandbox/commit/4e5a5eff9ed493ee6343a733522edd6b87beba5e

InternalShader: Reduce mid-frame texture count use by shader variant

! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12InternalShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12InternalShader.hpp

Changeset: 51eefbc1
Branch: direct3d12
Author:    Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date:      2025-07-28 14:36:44 +0000
URL:       https://git.openjdk.org/jfx-sandbox/commit/51eefbc15fbbaaa1c5f4c3fc5c629c09fd81ba28

Unify descriptor/constant reservation code

This change moves the process of reserving mid-frame descriptors and
Constant Ring Buffer space to a common code in ResourceManager. Shaders
provide information which and how many resources they need and
ResourceManager performs the allocation, afterwards passing newly
reserved Descriptors to Shaders for final preparation.

Constant data and Texture SRV/UAV Descriptor creation is still left in
Shader-specific code. This is because some shaders (notably MipmapGenCS)
need to write Texture SRVs differently from other Shaders. Constant data
is also stored per-Shader so it follows a similar scheme.

Some other bits and pieces were un-magic-numbered, like DTable sizes.

This change is the groundwork for mid-frame Descriptor use optimization
coming in the next commit.

! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeShader.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12BlitPixelShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12BlitPixelShader.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12InternalShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12InternalShader.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12MipmapGenComputeShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12MipmapGenComputeShader.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12ResourceManager.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12ResourceManager.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12RingBuffer.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12RootSignatureManager.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Shader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Shader.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Utils.hpp
+ modules/javafx.graphics/src/main/native-prism-d3d12/hlsl6/D3D12ShaderLimits.h
! modules/javafx.graphics/src/main/native-prism-d3d12/hlsl6/D3D12ShaderSlots.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/hlsl6/ShaderCommon.hlsl

Changeset: 096a828a
Branch: direct3d12
Author:    Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date:      2025-07-31 15:52:25 +0000
URL:       https://git.openjdk.org/jfx-sandbox/commit/096a828ab1415dc7c597791970c9adbf9dc93f05

Reuse Sampler Descriptors mid-frame

D3D12 limits available Shader-visible Sampler Heap size to 2048
Descriptors. This creates a bottleneck when recording data mid-frame on
Sampler Ring Descriptor Heap, causing frequent flushes and limiting
GPU-CPU parallelism.

This can be heavily optimized because in most cases we reuse the same
type of Sampler for all textures. ResourceManager now recognizes when
newly set Texture uses the same Sampler and reuses old descriptors,
skipping the mSamplerHeap.Reserve() call.

This "unlocks" the possibility to adjust Ring Container sizes for 3D in
order to increase performance.

! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeShader.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeTexture.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12BlitPixelShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12BlitPixelShader.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12InternalShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12InternalShader.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12MipmapGenComputeShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12MipmapGenComputeShader.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12ResourceManager.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12ResourceManager.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12RingContainer.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12SamplerDesc.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Shader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Shader.hpp

Changeset: 44c08db2
Branch: direct3d12
Author:    Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date:      2025-08-04 12:26:17 +0000
URL:       https://git.openjdk.org/jfx-sandbox/commit/44c08db206be69f35f50ee7c92637079a0dce2d7

Adjust mid-frame containers size (phase 1)

! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeDevice.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12ResourceManager.cpp



More information about the openjfx-changes mailing list