git: openjdk/jfx-sandbox: direct3d12: 2 new changesets
duke
duke at openjdk.org
Wed Feb 19 11:38:05 UTC 2025
Changeset: cc8da118
Branch: direct3d12
Author: Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date: 2025-02-19 12:10:35 +0000
URL: https://git.openjdk.org/jfx-sandbox/commit/cc8da1184b1c14cc42583938a3b04c82018596be
D3D12: Implement D3D12Context.blit()
This change introduces implementation of blit() functionality in D3D12
backend. D3D12 does not support blitting as an operation, so it had to
be implemented "the long way".
Depending on the scenario, the backend will opt for one of four paths:
- Fast path with non-MSAA source RT (== CopyTextureRegion)
- Fast path with MSAA source RT (== ResolveSubresourceRegion)
- Slow path with non-MSAA source RT (== quad render via BlitPS)
- Slow path with MSAA source RT (== ResolveSubresource + BlitPS)
It is assumed that we are always blitting to 1-sample destination
texture. This I believe was also the assumption of the blit()
implementation in D3D9 - StretchRect() only supported source MSAA texture.
But, if needed, with some testing this restriction could probably be
lifted (we'd always have to use the slow path then).
The choice between slow and fast path is done depending on source and
destination texture sizes - fast path is taken when destination box has
same width and height as source box, otherwise slow path is taken.
Fast path performs a simple Copy and/or Resolve call, while slow path
employs the newly added Blit Pixel Shader to resample the source RT to
destination dimensions. This also means, slow path has to preserve current
Rendering Context and potentially create an intermediate Texture (when source
RT has MSAA enabled) to resolve source RT to a 1-sample texture.
Some other changes and adjustments were made in the process to
accommodate this change + fix some very minor earlier mistakes.
! build.gradle
! modules/javafx.graphics/src/main/java/com/sun/prism/d3d12/D3D12Context.java
! modules/javafx.graphics/src/main/java/com/sun/prism/d3d12/D3D12Pipeline.java
! modules/javafx.graphics/src/main/java/com/sun/prism/d3d12/D3D12ResourceFactory.java
! modules/javafx.graphics/src/main/java/com/sun/prism/d3d12/ni/D3D12NativeDevice.java
! modules/javafx.graphics/src/main/java/com/sun/prism/d3d12/ni/D3D12NativeShader.java
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12Common.hpp
! 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.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeShader.cpp
+ 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/D3D12Matrix.hpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12MipmapGenComputeShader.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12PSOManager.cpp
! 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/D3D12ShaderLibrary.cpp
+ modules/javafx.graphics/src/main/native-prism-d3d12/hlsl6/BlitPS.hlsl
! modules/javafx.graphics/src/main/native-prism-d3d12/hlsl6/Internal_D3D12ShaderResourceDataHeader.hpp
+ modules/javafx.graphics/src/main/native-prism-d3d12/hlsl6/PassThroughDecl.hlsl
! modules/javafx.graphics/src/main/native-prism-d3d12/hlsl6/PassThroughVS.hlsl
Changeset: f5d0aa62
Branch: direct3d12
Author: Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date: 2025-02-19 12:36:12 +0000
URL: https://git.openjdk.org/jfx-sandbox/commit/f5d0aa6228ca9e65fc97271447d33349e8fdaf3e
RenderingContext: Rename RestoreParameters
Renamed to RestoreStashedParameters to match StashParameters better
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeDevice.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12RenderingContext.cpp
! modules/javafx.graphics/src/main/native-prism-d3d12/Internal/D3D12RenderingContext.hpp
More information about the openjfx-changes
mailing list