Update dEQP.

Migrate drawElements Quality Program changes from an internal repository.

Bug: 17388917

Change-Id: I21e3f7bc75813f0510025d697d91a2554dc995d4
diff --git a/modules/gles31/functional/es31fProgramInterfaceQueryTestCase.cpp b/modules/gles31/functional/es31fProgramInterfaceQueryTestCase.cpp
index 382328e..e9acce4 100644
--- a/modules/gles31/functional/es31fProgramInterfaceQueryTestCase.cpp
+++ b/modules/gles31/functional/es31fProgramInterfaceQueryTestCase.cpp
@@ -350,25 +350,48 @@
 
 	DE_UNREF(resource);
 
+	m_testCtx.getLog() << tcu::TestLog::Message << "Verifying type, expecting " << glu::getDataTypeName(variable->getBasicType()) << tcu::TestLog::EndMessage;
+
 	if (variable->getBasicType() != glu::getDataTypeFromGLType(propValue))
 	{
-		m_testCtx.getLog() << tcu::TestLog::Message << "\tError, got " << glu::getDataTypeFromGLType(propValue) << tcu::TestLog::EndMessage;
+		m_testCtx.getLog() << tcu::TestLog::Message << "\tError, got " << glu::getDataTypeName(glu::getDataTypeFromGLType(propValue)) << tcu::TestLog::EndMessage;
 		setError("resource type invalid");
 	}
 }
 
 void TypeValidator::validateBuiltinVariable (const std::string& resource, glw::GLint propValue) const
 {
-	if (resource == "gl_Position")
+	static const struct
 	{
-		if (glu::getDataTypeFromGLType(propValue) != glu::TYPE_FLOAT_VEC4)
+		const char*		name;
+		glu::DataType	type;
+	} builtins[] =
+	{
+		{ "gl_Position",			glu::TYPE_FLOAT_VEC4	},
+		{ "gl_FragCoord",			glu::TYPE_FLOAT_VEC4	},
+		{ "gl_in[0].gl_Position",	glu::TYPE_FLOAT_VEC4	},
+		{ "gl_VertexID",			glu::TYPE_INT			},
+		{ "gl_InvocationID",		glu::TYPE_INT			},
+		{ "gl_NumWorkGroups",		glu::TYPE_UINT_VEC3		},
+		{ "gl_FragDepth",			glu::TYPE_FLOAT			},
+	};
+
+	for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(builtins); ++ndx)
+	{
+		if (resource == builtins[ndx].name)
 		{
-			m_testCtx.getLog() << tcu::TestLog::Message << "\tError, got " << glu::getDataTypeFromGLType(propValue) << tcu::TestLog::EndMessage;
-			setError("resource type invalid");
+			m_testCtx.getLog() << tcu::TestLog::Message << "Verifying type, expecting " << glu::getDataTypeName(builtins[ndx].type) << tcu::TestLog::EndMessage;
+
+			if (glu::getDataTypeFromGLType(propValue) != builtins[ndx].type)
+			{
+				m_testCtx.getLog() << tcu::TestLog::Message << "\tError, got " << glu::getDataTypeName(glu::getDataTypeFromGLType(propValue)) << tcu::TestLog::EndMessage;
+				setError("resource type invalid");
+			}
+			return;
 		}
 	}
-	else
-		DE_ASSERT(false);
+
+	DE_ASSERT(false);
 }
 
 class ArraySizeValidator : public SingleVariableValidator
@@ -376,6 +399,7 @@
 public:
 				ArraySizeValidator				(Context& context, glw::GLuint programID, const VariableSearchFilter& filter);
 	void		validateSingleVariable			(const std::vector<VariablePathComponent>& path, const std::string& resource, glw::GLint propValue) const;
+	void		validateBuiltinVariable			(const std::string& resource, glw::GLint propValue) const;
 };
 
 ArraySizeValidator::ArraySizeValidator (Context& context, glw::GLuint programID, const VariableSearchFilter& filter)
@@ -403,6 +427,29 @@
 	}
 }
 
+void ArraySizeValidator::validateBuiltinVariable (const std::string& resource, glw::GLint propValue) const
+{
+	// support all built-ins that getProgramInterfaceResourceList supports
+	if (resource == "gl_Position"			||
+		resource == "gl_VertexID"			||
+		resource == "gl_FragCoord"			||
+		resource == "gl_in[0].gl_Position"	||
+		resource == "gl_InvocationID"		||
+		resource == "gl_NumWorkGroups"		||
+		resource == "gl_FragDepth")
+	{
+		m_testCtx.getLog() << tcu::TestLog::Message << "Verifying array size, expecting 1" << tcu::TestLog::EndMessage;
+
+		if (propValue != 1)
+		{
+			m_testCtx.getLog() << tcu::TestLog::Message << "\tError, got " << propValue << tcu::TestLog::EndMessage;
+			setError("resource array size invalid");
+		}
+	}
+	else
+		DE_ASSERT(false);
+}
+
 class ArrayStrideValidator : public SingleVariableValidator
 {
 public:
@@ -672,6 +719,7 @@
 public:
 				LocationValidator		(Context& context, glw::GLuint programID, const VariableSearchFilter& filter);
 	void		validateSingleVariable	(const std::vector<VariablePathComponent>& path, const std::string& resource, glw::GLint propValue) const;
+	void		validateBuiltinVariable	(const std::string& resource, glw::GLint propValue) const;
 };
 
 LocationValidator::LocationValidator (Context& context, glw::GLuint programID, const VariableSearchFilter& filter)
@@ -905,6 +953,21 @@
 	}
 }
 
+void LocationValidator::validateBuiltinVariable (const std::string& resource, glw::GLint propValue) const
+{
+	DE_UNREF(resource);
+
+	// built-ins have no location
+
+	m_testCtx.getLog() << tcu::TestLog::Message << "Verifying location, expecting -1" << tcu::TestLog::EndMessage;
+
+	if (propValue != -1)
+	{
+		m_testCtx.getLog() << tcu::TestLog::Message << "\tError, got " << propValue << tcu::TestLog::EndMessage;
+		setError("resource location invalid");
+	}
+}
+
 class VariableNameLengthValidator : public SingleVariableValidator
 {
 public: