OSDN Git Service

[deqp] Fix state_query.string
authorLingfeng Yang <lfy@google.com>
Fri, 17 Feb 2017 17:56:26 +0000 (09:56 -0800)
committerLingfeng Yang <lfy@google.com>
Fri, 17 Feb 2017 17:56:26 +0000 (09:56 -0800)
bug: 34245902

Version string needs to match the glGetIntegerv(GL_MINOR_VERSION, ...).

Change-Id: I8b51104b0347c12c93c350dda7fb03c145f8c3e2

system/GLESv2_enc/GL2Encoder.cpp
system/GLESv2_enc/GL2Encoder.h
system/egl/egl.cpp
system/egl/eglContext.h

index daa972f..66b9e19 100755 (executable)
@@ -528,10 +528,10 @@ void GL2Encoder::s_glGetIntegerv(void *self, GLenum param, GLint *ptr)
 
     switch (param) {
     case GL_MAJOR_VERSION:
-        *ptr = ctx->m_currMajorVersion;
+        *ptr = ctx->m_deviceMajorVersion;
         break;
     case GL_MINOR_VERSION:
-        *ptr = ctx->m_currMinorVersion;
+        *ptr = ctx->m_deviceMinorVersion;
         break;
     case GL_NUM_SHADER_BINARY_FORMATS:
         *ptr = 0;
index 928547c..11162ee 100644 (file)
@@ -30,11 +30,17 @@ public:
     void setClientState(GLClientState *state) {
         m_state = state;
     }
-    void setClientStateMakeCurrent(GLClientState *state, int majorVersion, int minorVersion) {
+    void setClientStateMakeCurrent(GLClientState *state,
+                                   int majorVersion,
+                                   int minorVersion,
+                                   int deviceMajorVersion,
+                                   int deviceMinorVersion) {
         m_state = state;
         m_state->fromMakeCurrent();
         m_currMajorVersion = majorVersion;
         m_currMinorVersion = minorVersion;
+        m_deviceMajorVersion = deviceMajorVersion;
+        m_deviceMinorVersion = deviceMinorVersion;
     }
     void setSharedGroup(GLSharedGroupPtr shared) {
         m_shared = shared;
@@ -74,6 +80,8 @@ private:
 
     int m_currMajorVersion;
     int m_currMinorVersion;
+    int m_deviceMajorVersion;
+    int m_deviceMinorVersion;
     std::string m_currExtensions;
 
     bool    m_initialized;
index 275971c..8273cb5 100644 (file)
@@ -175,6 +175,27 @@ EGLContext_t::EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* share
     deletePending(0),
     goldfishSyncFd(-1)
 {
+
+    DEFINE_HOST_CONNECTION;
+    switch (rcEnc->getGLESMaxVersion()) {
+        case GLES_MAX_VERSION_3_0:
+            deviceMajorVersion = 3;
+            deviceMinorVersion = 0;
+            break;
+        case GLES_MAX_VERSION_3_1:
+            deviceMajorVersion = 3;
+            deviceMinorVersion = 1;
+            break;
+        case GLES_MAX_VERSION_3_2:
+            deviceMajorVersion = 3;
+            deviceMinorVersion = 2;
+            break;
+        default:
+            deviceMajorVersion = 2;
+            deviceMinorVersion = 0;
+            break;
+    }
+
     flags = 0;
     clientState = new GLClientState(majorVersion, minorVersion);
      if (shareCtx)
@@ -1543,7 +1564,9 @@ EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLC
             hostCon->gl2Encoder()->setClientStateMakeCurrent(
                     contextState,
                     context->majorVersion,
-                    context->minorVersion);
+                    context->minorVersion,
+                    context->deviceMajorVersion,
+                    context->deviceMinorVersion);
             hostCon->gl2Encoder()->setSharedGroup(context->getSharedGroup());
         }
         else {
index 0984591..0674833 100644 (file)
@@ -38,6 +38,8 @@ struct EGLContext_t {
     const char*         versionString;
     EGLint              majorVersion;
     EGLint              minorVersion;
+    EGLint              deviceMajorVersion;
+    EGLint              deviceMinorVersion;
     const char*         vendorString;
     const char*         rendererString;
     const char*         shaderVersionString;