RFR: 8357625: Build should generate platform specific shaders
Lukasz Kostyra
lkostyra at openjdk.org
Fri Feb 13 14:50:49 UTC 2026
On Wed, 11 Feb 2026 11:36:45 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:
> On a given platform, the build generates prism and decora shader files for all platforms.
> Ideally it should generate only the platform specific shader files.
>
> Fix:
> Generate only platform specific hardware shaders.
> sw pipeline shaders must be generated for all platforms.
>
> But the hardware shaders, should be as:
> 1. Mac platform : metal and es2 shaders
> 2. Win platform: d3d shaders and if IS_INCLUDE_ES2 is true then es2 shaders as well
> 3. Linux : only es2 shaders
>
> Verification:
> Verified that the shaders are generated as expected.
> headul tests pass, apps launch correctly.
On Linux I noticed there is still a remnant "hlsl" directory created by Gradle:
lk at lk-VirtualBox ~/d/c/jfx-review (opt-shader-creation)> tree modules/javafx.graphics/build/hlsl 15:34:16
modules/javafx.graphics/build/hlsl
├── Decora
└── Prism
3 directories, 0 files
This is _after_ I used `gradle clean; git clean -xdf` and then rebuilt the project on clean repo.
I think the main culprit for it is the `initShaderDirs` task which was hiding in `build.gradle` at line 2783:
task initShaderDirs() {
doLast {
// Create empty hlsl dirs on all platforms for IDE support
file("$project.buildDir/hlsl/Decora").mkdirs()
file("$project.buildDir/hlsl/Prism").mkdirs()
file("$project.buildDir/gensrc/jsl-prism").mkdirs()
file("$project.buildDir/gensrc/jsl-decora").mkdirs()
}
}
The directories are empty (as they should be) but since we're cleaning up I think it would be worth to also tackle these.
-------------
PR Review: https://git.openjdk.org/jfx/pull/2071#pullrequestreview-3797690992
More information about the openjfx-dev
mailing list