Skip to content
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

Allow EGL 1.5 implementations without GL_KHR_robustness #480

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 78 additions & 1 deletion modules/egl/teglRobustnessTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ RenderingContext::~RenderingContext(void)
void RenderingContext::createContext(const EGLConfig &sharedContext)
{
m_context = m_egl.createContext(m_display, m_config, sharedContext, m_attribList);
EGLU_CHECK_MSG(m_egl, "eglCreateContext()");
}

void RenderingContext::destroyContext(void)
Expand Down Expand Up @@ -1147,6 +1146,7 @@ class QueryRobustAccessCase : public RobustnessTestCase
TestCase::IterateResult iterate(void)
{
TestLog &log = m_testCtx.getLog();
const Library &egl = m_eglTestCtx.getLibrary();

log << tcu::TestLog::Message
<< "Check that after successfully creating a robust context the robust access query returned by "
Expand All @@ -1164,6 +1164,21 @@ class QueryRobustAccessCase : public RobustnessTestCase
checkRequiredEGLExtensions(attribList);

RenderingContext context(m_eglTestCtx, attribList, m_eglConfig, m_eglDisplay, EGL_NO_CONTEXT);

const EGLenum error = egl.getError();
if (error != EGL_SUCCESS)
{
if (error == EGL_BAD_CONFIG)
{
m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED,
"Got EGL_BAD_CONFIG, assuming GL_KHR_robustness is not supported");
} else
{
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
}
return STOP;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If preferred I can move this into a function in order to avoid duplication.


context.makeCurrent(m_eglSurface);

glw::Functions gl;
Expand Down Expand Up @@ -1202,6 +1217,7 @@ class NoResetNotificationCase : public RobustnessTestCase
TestCase::IterateResult iterate(void)
{
TestLog &log = m_testCtx.getLog();
const Library &egl = m_eglTestCtx.getLibrary();

log << tcu::TestLog::Message
<< "Check the reset notification strategy returned by glGetIntegerv() equals GL_NO_RESET_NOTIFICATION\n\n"
Expand All @@ -1220,6 +1236,21 @@ class NoResetNotificationCase : public RobustnessTestCase
checkRequiredEGLExtensions(attribList);

RenderingContext context(m_eglTestCtx, attribList, m_eglConfig, m_eglDisplay, EGL_NO_CONTEXT);

const EGLenum error = egl.getError();
if (error != EGL_SUCCESS)
{
if (error == EGL_BAD_CONFIG)
{
m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED,
"Got EGL_BAD_CONFIG, assuming GL_KHR_robustness is not supported");
} else
{
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
}
return STOP;
}

context.makeCurrent(m_eglSurface);

glw::Functions gl;
Expand Down Expand Up @@ -1265,6 +1296,7 @@ class LoseContextOnResetCase : public RobustnessTestCase
TestCase::IterateResult iterate(void)
{
TestLog &log = m_testCtx.getLog();
const Library &egl = m_eglTestCtx.getLibrary();

log << tcu::TestLog::Message
<< "Check the reset notification strategy returned by glGetIntegerv() equals GL_LOSE_CONTEXT_ON_RESET\n\n"
Expand All @@ -1283,6 +1315,21 @@ class LoseContextOnResetCase : public RobustnessTestCase
checkRequiredEGLExtensions(attribList);

RenderingContext context(m_eglTestCtx, attribList, m_eglConfig, m_eglDisplay, EGL_NO_CONTEXT);

const EGLenum error = egl.getError();
if (error != EGL_SUCCESS)
{
if (error == EGL_BAD_CONFIG)
{
m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED,
"Got EGL_BAD_CONFIG, assuming GL_KHR_robustness is not supported");
} else
{
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
}
return STOP;
}

context.makeCurrent(m_eglSurface);

glw::Functions gl;
Expand Down Expand Up @@ -1360,6 +1407,7 @@ ContextResetCase::ContextResetCase(EglTestContext &eglTestCtx, const char *name,
TestCase::IterateResult ContextResetCase::iterate(void)
{
glw::Functions gl;
const Library &egl = m_eglTestCtx.getLibrary();

const EGLint attribList[] = {EGL_CONTEXT_CLIENT_VERSION,
3,
Expand All @@ -1374,6 +1422,21 @@ TestCase::IterateResult ContextResetCase::iterate(void)
checkRequiredEGLExtensions(attribList);

RenderingContext context(m_eglTestCtx, attribList, m_eglConfig, m_eglDisplay, EGL_NO_CONTEXT);

const EGLenum error = egl.getError();
if (error != EGL_SUCCESS)
{
if (error == EGL_BAD_CONFIG)
{
m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED,
"Got EGL_BAD_CONFIG, assuming GL_KHR_robustness is not supported");
} else
{
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
}
return STOP;
}

context.makeCurrent(m_eglSurface);

{
Expand Down Expand Up @@ -1524,6 +1587,20 @@ class InvalidShareContextCase : public RobustnessTestCase
log << tcu::TestLog::Message << "Create context A (share_context = EGL_NO_CONTEXT)" << tcu::TestLog::EndMessage;
RenderingContext contextA(m_eglTestCtx, attribListA, m_eglConfig, m_eglDisplay, EGL_NO_CONTEXT);

const EGLenum error0 = egl.getError();
if (error0 != EGL_SUCCESS)
{
if (error0 == EGL_BAD_CONFIG)
{
m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED,
"Got EGL_BAD_CONFIG, assuming GL_KHR_robustness is not supported");
} else
{
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
}
return STOP;
}

log << tcu::TestLog::Message << "Create context B (share_context = context A)" << tcu::TestLog::EndMessage;
logAttribList(m_eglTestCtx, attribListB);

Expand Down