Is there a way to detect if Java FX is using hardware acceleration?
Asked Answered
W

5

4

And related to that, is there a way to force Java FX to use hardware acceleration and bomb if it is unable to?

Woodall answered 28/1, 2013 at 16:18 Comment(0)
W
15

Just found out:

You can run with -Dprism.verbose=true which will print what graphics pipeline it uses. "sw" or "j2d" for software and "d3d" or "es2" for hardware accelerated.

Woodall answered 28/1, 2013 at 17:22 Comment(0)
M
2

You can also try this hack

@SuppressWarnings("restriction")
static String getCurrentGraphicsPipeline() {
    return com.sun.prism.GraphicsPipeline.getPipeline().getClass().getName();
}

If you get back "com.sun.prism.sw.SWPipeline" then you're using software acceleration. All other values will mean that probably some form of hardware acceleration is being used.

Mylesmylitta answered 24/11, 2014 at 11:23 Comment(0)
T
1

If you are using eclipse as IDE, then you need to pass these VM arguments. You can add these VM arguments in the run Configurations.

Put these arguments there: -Dprism.verbose=true

Have a look at the image for more information

Trim answered 15/6, 2015 at 9:7 Comment(0)
A
0

For software renderers, the SCENE 3D feature is disabled.

if(Platform.isSupported(ConditionalFeature.SCENE3D)) {
    // hardware accelerated renderer
} else {
    // software renderer
}
Av answered 28/1, 2013 at 16:18 Comment(0)
L
0

It is possible to set your graphics pipeline using the -Dprism.order=es2 VM-option. You can replace es2 for the desired pipeline (d3d, sw, j2d).

Luvenialuwana answered 22/4, 2020 at 8:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.