JUCE 8 / Direct2D—assertion when calling getFromMemory()

I’m getting an assertion when calling juce::ImageCache::getFromMemory() with a large filmstrip file.

The filmstrip file is pretty big, 19200 pixels high and I’m getting the following assertion

   #if JUCE_DEBUG
    // Verify that the GPU can handle a bitmap of this size
    //
    // If you need a bitmap larger than this, you'll need to either split it up into multiple bitmaps
    // or use a software image (see SoftwareImageType).
    auto maxBitmapSize = deviceContext->GetMaximumBitmapSize();
    jassert (size.width <= maxBitmapSize && size.height <= maxBitmapSize);
   #endif

The trace is here →

I am using SoftwareImageType() for my image, but the assertion is triggered by the Juce getFromMemory() function, so possibly this is a bug?

1 Like

This is a known issue and I’m looking into it!

I’ve run into a sortof-unrelated issue in Loading bulk PNGs in threads got unsafe when moved to Direct2D? , but I wanted to call out that:

juce::PNGHelpers::createImageFromData
(in your stack trace there)

creates an image with this, which will always use NativeImageType, which will hit the d2d accelerated bitmap size limit:

Image image(hasAlphaChan ? Image::ARGB : Image::RGB, width, height, hasAlphaChan);

I’m looking for a neat way to override this myself (see linked thread above for why)

Cheers

We run into the same issue. We have lots of bitmaps organized as filmstrips and their are all too large. I tried to find out, how I could fall back to using the software renderer, but that does not fix this issue, as the bitmap loading isn’t related to the window renderer. Is there a switch to avoid Direct2D entirely ?

Bump! same here

I’m having the same issue! Filmstrips are not compatible at this time with JUCE 8?

Each GPU has a maximum texture size that in turn limits the size of a Direct2D bitmap. I believe the JUCE team is working on an update that supports using multiple Direct2D bitmaps for a single JUCE Image.

Matt

Thanks for your patience. We’ve just merged support for very large bitmaps in the Direct2D renderer to the develop branch:

1 Like