Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Remove incomplete IsExtSupported from CWinSystemEGL #1949

wants to merge 1 commit into from

4 participants


In the log on Pi, we get:
18:17:44 T:3040780928 NOTICE: GL: Reverting to POT textures

which is strange because we support nPOT.

This means (in xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp):

  // determine whether GPU supports NPOT textures
  if (!g_Windowing.IsExtSupported("GL_TEXTURE_NPOT"))

is returning false.


bool CRenderSystemGLES::IsExtSupported(const char* extension)
  else if (strcmp( extension, "GL_TEXTURE_NPOT" ) == 0)
    // GLES supports non-power-of-two textures as standard.
        return true;

it should be returning true!

Trouble is, that xbmc/windowing/egl/WinSystemEGL.cpp overrides this
function with one that doesn't return true. I think this function
should be removed.

(Note: GL_TEXTURE_NPOT is not the correct extension name for GLES - it would need to be GL_OES_texture_npot if this is meant to query the GLES driver)


I don't know this code well, but shouldn't eglQueryString() be returning the extensions? What extensions does it return - perhaps it's just a matter of the incorrect extension?


The extensions and the query are correct, problem is that we're asking the wrong place :)

We'll have 2 lists of extensions, windowing (egl) and rendering (gles). I believe the issue is that we're calling into windowing and we never actually get to the render extensions. Could you please try this as a quick test?

diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp
index a71e105..1698e26 100644
--- a/xbmc/windowing/egl/WinSystemEGL.cpp
+++ b/xbmc/windowing/egl/WinSystemEGL.cpp
@@ -372,7 +372,7 @@ bool CWinSystemEGL::IsExtSupported(const char* extension)
   name += extension;
   name += " ";

-  return m_extensions.find(name) != std::string::npos;
+  return (m_extensions.find(name) != std::string::npos || CRenderSystemGLES::IsExtSupported(extension));

 bool CWinSystemEGL::PresentRenderImpl(const CDirtyRegionList &dirty)

Your fix works for me:
NOTICE: GL: NPOT texture support detected


Ok. It's a bit circuitous to go renderer->windowing->renderer, but I think that's probably safest for frodo, because there are several places that query windowing directly (where they shouldn't).

So rather than fixing up each and risking missing one, I'll push this change instead and we'll clean it up when the rendering/windowing split happens.

Thanks for bringing this up!

@popcornmix popcornmix closed this

I was assuming that this behavior changed with the egl rewrite, but looking at the git logs, it seems as though this (forced npot) is how it as been all along.

For that reason, I'm hesitant to "fix" this just before release, since it's essentially enabling an un-tested code-path.

Ping @davilla and @gimli. Thoughts? Don't confuse this with the NPOT texture stuff, this will only affect video rendering and fbo's. In fact, fbo's will be disabled for gles as it is.

@popcornmix Do you recall whether this once worked as intended? Or have we been forcing npot since the early days of rpi?


rc2 on 19th. release pushed back so there's some time to verify.


ok. @popcornmix Could you please confirm that video playback works and looks normal with this fixed? This really only affects omxplayer afaik, since all other egl+gles players that i know of use the bypass render method.


aml, with dvdplayer/amcodec, I've seen that message "NOTICE: GL: Reverting to POT textures"


right, but it doesn't matter because we don't actually render. omxplayer renders frames itself.


Video playback is okay with this fix on Pi.
We also use the bypass render method (the frames are displayed from OpenMAX on a different layer to the GL).

@popcornmix popcornmix deleted the popcornmix:is_ext_supported branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 17, 2012
  1. @popcornmix
This page is out of date. Refresh to see the latest.
11 xbmc/windowing/egl/WinSystemEGL.cpp
@@ -122,7 +122,6 @@ bool CWinSystemEGL::InitWindowSystem()
- m_extensions = m_egl->GetExtensions(m_display);
return CWinSystemBase::InitWindowSystem();
@@ -364,16 +363,6 @@ void CWinSystemEGL::UpdateResolutions()
-bool CWinSystemEGL::IsExtSupported(const char* extension)
- std::string name;
- name = " ";
- name += extension;
- name += " ";
- return m_extensions.find(name) != std::string::npos;
bool CWinSystemEGL::PresentRenderImpl(const CDirtyRegionList &dirty)
2  xbmc/windowing/egl/WinSystemEGL.h
@@ -43,7 +43,6 @@ class CWinSystemEGL : public CWinSystemBase, public CRenderSystemGLES
virtual bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop);
virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays);
virtual void UpdateResolutions();
- virtual bool IsExtSupported(const char* extension);
virtual void ShowOSMouse(bool show);
virtual bool HasCursor();
@@ -76,7 +75,6 @@ class CWinSystemEGL : public CWinSystemBase, public CRenderSystemGLES
CEGLWrapper *m_egl;
bool m_iVSyncMode;
- std::string m_extensions;
Something went wrong with that request. Please try again.