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

duke duke at openjdk.org
Fri Sep 5 11:16:52 UTC 2025


Changeset: 91ff488e
Branch: direct3d12
Author:    Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date:      2025-08-26 12:38:22 +0000
URL:       https://git.openjdk.org/jfx-sandbox/commit/91ff488eacc1740c31dc8270a123841f1e638f4c

ResourceManager: Improve Sampler Heap optimization

There were cases where we would interchange between two common sets of
Samplers (most prominent example of that was CircleBlend* tests in
RenderPerf). This would make existing optimization not work well and
cause frequent Sampler Heap flushes mid-frame, slowing down the
pipeline.

This change reworks the optimization code to store all Sampler regions
allocated mid-frame. Also this assumes we always allocate as many
Samplers as Texture units we have available - that way we amortize the
cost of switching between ex. one and two texture slots used at once, as
both of these would reuse the same Sampler descriptor regions.

! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeDevice.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeTexture.cpp
! 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/D3D12InternalShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12MipmapGenComputeShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Profiler.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Profiler.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/D3D12SamplerDesc.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Shader.hpp

Changeset: ba916c37
Branch: direct3d12
Author:    Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date:      2025-09-05 12:56:09 +0000
URL:       https://git.openjdk.org/jfx-sandbox/commit/ba916c37f2e460aa7a91efd88b9401ca3da85eda

Add TextureBase and consolidate ResourceBarrier calls

TextureBase contains basic information related to every Texture used in
the backend - a D3D12Resource pointer and Resource State information.

TextureBase is used twofold:
- NativeTexture now extends TextureBase - this is to maintain existing
  Texture functionality
- NativeSwapChain wraps D3D12Resources acquired from DXGI into a
  TextureBase array

That way it is now possible to group D3D12 ResourceBarrier commands into
one call, saving CPU time and optimizing the backend a slight bit.

! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeDevice.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeDevice.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeRenderTarget.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeRenderTarget.hpp
! 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/D3D12NativeSwapChain.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeSwapChain.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeTexture.cpp
! 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/D3D12IRenderTarget.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/D3D12RenderingContext.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12RenderingContext.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12RenderingParameter.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/D3D12Shader.hpp
+ modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12TextureBase.hpp

Changeset: 89f652bc
Branch: direct3d12
Author:    Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date:      2025-08-29 14:33:00 +0000
URL:       https://git.openjdk.org/jfx-sandbox/commit/89f652bc5e4d7cf25552de3b0c764b41ccec0fbf

Adjust Ring Container sizes (again)

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

Changeset: 4a53b895
Branch: direct3d12
Author:    Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date:      2025-09-05 12:43:22 +0000
URL:       https://git.openjdk.org/jfx-sandbox/commit/4a53b89502587d78a441a73da1ffb18df90bc71f

Finalizing Ring Container optimizations

- Added Timing option to Profiler, allowing to measure time differences
  between select points - useful to CPU-side measure how long on avg
  certain parts take. Uses HPCounter from WindowsAPI.
- Moved Texture debug name to TextureBase, allowing to peek which
  textures are used within the RenderTarget
- Command Allocators are now associated with a single Command List which
  helps to reduce the initial frame drops when starting an object-heavy
  JavaFX app

! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeDevice.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeDevice.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeRenderTarget.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeSwapChain.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeTexture.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeTexture.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12CommandListPool.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12CommandListPool.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Debug.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Profiler.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12Profiler.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12RenderingContext.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12ResourceManager.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12RingContainer.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12TextureBase.hpp



More information about the openjfx-changes mailing list