-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenGL(ES) debugging improvements #14772
Conversation
xbmc/utils/GLUtils.h
Outdated
|
||
#include "system_gl.h" | ||
|
||
void _VerifyGLState(const char* szfile, const char* szfunction, int lineno); | ||
#if defined(GL_DEBUGGING) && (defined(HAS_GL) || defined(HAS_GLES)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/guilib/Shader.cpp
Outdated
@@ -102,9 +109,27 @@ bool CShader::InsertSource(const std::string& filename, const std::string& loc) | |||
|
|||
m_source.insert(locPos, temp); | |||
|
|||
m_filename.append(" " + filename); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Have you looked into the GL(ES) debugging extensions? Or is that not helpful for your use case? |
@pkerling I'm not sure what you are referring to? I have just pushed a fixup that checks if there is a gl error before checking the settings level. This makes it so the settings check isn't getting hammered. |
set Instead of having to call |
1516472
to
d2e95ca
Compare
@FernetMenta @pkerling I've updated this to use the opengl callbacks I left in the updated code for I've only added the callback for OpenGLES as there are many defines that are different between OpenGL and OpenGLES. We'll also see how well the other OpenGLES platforms conform to the spec after jenkins is done building. |
pushed a commit to add egl debug callback also
|
xbmc/utils/EGLUtils.cpp
Outdated
@@ -71,7 +71,68 @@ std::array<std::pair<EGLint, const char*>, 32> eglAttributes = | |||
X(EGL_TRANSPARENT_GREEN_VALUE), | |||
X(EGL_TRANSPARENT_BLUE_VALUE) | |||
}; | |||
|
|||
std::array<std::pair<EGLenum, const char*>, 15> eglErrors = |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/utils/EGLUtils.cpp
Outdated
{ | ||
if (eglError.first == error) | ||
{ | ||
CLog::Log(LOGERROR, "{} ({})", what.c_str(), eglError.second); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More comments, sorry for not putting the first ones into a review comment
@@ -380,6 +380,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler | |||
False to show at the bottom of video (default) */ | |||
bool m_videoAssFixedWorks; | |||
|
|||
bool m_openGlDebugging; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good now - I think also doing it for GL would be great!
0a712c5
to
b1a20a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still found some nits to pick, but good to merge for me
Also do we want to print a warning if opengl debugging is enabled but the required exts are not supported? |
@pkerling updated @popcornmix as mentioned yesterday I was able to build kodi with these updated EGL headers patch for the raspberry pi firmware repo -> http://termbin.com/a23tf The headers cannot be the stock khronos headers as broadcom seems to have extra includes for the |
xbmc/guilib/Shader.cpp
Outdated
return true; | ||
} | ||
|
||
const std::string CShader::GetSourceWithLineNumbers() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/guilib/Shader.h
Outdated
@@ -32,11 +32,17 @@ namespace Shaders { | |||
virtual bool InsertSource(const std::string& filename, const std::string& loc); | |||
bool OK() const { return m_compiled; } | |||
|
|||
const std::string GetName() { return m_filenames; } |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/guilib/Shader.h
Outdated
@@ -32,11 +32,17 @@ namespace Shaders { | |||
virtual bool InsertSource(const std::string& filename, const std::string& loc); | |||
bool OK() const { return m_compiled; } | |||
|
|||
const std::string GetName() { return m_filenames; } | |||
const std::string GetSourceWithLineNumbers(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@Memphiz can you look to see what is happening with iOS? I don't have access to OSX to look into it. seems that there is no definition for some values |
xbmc/utils/GLUtils.cpp
Outdated
matrix[ixx*4], matrix[ixx*4+1], matrix[ixx*4+2], \ | ||
matrix[ixx*4+3]); \ | ||
} \ | ||
void KODI::UTILS::GL::GlErrorCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void *userParam) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
#ifdefs keep getting worse and worse :-( |
@pkerling yes sir. It won't be a problem when RPi specifics get removed 😜 |
7913598
to
a1c38f5
Compare
This has been an issue for a while because we manipulate the shader source by inserting and appending to it. This creates an issue where the error line thrown by the glsl compilation doesn't match what is in the source file. With this we can clearly see the line that is provided by the error.
Can I get a sign off from the relevant people? Thanks! 🚀 |
Can‘t see any review button (anymore?) - as iOS is not involved anymore I am fine with whatever came out of this. |
If you intend to remove the |
a1c38f5
to
c43b26f
Compare
@FernetMenta are you ok with this? |
+1 |
@MartijnKaijser ok to merge? |
OpenGL(ES) debugging improvements
This change allows us to actually use the
VerifyGLState()
calls that are littered throughout our render system.Using these changes we can get valuable information about debugging our OpenGL(ES) systems.
This also add a new OpenGL(ES) logging component to enable this logging.
So now you will see errors like so
More and/or different GL debugging can also be added later.
The only thing I'm not sure about here is if we should hard fail like I have it set after 5 OpenGL(ES) errors. Otherwise the errors will run up the log (if you have OpenGL(ES) component logging enabled) and kodi will continue to function.
The last commit adds the shader source to log if it failed to compile. This has been an issue for a while because we manipulate the shader source by inserting and appending to it. This creates an issue where the error line thrown by the glsl compilation doesn't match what is in the source file. With this we can clearly see the line that is provided by the error.
This now shows up like so:
So you can clearly see the error is at line
32
(among other problems)