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
Removed GLES version check for glBufferStorage, allowing for any device that supports it. #2381
Conversation
…ce that supports it.
I believe that check is there because So the proper thing to do would be to keep the GLES3.2 check, but add an OR for |
the pi4 supports bufferStorage directly as far as i can tell: https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/docs/features.txt#L397 doesn't |
We are talking about 2 different extensions, I'm saying a device could support glBufferStorage, but not support glDrawRangeElementsBaseVertex, in which case we can't use glBufferStorage |
ah I see, so i guess we could add it to
and then change the check to
? |
The problem is that currently it's immediately assumed that if "bufferStorage" is available, then the GL/GLES version is X or higher. But such logic is totally wrong for Mesa drivers in general. #2048 If said behavior is not changed, this change will create more serious issues than those that are supposed to be fixed. |
Yes I guess the presumption of the availability of GL_ARB_draw_elements_base_vertex is an example of this. However isn't what GLInfo.cpp is supposed to address, by checking for the presence of individual extensions for certain things? Perhaps it should do that for ALL extensions, ratehr than relying on version numbers, but that's a large change! bufferStorage doesn't seem to be used much in the code so I am hoping that it's not such a huge change for just this one. If I add the check for drawElementsBaseVertex is it not enough? |
@loganmc10 , @Jj0YzL5nvJ please review that fix and if it is wrong, please suggest how it can be corrected. |
I think if he does what @loganmc10 says, it should be ok. |
869746e
to
27adf84
Compare
I have put the additional check in and everything seems to work for me, but only have RPI4 to check with. |
Given that the minimum OpenGL version for the plugin is 3.3, you don't really need:
It could just be: |
27adf84
to
4f0f506
Compare
Looks good to me now! |
The specific case I referenced only affected ATI/AMD Mesa drivers limited to OpenGL 3.3. Testing on such hardware is no longer possible ...at least from my side. |
@@ -67,7 +67,7 @@ void ContextImpl::init() | |||
} | |||
|
|||
{ | |||
if ((m_glInfo.isGLESX && (m_glInfo.bufferStorage && m_glInfo.majorVersion * 10 + m_glInfo.minorVersion >= 32)) || !m_glInfo.isGLESX) | |||
if ((m_glInfo.isGLESX && (m_glInfo.bufferStorage && m_glInfo.drawElementsBaseVertex)) || !m_glInfo.isGLESX) |
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.
The condition looks crazy now. Should not it be
if (!m_glInfo.isGLESX || (m_glInfo.bufferStorage && m_glInfo.drawElementsBaseVertex))
?
I corrected the condition and merged this PR: cb76d2f |
Well, it's never a free lunch. This broke power VR devices that say they support the extension. |
Tested on RPI4 - please see profile comparison of Goldeneye 64:
https://docs.google.com/spreadsheets/d/1kQ15ra9rFnzVx6Plukck8cEPczf446eRlf1rCKm21FI/edit?usp=sharing
When glBufferStorage is permitted calls to
glDrawArraysUnbuffered
andglDrawElementsUnbuffered
(highlighted in yellow in first 'before' tab) become calls toglDrawArrays
,glDrawRangeElementsBaseVertex
andglBufferStorage
(highlighted in yellow in the second 'after' tab). The total duration of said calls within each profiling interval (ends highlighted in red) are reduced in the 'after' scenario:1.009887 (before) vs 0.7056322 (after)
0.739989 vs 0.565734
Please verify that I am comparing the right calls! This is based on conversations starting here: #2329 (comment) - tagging @fzurita, @loganmc10
I have only checked the intro of Goldeneye as it's a game where there's visible slowdown for the pi4. Please let me know if you want me to profile anything else. There was some concern that bufferStorage could cause slowdown, but I searched through the history and that line was introduced here: a625225, and there's some related comments, but nothing that specifically indicates this will cause slowdown in devices that support it.
Thanks :)