Open jackjt8 opened 2 years ago
tl;dr - New NullPointerExceptions caused by a large canvas size. Impacts a Windows 10 Java 17 system, which previously didn't have any issues going up to/beyond 12800x12800, and a Windows 7 Java 8 system. Kinda fixed by adding the Java Option -Dprism.maxvram
and setting it to a large value like 8G
(equal to the VRAM on my GPU).
JavaFX hardware acceleration has a maximum supported texture size defined within the graphics driver. In the past it was possible to disable hardware acceleration and use software rendering using
-Dprism.order=sw
which shifts the majority of limits towards the sample buffer which has a 12800x12800 upper limit if memory allows. See PR https://github.com/chunky-dev/chunky/pull/786 for all related issues as well various fixes.Typically this crops up as:
Or in cases where memory runs out before you reach the maximum supported texture size or the sample buffer maximum:
However in more recent testing with both Temurin-17.0.1+12 & OpenJFX 17.0.1, on Windows 10 Home 21H1 (build 19043.1348), and Java 8 update 311, on Windows 7 Pro version 6.1 (build 7601: SP1), a different set of NullPointerExceptions can be noted on both
d3d
/hw
andsw
pipelines. This testing extends to both Chunky 2.3.0 and 2.4.1. Important to note that this is NOT a regression with Chunky but something unexplainable is occurring. In the past with Chunky 2.3.0 it was possible to render at up to 12800x12800 without unexplained issues on my system with around 10,000 chunks loaded. For whatever reason both my system and that of another user are facing issues where they did not exist before.sw
&d3d
/hw
d3d
/hw
Tested using
-Dprism.verbose=true
to get pipeline information. Using-Dprism.order
to switch render pipeline (sw
,d3d
/hw
). Also tried using-Dprism.maxvram
with either render pipeline.d3d
/hw
(hardware accelerated pipeline) gives the following readout with my RTX 2070 (Win10).sw
(software pipeline):Growing pool com.sun.prism.sw.SWTexturePool@5a6cab0b target to 400,000,000
Growing pool com.sun.prism.sw.SWTexturePool@346aedef target to 484,000,000
java.lang.NullPointerException: Cannot invoke "com.sun.prism.RTTexture.createGraphics()" because "<local9>" is null
java.lang.NullPointerException: Cannot invoke "com.sun.prism.RTTexture.createGraphics()" because "<local9>" is null
Using
-Dprism.maxvram=8G
Growing pool com.sun.prism.sw.SWTexturePool@3591efe2 target to 1,296,000,000
Growing pool com.sun.prism.sw.SWTexturePool@3591efe2 target to 1,600,000,000
Growing pool com.sun.prism.sw.SWTexturePool@3591efe2 target to 2,621,440,000
Growing pool com.sun.prism.sw.SWTexturePool@3591efe2 target to 2,621,849,616
java.lang.IllegalArgumentException: WIDTH * HEIGHT is too large
d3d
/hw
(hardware accelerated pipeline):Growing pool D3D Vram Pool target to 406,489,550
Growing pool D3D Vram Pool target to 412,357,517
java.lang.NullPointerException: Cannot invoke "com.sun.prism.d3d.D3DTextureData.getContext()" because the return value of "com.sun.prism.d3d.D3DTextureResource.getResource()" is null
Using
-Dprism.maxvram=8G
Growing pool D3D Vram Pool target to 1,119,668,111
Growing pool D3D Vram Pool target to 1,547,668,111
Growing pool D3D Vram Pool target to 2,097,412,321
java.lang.NullPointerException: Cannot invoke "com.sun.prism.RTTexture.createGraphics()" because "<local9>" is null
java.lang.NullPointerException: Cannot invoke "com.sun.prism.RTTexture.createGraphics()" because "<local9>" is null
java.lang.NullPointerException: Cannot invoke "com.sun.prism.RTTexture.createGraphics()" because "<local9>" is null
java.lang.NullPointerException: Cannot invoke "com.sun.prism.d3d.D3DTextureData.getContext()" because the return value of "com.sun.prism.d3d.D3DTextureResource.getResource()" is null
/java.lang.NullPointerException: Cannot invoke "com.sun.prism.RTTexture.createGraphics()" because "<local9>" is null
From the data that I have collected using
-Dprism.maxvram
to assign more memory seems to mitigate these new NullPointerExceptions however the key question is how did theses new Exceptions arrise on both Chunky 2.4.X and 2.3.0 on two different systems with different Java setups.