GLES1: caps: GLES1-specific context limits
There are some GLES1-specific caps such as the number of multitexturing
units and the matrix stack depths. This is important for validation.
This uses Table 6.20 and 6.22 from the GLES 1.1 spec.
Specify them in Caps.h and minimums in .cpp. Since we will be emulating
GLES1, there is no plan to collect the caps from the native
implementation; just initialize reasonable values in Context.cpp.
In fact, we will go with the values above minimum:
- 4 multitexturing units (vs. 2 minimum)
- 6 clip plans (vs. 1 minimum)
- 16 stack depth for projection matrices (vs. 2 minimum)
- 16 stack depth for texture matrices (vs. 2 minimum)
+ clang-format Caps.cpp / h
BUG=angleproject:2306
Change-Id: Ib28c317426be598a2adad7bd01920c03f27dc74a
Reviewed-on: https://chromium-review.googlesource.com/925549
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 1f8c147..7a10467 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -164,8 +164,8 @@
GLenum GetResetStrategy(const egl::AttributeMap &attribs)
{
- EGLAttrib attrib = attribs.get(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT,
- EGL_NO_RESET_NOTIFICATION);
+ EGLAttrib attrib =
+ attribs.get(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT, EGL_NO_RESET_NOTIFICATION);
switch (attrib)
{
case EGL_NO_RESET_NOTIFICATION:
@@ -2664,6 +2664,17 @@
{
mCaps = mImplementation->getNativeCaps();
+ // GLES1 emulation: Initialize caps (Table 6.20 / 6.22 in the ES 1.1 spec)
+ if (getClientVersion() < Version(2, 0))
+ {
+ mCaps.maxMultitextureUnits = 4;
+ mCaps.maxClipPlanes = 6;
+ mCaps.maxLights = 8;
+ mCaps.maxModelviewMatrixStackDepth = 16;
+ mCaps.maxProjectionMatrixStackDepth = 16;
+ mCaps.maxTextureMatrixStackDepth = 16;
+ }
+
mExtensions = mImplementation->getNativeExtensions();
mLimitations = mImplementation->getNativeLimitations();