Querz / mcaselector

A tool to select chunks from Minecraft worlds for deletion or export.
MIT License
3.17k stars 177 forks source link

Making the window very big causes an exception and freezes the interface #400

Open douira opened 1 year ago

douira commented 1 year ago

Describe the bug When I resize the main window to be very big, to full screen on macOS with fractional scaling. Logical resolution is 3360x1890 while the actual resolution it's rendering at is 6720x3780. The problem doesn't happen until it's almost fullscreen. The size at which it happens is around 95% full size when I resize it slowly.

To Reproduce Steps to reproduce the behavior:

  1. Start with java -jar -Xmx20G ...
  2. Make the window fullscreen either with the fullscreen button or by resizing the window manually
  3. Observe the errors in the console and that the window is frozen or has other graphical problems. (sometimes it doesn't completely freeze and the coordinates still update but the whole screen is white otherwise)

Expected behavior It shouldn't freeze and error.

Screenshots and other files Screenshots while errored (varies randomly):

Screenshot 2023-01-07 at 21 17 58 Screenshot 2023-01-07 at 21 19 10 Screenshot 2023-01-07 at 21 19 42 Screenshot 2023-01-07 at 21 21 07

The debug log is rather short: mcaselector-20230107-212047-1.log

But there are also errors in the console:

java.lang.IllegalStateException: Operation requires resource lock
    at javafx.graphics/com.sun.prism.impl.ManagedResource.assertLocked(ManagedResource.java:96)
    at javafx.graphics/com.sun.prism.impl.BaseTexture.assertLocked(BaseTexture.java:267)
    at javafx.graphics/com.sun.prism.impl.ps.BaseShaderContext.setTexture(BaseShaderContext.java:725)
    at javafx.graphics/com.sun.prism.impl.ps.BaseShaderContext.validateTextureOp(BaseShaderContext.java:613)
    at javafx.graphics/com.sun.prism.impl.ps.BaseShaderContext.validateTextureOp(BaseShaderContext.java:523)
    at javafx.graphics/com.sun.prism.impl.BaseGraphics.drawTextureRaw(BaseGraphics.java:727)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.ps.PPSOneSamplerPeer.filterImpl(PPSOneSamplerPeer.java:117)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.ps.PPSEffectPeer.filter(PPSEffectPeer.java:54)
    at javafx.graphics/com.sun.scenario.effect.CoreEffect.filterImageDatas(CoreEffect.java:106)
    at javafx.graphics/com.sun.scenario.effect.InvertMask.filterImageDatas(InvertMask.java:41)
    at javafx.graphics/com.sun.scenario.effect.FilterEffect.filter(FilterEffect.java:195)
    at javafx.graphics/com.sun.scenario.effect.FilterEffect.filter(FilterEffect.java:185)
    at javafx.graphics/com.sun.scenario.effect.FilterEffect.filter(FilterEffect.java:185)
    at javafx.graphics/com.sun.scenario.effect.DelegateEffect.filter(DelegateEffect.java:70)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.PrEffectHelper.render(PrEffectHelper.java:166)
    at javafx.graphics/com.sun.javafx.sg.prism.EffectFilter.render(EffectFilter.java:61)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.renderEffect(NGNode.java:2384)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2069)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
    at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
    at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:579)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
    at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:480)
    at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:321)
    at javafx.graphics/com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:92)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
    at javafx.graphics/com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:126)
    at java.base/java.lang.Thread.run(Thread.java:833)

and

java.lang.IllegalArgumentException: Texture must be non-null
    at javafx.graphics/com.sun.scenario.effect.impl.prism.PrTexture.<init>(PrTexture.java:38)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.PrDrawable.<init>(PrDrawable.java:44)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.ps.PPSDrawable.<init>(PPSDrawable.java:39)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.ps.PPSDrawable.create(PPSDrawable.java:60)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.ps.PPSRenderer.createCompatibleImage(PPSRenderer.java:216)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.ps.PPSRenderer.createCompatibleImage(PPSRenderer.java:67)
    at javafx.graphics/com.sun.scenario.effect.impl.ImagePool.checkOut(ImagePool.java:184)
    at javafx.graphics/com.sun.scenario.effect.impl.Renderer.getCompatibleImage(Renderer.java:124)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.ps.PPSRenderer.getCompatibleImage(PPSRenderer.java:224)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.ps.PPSOneSamplerPeer.filterImpl(PPSOneSamplerPeer.java:65)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.ps.PPSEffectPeer.filter(PPSEffectPeer.java:54)
    at javafx.graphics/com.sun.scenario.effect.LinearConvolveCoreEffect.filterImageDatas(LinearConvolveCoreEffect.java:85)
    at javafx.graphics/com.sun.scenario.effect.LinearConvolveCoreEffect.filterImageDatas(LinearConvolveCoreEffect.java:41)
    at javafx.graphics/com.sun.scenario.effect.FilterEffect.filter(FilterEffect.java:195)
    at javafx.graphics/com.sun.scenario.effect.FilterEffect.filter(FilterEffect.java:185)
    at javafx.graphics/com.sun.scenario.effect.DelegateEffect.filter(DelegateEffect.java:70)
    at javafx.graphics/com.sun.scenario.effect.impl.prism.PrEffectHelper.render(PrEffectHelper.java:166)
    at javafx.graphics/com.sun.javafx.sg.prism.EffectFilter.render(EffectFilter.java:61)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.renderEffect(NGNode.java:2384)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2069)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
    at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
    at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:579)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
    at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:480)
    at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:329)
    at javafx.graphics/com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:92)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
    at javafx.graphics/com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:126)
    at java.base/java.lang.Thread.run(Thread.java:833)

These exceptions are printed many times and the two types are mixed.

Settings:

Screenshot 2023-01-07 at 21 24 43

Environment:

Additional context Happens even if no world is loaded, so that isn't relevant here.

Insprill commented 1 year ago

You might be running out of VRAM to render that large of a texture. JavaFX is limited to 512MM by default. You can try giving it more using the prism.maxvram flag. For example, -Dprism.maxvram=2G to give it two gigs.

douira commented 1 year ago

Thanks, that fixed my issue with the freezing!

On 27. Jan 2023, at 02:18, Pierce Thompson @.***> wrote:

You might be running out of VRAM to render that large of a texture. JavaFX is limited to 512MM by default. You can try giving it more using the prism.maxvram flag. For example, -Dprism.maxvram=2G to give it two gigs.

— Reply to this email directly, view it on GitHub https://github.com/Querz/mcaselector/issues/400#issuecomment-1405891873, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECTWFSI35ZVC3VHCSGVAB3WUMO6PANCNFSM6AAAAAATUETGHM. You are receiving this because you authored the thread.