git: openjdk/jfx-sandbox: direct3d12: 2 new changesets
duke
duke at openjdk.org
Wed Mar 19 15:21:17 UTC 2025
Changeset: d5b08cf5
Branch: direct3d12
Author: Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date: 2025-03-19 15:20:35 +0000
URL: https://git.openjdk.org/jfx-sandbox/commit/d5b08cf5dae1b4c07acef84de3f7632575e7dea5
BlitTexture: Remove excessive logs
These logs were used during blit implementation and are no longer needed
! modules/javafx.graphics/src/main/native-prism-d3d12/D3D12NativeDevice.cpp
Changeset: 36d7013c
Branch: direct3d12
Author: Lukasz Kostyra <lukasz.kostyra at oracle.com>
Date: 2025-03-19 15:22:16 +0000
URL: https://git.openjdk.org/jfx-sandbox/commit/36d7013c5406f74c541e0c40b5b71f691992b1f9
Mtl1PS: Fix addition of specular component
In situations where we turned out to not have any specular component to
add, specPower could be calculated as 0.0, which when calculating
specular contrubiton with pow() we would get 0^0, which results in -NaN.
Between HLSL3 and HLSL6 (or between FXC and DXC) there had to be a
change in how some math is handled by the shaders, because originally
D3D9 would just calculate the result to 0.0 contribution for specular.
Here we have to be more mindful, as -NaN propagates through light
equations and ends up -NaN-ing the resulting color. Problem was most
noticeable on Ensemble8 3DSphere demo, where "land" rendered incorrectly.
To fix the problem, specular power is checked in computeLight() and
specular contribution is only added when power is greater than 0.0.
Moreover, the computeLight for loop now only loops based on actual light
count (numShaderLights instead of numLights). That prevents unnecessary
calculation of light components which are potentially not initialized and
can also result in -NaN being propagated to result color, plus it
optimizes the shader a bit for lower light scenes.
! modules/javafx.graphics/src/main/native-prism-d3d12/hlsl6/Mtl1PS.hlsl
! modules/javafx.graphics/src/main/native-prism-d3d12/hlsl6/psMath.hlsl
More information about the openjfx-changes
mailing list