}
}
+static void finish (EGLint api, const ApiFunctions& func)
+{
+ switch (api)
+ {
+ case EGL_OPENGL_ES_BIT: gles1::finish(); break;
+ case EGL_OPENGL_ES2_BIT: gles2::finish(func.gl); break;
+ case EGL_OPENGL_ES3_BIT_KHR: gles2::finish(func.gl); break;
+ case EGL_OPENVG_BIT: vg::finish(); break;
+ default:
+ DE_ASSERT(DE_FALSE);
+ }
+}
+
static void readPixels (EGLint api, const ApiFunctions& func, tcu::Surface& dst)
{
switch (api)
EGLU_CHECK_MSG(egl, "eglMakeCurrent");
renderClear(api, funcs, clear);
+ finish(api, funcs);
clears.push_back(clear);
}
renderClear(api, funcs, clear);
clears.push_back(clear);
}
+
+ finish(api, funcs);
}
}
for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(packetIter->clears); ndx++)
renderClear(m_api, m_funcs, packetIter->clears[ndx]);
+ finish(m_api, m_funcs);
// Release context.
m_egl.makeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, dst.getAccess().getDataPtr());
}
+void finish (void)
+{
+ glFinish();
+}
+
#else // DEQP_SUPPORT_GLES1
void clear (int x, int y, int width, int height, const tcu::Vec4& color)
TCU_THROW(NotSupportedError, "OpenGL ES 1.x is not supported");
}
+void finish (void)
+{
+ TCU_THROW(NotSupportedError, "OpenGL ES 1.x is not supported");
+}
+
#endif // DEQP_SUPPORT_GLES1
} // gles1
void clear (int x, int y, int width, int height, const tcu::Vec4& color);
void readPixels (tcu::Surface& dst, int x, int y, int width, int height);
+void finish (void);
} // gles1
} // egl
gl.readPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, dst.getAccess().getDataPtr());
}
+void finish (const glw::Functions& gl)
+{
+ gl.finish();
+}
+
} // gles2
} // egl
} // deqp
void clear (const glw::Functions& gl, int x, int y, int width, int height, const tcu::Vec4& color);
void readPixels (const glw::Functions& gl, tcu::Surface& dst, int x, int y, int width, int height);
+void finish (const glw::Functions& gl);
} // gles2
} // egl
}
}
+static void finish (const glw::Functions& gl, EGLint api)
+{
+ switch (api)
+ {
+ case EGL_OPENGL_ES2_BIT:
+ case EGL_OPENGL_ES3_BIT_KHR:
+ gl.finish();
+ break;
+
+ default:
+ throw tcu::NotSupportedError("Unsupported API");
+ }
+}
+
tcu::PixelFormat getPixelFormat (const Library& egl, EGLDisplay display, EGLConfig config)
{
tcu::PixelFormat fmt;
EGLU_CHECK_CALL(egl, makeCurrent(display, surface, surface, context));
clear(m_gl, api, CLEAR_COLOR, CLEAR_DEPTH, CLEAR_STENCIL);
+ finish(m_gl, api);
}
// Render.
const DrawPrimitiveOp& drawOp = drawOps[iterNdx*numContexts*drawsPerCtx + ctxNdx*drawsPerCtx + drawNdx];
draw(m_gl, api, *programs[ctxNdx], drawOp);
}
+
+ finish(m_gl, api);
}
}
for (int ndx = 0; ndx < packetIter->numOps; ndx++)
draw(m_gl, m_api, m_program, packetIter->drawOps[ndx]);
+ finish(m_gl, m_api);
+
// Release context.
EGLU_CHECK_CALL(m_egl, makeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT));
EGLU_CHECK_CALL(egl, makeCurrent(display, surface, surface, context));
clear(m_gl, api, CLEAR_COLOR, CLEAR_DEPTH, CLEAR_STENCIL);
+ finish(m_gl, api);
// Release context
EGLU_CHECK_CALL(egl, makeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT));
vgReadPixels(dst.getAccess().getDataPtr(), width*4, VG_sRGBA_8888, 0, 0, width, height);
}
+void finish (void)
+{
+ vgFinish();
+}
+
#else // DEQP_SUPPORT_VG
void clear (int x, int y, int width, int height, const tcu::Vec4& color)
TCU_THROW(NotSupportedError, "OpenVG is not supported");
}
+void finish (void)
+{
+ TCU_THROW(NotSupportedError, "OpenVG is not supported");
+}
+
#endif // DEQP_SUPPORT_VG
} // vg
void clear (int x, int y, int width, int height, const tcu::Vec4& color);
void readPixels (tcu::Surface& dst, int x, int y, int width, int height);
+void finish (void);
} // vg
} // egl