Strange High GPU load on empty app [iOS]

Hello friends,

I continue to touch and test with the Juce framework to determine whether I will stay in it or not. So far everething I like a lot. But a few days ago I ran into a problem with GPU load. It’s only about iOS/Android app.

I created empty Juce project and added to the MainComponent
openGLContext.attachTo(*this);
Because I want to use opengl. And it seems with this option on Android there is no HUGE UI delay like in case with simple paint() event.

Everything is fast and CPU seems 20-30%. Yes I would like it better, but ok… ok. The main problem is that average GPU/GRAPHIC load is about 84-93% during each redraw. i.e when I call openGLContext.triggerRepaint(), gpu load growth up to 95%. That thing seems strange, because I not draw anything on a screen. I Just use empty MainComponent + triggerRepaint() in the mouseDrag method. I tried the same with a timer 60fps/per sec or 120fps/per sec. But see the same issue.

Is that a bug or is it expected? The iPad or android device heats up noticeably if I do this for a long time. Just so it will be more clear. The screenshot just shows about 30-60 sec of GPU work. If I will continue to call redraw, then energy impact will be in red zone and critical.

Thanks for any help! BTW I use latest Juce 6 version.

My code below:

#include "MainComponent.h"

using namespace juce;

//==============================================================================
MainComponent::MainComponent()
{
// Make sure you set the size of the component after
// you add any child components.
setSize (800, 600);

openGLContext.setContinuousRepainting(false);
openGLContext.setComponentPaintingEnabled(true);
openGLContext.attachTo(*this);
setRepaintsOnMouseActivity(false);
setOpaque(true);

}

MainComponent::~MainComponent()
{
// This shuts down the GL system and stops the rendering calls.
shutdownOpenGL();
}

//==============================================================================
void MainComponent::initialise()
{
// Initialise GL objects for rendering here.
}

void MainComponent::shutdown()
{
// Free any GL objects created for rendering here.
}

void MainComponent::render()
{
// This clears the context with a black background.
//juce::OpenGLHelpers::clear (juce::Colours::black);
}

//==============================================================================

void MainComponent::paint (juce::Graphics& g)
{

}

void MainComponent::resized()
{
// This is called when the MainComponent is resized.
// If you add any child components, this is where you should
// update their positions.
}

void MainComponent::mouseDrag(const juce::MouseEvent &event) {
openGLContext.triggerRepaint();
}

1 Like