I've finally managed to start Tim's demo with the KMS drivers. The following changes did the trick:
Code: Select all
diff --git a/SharedCode/SMwin.cpp b/SharedCode/SMwin.cpp
index 8bddf54..63706d7 100644
--- a/SharedCode/SMwin.cpp
+++ b/SharedCode/SMwin.cpp
@@ -60,7 +60,7 @@ bool SDLwindow::init(const char * title, int width, int height, uint32_t flags,
mHeight = height;
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32);
- SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 32);
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, majvsn);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minvsn);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
The "./SceneViewer -scene Bridge.scene" shows 16 fps at 1920x1080 fullscreen (256MB GPU RAM).
I've also managed to start ScreenRunner demo with additional shader changes:
Code: Select all
--- a/Projects/ScreenRunner/Shaders/fs1.glsl
+++ b/Projects/ScreenRunner/Shaders/fs1.glsl
@@ -1,5 +1,5 @@
-#version 120
-//precision mediump float; // Set the default precision to medium
+#version 100
+precision mediump float; // Set the default precision to medium
uniform sampler2D u_Texture; // texture
varying vec2 v_UV; // Texture UV coordinate
diff --git a/Projects/ScreenRunner/Shaders/vs1.glsl b/Projects/ScreenRunner/Shaders/vs1.glsl
index 011a577..a7a9541 100644
--- a/Projects/ScreenRunner/Shaders/vs1.glsl
+++ b/Projects/ScreenRunner/Shaders/vs1.glsl
@@ -1,5 +1,5 @@
-#version 120
-//precision mediump float; // Set the default precision to medium. We don't need as high of a
+#version 100
+precision mediump float; // Set the default precision to medium. We don't need as high of a
uniform mat4 u_ProjMatrix; // view/projection matrix.
uniform mat4 u_ModelMatrix; // model matrix.
It shows about 35fps at 1920x1080.
Probably, the above changes are needed on Pi3 only.
I'm using the latest Raspbian Buster, BTW.
SDL_GL_SetSwapInterval(0) does disable vsync for me.
I've managed to get over 100 fps at 640x480, while it's 60 with vsync enabled.
Not sure why it's not working for you. Probably it's not implemented correctly in ruby/python.
Unfortunately, I couldn't build
pi3d. It shows a number of "Use of unstable feature/library"
errors, and eventually stops with "error: Could not compile `arrayvec`".
Would be interesting to give it a try on my HDMI display and see if I get the same vsync behaviour.
BTW, fake KMS works equally fast, and I've seen some comments that it's preferred to the full KMS version.
Personally I find full KMS less stable as I get black screen with some applications, such as vlc, running
in fullscreen mode.
Thanks,
Val.