kuesa icon indicating copy to clipboard operation
kuesa copied to clipboard

Terrible framerate on MacOS

Open vpicaver opened this issue 5 years ago • 13 comments

When I load Sponza (from glTF-Sample-Models repo) into the AssetPipelineEditor, it runs at an unusable 2FPS. I've also experienced very slow framerates with the kuesa's car example. Loading the same scene into Blender 2.8 using Eevee, its an a reasonable framerate. I'm currently running on 2018 Mac Book Pro with Radean Pro 560X.

vpicaver avatar Feb 27 '19 13:02 vpicaver

Hi. Thanks for the report. I'll ask my colleagues on Mac to see if they have something similar.

lemirep avatar Feb 27 '19 14:02 lemirep

Hi, Sponza is indeed very slow on my identical MBP.

Looking at apitrace, it's drawing loads of objects ping-pong-ing between 2 sets of textures, too many context changes...

mkrus avatar Feb 28 '19 09:02 mkrus

Pull request #54 fixes this

mkrus avatar Feb 28 '19 12:02 mkrus

I'm still getting fairly slow performance, even with the sorting patch. After running AssetPipelineEditor through Instruments, it looks like Qt3D is causing the AMD driver to re-compile a fragment shader every frame! See screenshot:

screen shot 2019-03-07 at 4 20 51 pm

I think you should re-open this bug.

vpicaver avatar Mar 07 '19 21:03 vpicaver

will investigate

mkrus avatar Mar 07 '19 21:03 mkrus

gltf.zip

Here's another very small example that causes the issue. I think it also blinks because it's recompiling the fragment shader ever frame.

vpicaver avatar Mar 12 '19 00:03 vpicaver

@vpicaver if you're building your own qt3d 5.12, please test https://codereview.qt-project.org/#/c/255678/ see if it fixes the issue for you. Thanks!

mkrus avatar Mar 13 '19 19:03 mkrus

@mkrus After applying the patch, I see a slight improvement. Textureless models are buttery smooth as before. Models with textures still suffer from shader compiling performance overhead. The patch does prevent the models from blinking. I get the same performance profile with the patch. Did you test patch with a model with multiple textured objects? It took me a bit to build qt from source. Future reviews should take me less time.

vpicaver avatar Mar 15 '19 02:03 vpicaver

Thanks for trying!

Other slow models: TextureSettingsTest, VC...

mkrus avatar Mar 16 '19 19:03 mkrus

wondering about this : couldn't it be caused by the following mac QtWidgets issue, for the APE ? https://codereview.qt-project.org/#/c/251381/

jcelerier avatar Mar 20 '19 10:03 jcelerier

I don't think, I think that would cause the frame rate to always be bad. Current slowness appears to kick in when texture binding changes for the same shader from one draw call to the next. In that case if appears it recompiles the shader for every draw call. Sounds like a driver bug to me.

mkrus avatar Mar 21 '19 20:03 mkrus

How do we report the driver bug so it get's fixed? It sounds like apple doesn't really care about OpenGL anymore but it seems like a clear regression in functionality. Does it happen on other Mac's with different drivers?

vpicaver avatar Mar 22 '19 02:03 vpicaver

Was there any progress on this issue? I hit the same issue on Qt 5.14

I'm using a SceneLoader which loads a static model but still got this issue, is there any workaround that I can do to prevent texture binding change if that's the problem?

larrylin28 avatar Sep 04 '20 18:09 larrylin28