Skip to content

Commit

Permalink
Pi4: Rendering fix and performance improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Dec 3, 2019
1 parent 1b3dd0d commit 05b91bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
7 changes: 2 additions & 5 deletions mythtv/libs/libmythtv/opengl/mythegldmabuf.cpp
Expand Up @@ -20,9 +20,6 @@ MythEGLDMABUF::MythEGLDMABUF(MythRenderOpenGL *Context)
OpenGLLocker locker(Context);
m_useModifiers = Context->IsEGL() && Context->HasEGLExtension("EGL_EXT_image_dma_buf_import_modifiers");
QSurfaceFormat fmt = Context->format();
// NB this forces GL_TEXTURE_EXTERNAL_OES texture type for GLES2
// untested on GLES3 or GL2
m_gltwo = fmt.majorVersion() < 3;
}
}

Expand Down Expand Up @@ -64,7 +61,7 @@ inline vector<MythVideoTexture*> MythEGLDMABUF::CreateComposed(AVDRMFrameDescrip
sizes.emplace_back(QSize(Frame->width, Frame->height));
vector<MythVideoTexture*> textures =
MythVideoTexture::CreateTextures(Context, Frame->codec, FMT_RGBA32, sizes,
m_gltwo ? GL_TEXTURE_EXTERNAL_OES : QOpenGLTexture::Target2D);
GL_TEXTURE_EXTERNAL_OES);
for (uint i = 0; i < textures.size(); ++i)
textures[i]->m_allowGLSLDeint = false;

Expand Down Expand Up @@ -160,7 +157,7 @@ inline vector<MythVideoTexture*> MythEGLDMABUF::CreateSeparate(AVDRMFrameDescrip
VideoFrameType format = PixelFormatToFrameType(static_cast<AVPixelFormat>(Frame->sw_pix_fmt));
vector<MythVideoTexture*> result =
MythVideoTexture::CreateTextures(Context, Frame->codec, format, sizes,
m_gltwo ? GL_TEXTURE_EXTERNAL_OES : QOpenGLTexture::Target2D);
QOpenGLTexture::Target2D);
for (uint i = 0; i < result.size(); ++i)
result[i]->m_allowGLSLDeint = true;

Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/opengl/mythegldmabuf.h
Expand Up @@ -30,7 +30,6 @@ class MythEGLDMABUF
MythRenderOpenGL *Context,
VideoFrame *Frame);
bool m_useModifiers { false };
bool m_gltwo { true };
};

#endif // MYTHEGLDMABUF_H
4 changes: 2 additions & 2 deletions mythtv/libs/libmythui/opengl/mythrenderopengl.cpp
Expand Up @@ -361,9 +361,9 @@ bool MythRenderOpenGL::Init(void)
// For now this just includes Broadcom VideoCoreIV.
// Other Tile Based Deferred Rendering GPUS - PowerVR5/6/7, Apple (PowerVR as well?)
// Other Tile Based Immediate Mode Rendering GPUS - ARM Mali, Qualcomm Adreno
static const QByteArray tiled[2] = { "videocore", "vc4" };
static const QByteArray tiled[3] = { "videocore", "vc4", "v3d" };
auto renderer = QByteArray(reinterpret_cast<const char*>(glGetString(GL_RENDERER))).toLower();
for (int i = 0 ; i < 2; ++i)
for (int i = 0 ; i < 3; ++i)
{
if (renderer.contains(tiled[i]))
{
Expand Down

0 comments on commit 05b91bd

Please sign in to comment.