I'm developing an all purpose graphic engine for the raspberry Pi and recently I added stencil testing to clip some excess polygons. While the engine normally runs 18216 faces at 60fps, when I set the stencil on for some of the drawing, the fps drops really hard (40fps). The engine is cross-platform, and this issue doesn't happen neither on Android, PC Linux, nor Windows.

Seems like there is some raspberry harware optimizations disabled or something like that wich I might be missing.

I render directly using the Dispman without X, the stencil buffer is 8 bits, the depth 16 and the color buffer is 8+8+8.

Is there something I have to take into account when using the stencil buffer on the raspberry?

Thanks in advance.

  • Try putting your code on github if you want others to take a look at it. – Dmitry Grigoryev Nov 25 '16 at 14:20
  • more than a code check, I was hoping that somebody could point me out if there is some specific hardware optimization I could me disabling when enabling stenciling, cause the code seems right on the android, windows and pc linux. – diego.martinez Nov 25 '16 at 15:56
  • 1
    It's probably driver or hardware support that's not available, hence the performance drop. – John Keates Nov 26 '16 at 3:43
  • @JohnKeates that is what I was afraid of, so maybe the Rpi is falling back to software rendering cause of the stenciling... – diego.martinez Nov 28 '16 at 15:04
  • The closed driver doesn't have a software rendering path. You may want to try the open driver, though, so you can analyze what's going on. – Eric Anholt Nov 29 '16 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.