Update ANGLE's changes.diff
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Dec 2017 19:45:55 +0000 (19:45 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Dec 2017 19:45:55 +0000 (19:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180491

Reviewed by Antoine Quint.

Here is the list of things we've changed from the
ANGLE commit that we merged in.

* changes.diff:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225585 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/ThirdParty/ANGLE/ChangeLog
Source/ThirdParty/ANGLE/changes.diff

index 260a9b8..566721e 100644 (file)
@@ -1,5 +1,17 @@
 2017-12-06  Dean Jackson  <dino@apple.com>
 
+        Update ANGLE's changes.diff
+        https://bugs.webkit.org/show_bug.cgi?id=180491
+
+        Reviewed by Antoine Quint.
+
+        Here is the list of things we've changed from the
+        ANGLE commit that we merged in.
+
+        * changes.diff:
+
+2017-12-06  Dean Jackson  <dino@apple.com>
+
         Some iOS tests failing after ANGLE update
         https://bugs.webkit.org/show_bug.cgi?id=180487
         <rdar://problem/35885969>
index b7ae06d..a5820d7 100644 (file)
@@ -1,124 +1,8 @@
-diff --git a/include/EGL/egl.h b/include/EGL/egl.h
-index 9f9e021..8ada051 100644
---- a/include/EGL/egl.h
-+++ b/include/EGL/egl.h
-@@ -38,6 +38,12 @@ extern "C" {
- #include <EGL/eglplatform.h>
-+#if defined(_MSC_VER) && !defined(ANGLE_WEBKIT_WIN)
-+#define EGL_SOFT_LINKING 1
-+#else
-+#define EGL_SOFT_LINKING 0
-+#endif
-+
- /* Generated on date 20150623 */
- /* Generated C header for:
-@@ -118,6 +124,7 @@ typedef void (*__eglMustCastToProperFunctionPointerType)(void);
- #define EGL_VERSION                       0x3054
- #define EGL_WIDTH                         0x3057
- #define EGL_WINDOW_BIT                    0x0004
-+#if !EGL_SOFT_LINKING
- EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
- EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
- EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
-@@ -142,6 +149,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface
- EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy);
- EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void);
- EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
-+#endif
- #endif /* EGL_VERSION_1_0 */
- #ifndef EGL_VERSION_1_1
-@@ -160,10 +168,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
- #define EGL_TEXTURE_RGB                   0x305D
- #define EGL_TEXTURE_RGBA                  0x305E
- #define EGL_TEXTURE_TARGET                0x3081
-+#if !EGL_SOFT_LINKING
- EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
- EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
- EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
- EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval);
-+#endif
- #endif /* EGL_VERSION_1_1 */
- #ifndef EGL_VERSION_1_2
-@@ -199,11 +209,13 @@ typedef void *EGLClientBuffer;
- #define EGL_SWAP_BEHAVIOR                 0x3093
- #define EGL_UNKNOWN                       ((EGLint)-1)
- #define EGL_VERTICAL_RESOLUTION           0x3091
-+#if !EGL_SOFT_LINKING
- EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api);
- EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void);
- EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
- EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void);
- EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
-+#endif
- #endif /* EGL_VERSION_1_2 */
- #ifndef EGL_VERSION_1_3
-@@ -232,7 +244,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
- #define EGL_OPENGL_API                    0x30A2
- #define EGL_OPENGL_BIT                    0x0008
- #define EGL_SWAP_BEHAVIOR_PRESERVED_BIT   0x0400
-+#if !EGL_SOFT_LINKING
- EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
-+#endif
- #endif /* EGL_VERSION_1_4 */
- #ifndef EGL_VERSION_1_5
-@@ -284,6 +298,7 @@ typedef void *EGLImage;
- #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
- #define EGL_IMAGE_PRESERVED               0x30D2
- #define EGL_NO_IMAGE                      ((EGLImage)0)
-+#if !EGL_SOFT_LINKING
- EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
- EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync);
- EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
-@@ -294,8 +309,13 @@ EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *nat
- EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
- EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
- EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags);
-+#endif
- #endif /* EGL_VERSION_1_5 */
-+#if EGL_SOFT_LINKING
-+#include <EGL/eglsoftlinking.h>
-+#endif
-+
- #ifdef __cplusplus
- }
- #endif
-diff --git a/include/GLES2/gl2.h b/include/GLES2/gl2.h
-index 027e1f7..4d710c2 100644
---- a/include/GLES2/gl2.h
-+++ b/include/GLES2/gl2.h
-@@ -520,6 +520,11 @@ typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GL
- typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
- typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
- typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-+
-+#if defined(_MSC_VER) && !defined(ANGLE_WEBKIT_WIN)
-+#include <GLES2/gl2softlinking.h>
-+#else
-+
- #ifdef GL_GLEXT_PROTOTYPES
- GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
- GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
-@@ -664,6 +669,7 @@ GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
- GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
- GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
- #endif
-+#endif
- #endif /* GL_ES_VERSION_2_0 */
- #ifdef __cplusplus
 diff --git a/include/GLSLANG/ShaderLang.h b/include/GLSLANG/ShaderLang.h
-index 965f7ab..f7b0ef7 100644
+index 1468bb146..2875c02ab 100644
 --- a/include/GLSLANG/ShaderLang.h
 +++ b/include/GLSLANG/ShaderLang.h
-@@ -25,7 +25,7 @@
+@@ -8,7 +8,7 @@
  
  #include <stddef.h>
  
@@ -127,83 +11,145 @@ index 965f7ab..f7b0ef7 100644
  
  #include <array>
  #include <map>
-diff --git a/src/common/angleutils.cpp b/src/common/angleutils.cpp
-index 7099c21..4641928 100644
---- a/src/common/angleutils.cpp
-+++ b/src/common/angleutils.cpp
-@@ -36,7 +36,10 @@ size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char>
- std::string FormatString(const char *fmt, va_list vararg)
+diff --git a/include/GLSLANG/ShaderVars.h b/include/GLSLANG/ShaderVars.h
+index 709428aeb..acd9c358f 100644
+--- a/include/GLSLANG/ShaderVars.h
++++ b/include/GLSLANG/ShaderVars.h
+@@ -281,10 +281,17 @@ struct WorkGroupSize
  {
+     // Must have a trivial default constructor since it is used in YYSTYPE.
+     WorkGroupSize() = default;
++#if defined(__clang__)
 +#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static std::vector<char> buffer(512);
++#pragma clang diagnostic ignored "-Wmissing-braces"
++#endif
+     explicit constexpr WorkGroupSize(int initialSize)
+         : localSizeQualifiers{initialSize, initialSize, initialSize}
+     {
+     }
++#if defined(__clang__)
 +#pragma clang diagnostic pop
++#endif
  
-     size_t len = FormatStringIntoVector(fmt, vararg, buffer);
-     return std::string(&buffer[0], len);
-diff --git a/src/common/angleutils.h b/src/common/angleutils.h
-index f5ef7bd..4cb556c 100644
---- a/src/common/angleutils.h
-+++ b/src/common/angleutils.h
-@@ -116,7 +116,10 @@ inline bool IsMaskFlagSet(T mask, T flag)
+     void fill(int fillValue);
+     void setLocalSize(int localSizeX, int localSizeY, int localSizeZ);
+diff --git a/include/KHR/khrplatform.h b/include/KHR/khrplatform.h
+old mode 100755
+new mode 100644
+index 68fca4827..07b61b9bd
+--- a/include/KHR/khrplatform.h
++++ b/include/KHR/khrplatform.h
+@@ -282,4 +282,4 @@ typedef enum {
+     KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
+ } khronos_boolean_enum_t;
  
- inline const char* MakeStaticString(const std::string &str)
- {
+-#endif /* __khrplatform_h_ */
+\ No newline at end of file
++#endif /* __khrplatform_h_ */
+diff --git a/src/common/third_party/smhasher/src/PMurHash.cpp b/src/common/third_party/smhasher/src/PMurHash.cpp
+index 071bc3153..2d608e97d 100644
+--- a/src/common/third_party/smhasher/src/PMurHash.cpp
++++ b/src/common/third_party/smhasher/src/PMurHash.cpp
+@@ -74,6 +74,12 @@ on big endian machines, or a byte-by-byte read if the endianess is unknown.
+  * ROTL32(x,r)      Rotate x left by r bits
+  */
++#if !defined(__BYTE_ORDER) && defined(__GNUC__)
++  #define __BIG_ENDIAN __ORDER_BIG_ENDIAN__
++  #define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
++  #define __BYTE_ORDER __BYTE_ORDER__
++#endif
++
+ /* Convention is to define __BYTE_ORDER == to one of these values */
+ #if !defined(__BIG_ENDIAN)
+   #define __BIG_ENDIAN 4321
+@@ -84,7 +90,9 @@ on big endian machines, or a byte-by-byte read if the endianess is unknown.
+ /* I386 */
+ #if defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(i386)
+-  #define __BYTE_ORDER __LITTLE_ENDIAN
++  #if !defined(__BYTE_ORDER)
++    #define __BYTE_ORDER __LITTLE_ENDIAN
++  #endif
+   #define UNALIGNED_SAFE
+ #endif
+@@ -111,7 +119,14 @@ on big endian machines, or a byte-by-byte read if the endianess is unknown.
+ /* Now find best way we can to READ_UINT32 */
+ #if __BYTE_ORDER==__LITTLE_ENDIAN
+   /* CPU endian matches murmurhash algorithm, so read 32-bit word directly */
++#if defined(__clang__)
 +#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static std::set<std::string> strings;
++#pragma clang diagnostic ignored "-Wcast-align"
++#endif
+   #define READ_UINT32(ptr)   (*((uint32_t*)(ptr)))
++#if defined(__clang__)
 +#pragma clang diagnostic pop
-     std::set<std::string>::iterator it = strings.find(str);
-     if (it != strings.end())
-     {
-diff --git a/src/common/debug.cpp b/src/common/debug.cpp
-index 746da5e..47e1565 100644
---- a/src/common/debug.cpp
-+++ b/src/common/debug.cpp
-@@ -69,7 +69,10 @@ void output(bool traceInDebugOnly, MessageType messageType, DebugTraceOutputType
- {
-     if (DebugAnnotationsActive())
-     {
++#endif
+ #elif __BYTE_ORDER==__BIG_ENDIAN
+   /* TODO: Add additional cases below where a compiler provided bswap32 is available */
+   #if defined(__GNUC__) && (__GNUC__>4 || (__GNUC__==4 && __GNUC_MINOR__>=3))
+@@ -218,14 +233,28 @@ void PMurHash32_Process(uint32_t *ph1, uint32_t *pcarry, const void *key, int le
+   switch(n) { /* how many bytes in c */
+   case 0: /* c=[----]  w=[3210]  b=[3210]=w            c'=[----] */
+     for( ; ptr < end ; ptr+=4) {
++#if defined(__clang__)
 +#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-         static std::vector<char> buffer(512);
++#pragma clang diagnostic ignored "-Wcast-align"
++#endif
+       uint32_t k1 = READ_UINT32(ptr);
++#if defined(__clang__)
 +#pragma clang diagnostic pop
-         size_t len = FormatStringIntoVector(format, vararg, buffer);
-         std::wstring formattedWideMessage(buffer.begin(), buffer.begin() + len);
-diff --git a/src/common/mathutil.cpp b/src/common/mathutil.cpp
-index acbcbdf..ba6da52 100644
---- a/src/common/mathutil.cpp
-+++ b/src/common/mathutil.cpp
-@@ -31,9 +31,12 @@ static const int g_sharedexp_mantissabits = 9;
- // Emax is the maximum allowed biased exponent value (31)
- static const int g_sharedexp_maxexponent = 31;
++#endif
+       DOBLOCK(h1, k1);
+     }
+     break;
+   case 1: /* c=[0---]  w=[4321]  b=[3210]=c>>24|w<<8   c'=[4---] */
+     for( ; ptr < end ; ptr+=4) {
+       uint32_t k1 = c>>24;
++#if defined(__clang__)
 +#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wglobal-constructors"
- static const float g_sharedexp_max = ((pow(2.0f, g_sharedexp_mantissabits) - 1) /
-                                        pow(2.0f, g_sharedexp_mantissabits)) *
-                                      pow(2.0f, g_sharedexp_maxexponent - g_sharedexp_bias);
++#pragma clang diagnostic ignored "-Wcast-align"
++#endif
+       c = READ_UINT32(ptr);
++#if defined(__clang__)
 +#pragma clang diagnostic pop
- unsigned int convertRGBFloatsTo999E5(float red, float green, float blue)
- {
-diff --git a/src/common/version.h b/src/common/version.h
-index e7ffa7c..b653ae3 100644
---- a/src/common/version.h
-+++ b/src/common/version.h
-@@ -7,7 +7,7 @@
- #ifndef COMMON_VERSION_H_
- #define COMMON_VERSION_H_
--#include "id/commit.h"
-+#include "commit.h"
- #define ANGLE_MAJOR_VERSION 2
- #define ANGLE_MINOR_VERSION 1
++#endif
+       k1 |= c<<8;
+       DOBLOCK(h1, k1);
+     }
+@@ -233,7 +262,14 @@ void PMurHash32_Process(uint32_t *ph1, uint32_t *pcarry, const void *key, int le
+   case 2: /* c=[10--]  w=[5432]  b=[3210]=c>>16|w<<16  c'=[54--] */
+     for( ; ptr < end ; ptr+=4) {
+       uint32_t k1 = c>>16;
++#if defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wcast-align"
++#endif
+       c = READ_UINT32(ptr);
++#if defined(__clang__)
++#pragma clang diagnostic pop
++#endif
+       k1 |= c<<16;
+       DOBLOCK(h1, k1);
+     }
+@@ -241,7 +277,14 @@ void PMurHash32_Process(uint32_t *ph1, uint32_t *pcarry, const void *key, int le
+   case 3: /* c=[210-]  w=[6543]  b=[3210]=c>>8|w<<24   c'=[654-] */
+     for( ; ptr < end ; ptr+=4) {
+       uint32_t k1 = c>>8;
++#if defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wcast-align"
++#endif
+       c = READ_UINT32(ptr);
++#if defined(__clang__)
++#pragma clang diagnostic pop
++#endif
+       k1 |= c<<24;
+       DOBLOCK(h1, k1);
+     }
 diff --git a/src/compiler/preprocessor/ExpressionParser.cpp b/src/compiler/preprocessor/ExpressionParser.cpp
-index f737a2e..a8df235 100644
+index ede334619..c0f8b9c97 100644
 --- a/src/compiler/preprocessor/ExpressionParser.cpp
 +++ b/src/compiler/preprocessor/ExpressionParser.cpp
 @@ -1,5 +1,7 @@
@@ -215,155 +161,59 @@ index f737a2e..a8df235 100644
  
     Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
 diff --git a/src/compiler/preprocessor/Tokenizer.cpp b/src/compiler/preprocessor/Tokenizer.cpp
-index 40e910e..fee20c6 100644
+index d8a9b9a12..d7fad68f1 100644
 --- a/src/compiler/preprocessor/Tokenizer.cpp
 +++ b/src/compiler/preprocessor/Tokenizer.cpp
-@@ -969,7 +969,7 @@ static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
- static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+@@ -1148,7 +1148,7 @@ static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
+ static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
  #endif
  
 -#ifndef YY_NO_INPUT
-+#if 0
++#if 0 // #ifndef YY_NO_INPUT
  #ifdef __cplusplus
- static int yyinput (yyscan_t yyscanner );
-@@ -1858,7 +1858,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
+ static int yyinput ( yyscan_t yyscanner );
+ #else
+@@ -2049,7 +2049,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
  
  #endif
  
 -#ifndef YY_NO_INPUT
-+#if 0
++#if 0 // #ifndef YY_NO_INPUT
  #ifdef __cplusplus
      static int yyinput (yyscan_t yyscanner)
  #else
-@@ -1883,7 +1883,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
-               else
-                       { /* need more input */
--                      int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
-+                      auto offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
-                       ++yyg->yy_c_buf_p;
-                       switch ( yy_get_next_buffer( yyscanner ) )
-@@ -2014,7 +2014,7 @@ static void pp_load_buffer_state  (yyscan_t yyscanner)
-       if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in pp_create_buffer()" );
--      b->yy_buf_size = (yy_size_t)size;
-+      b->yy_buf_size = size;
-       /* yy_ch_buf has to be 2 characters longer than the size given because
-        * we need to put in 2 end-of-buffer characters.
-diff --git a/src/compiler/translator/Operator.cpp b/src/compiler/translator/Operator.cpp
-index 57878b9..0b693e2 100644
---- a/src/compiler/translator/Operator.cpp
-+++ b/src/compiler/translator/Operator.cpp
-@@ -224,4 +224,4 @@ bool IsAssignment(TOperator op)
-         default:
-             return false;
+diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
+index c97f91d78..d0a4f6aeb 100644
+--- a/src/compiler/translator/ParseContext.cpp
++++ b/src/compiler/translator/ParseContext.cpp
+@@ -3240,8 +3240,11 @@ TIntermFunctionPrototype *TParseContext::addFunctionPrototypeDeclaration(
      }
--}
-\ No newline at end of file
-+}
-diff --git a/src/compiler/translator/OutputHLSL.h b/src/compiler/translator/OutputHLSL.h
-index db78859..f296dd9 100644
---- a/src/compiler/translator/OutputHLSL.h
-+++ b/src/compiler/translator/OutputHLSL.h
-@@ -56,21 +56,21 @@ class OutputHLSL : public TIntermTraverser
-     void header(TInfoSinkBase &out, const BuiltInFunctionEmulator *builtInFunctionEmulator);
-     // Visit AST nodes and output their code to the body stream
--    void visitSymbol(TIntermSymbol*);
--    void visitRaw(TIntermRaw*);
--    void visitConstantUnion(TIntermConstantUnion*);
-+    void visitSymbol(TIntermSymbol*) override;
-+    void visitRaw(TIntermRaw*) override;
-+    void visitConstantUnion(TIntermConstantUnion*) override;
-     bool visitSwizzle(Visit visit, TIntermSwizzle *node) override;
--    bool visitBinary(Visit visit, TIntermBinary*);
--    bool visitUnary(Visit visit, TIntermUnary*);
--    bool visitTernary(Visit visit, TIntermTernary *);
--    bool visitIfElse(Visit visit, TIntermIfElse *);
--    bool visitSwitch(Visit visit, TIntermSwitch *);
--    bool visitCase(Visit visit, TIntermCase *);
-+    bool visitBinary(Visit visit, TIntermBinary*) override;
-+    bool visitUnary(Visit visit, TIntermUnary*) override;
-+    bool visitTernary(Visit visit, TIntermTernary *) override;
-+    bool visitIfElse(Visit visit, TIntermIfElse *) override;
-+    bool visitSwitch(Visit visit, TIntermSwitch *) override;
-+    bool visitCase(Visit visit, TIntermCase *) override;
-     bool visitFunctionDefinition(Visit visit, TIntermFunctionDefinition *node) override;
--    bool visitAggregate(Visit visit, TIntermAggregate*);
--    bool visitBlock(Visit visit, TIntermBlock *node);
--    bool visitLoop(Visit visit, TIntermLoop*);
--    bool visitBranch(Visit visit, TIntermBranch*);
-+    bool visitAggregate(Visit visit, TIntermAggregate*) override;
-+    bool visitBlock(Visit visit, TIntermBlock *node) override;
-+    bool visitLoop(Visit visit, TIntermLoop*) override;
-+    bool visitBranch(Visit visit, TIntermBranch*) override;
-     bool isSingleStatement(TIntermNode *node);
-     bool handleExcessiveLoop(TInfoSinkBase &out, TIntermLoop *node);
-diff --git a/src/compiler/translator/RewriteTexelFetchOffset.cpp b/src/compiler/translator/RewriteTexelFetchOffset.cpp
-index 487c909..6d0c866 100644
---- a/src/compiler/translator/RewriteTexelFetchOffset.cpp
-+++ b/src/compiler/translator/RewriteTexelFetchOffset.cpp
-@@ -167,4 +167,4 @@ void RewriteTexelFetchOffset(TIntermNode *root,
-     Traverser::Apply(root, symbolTable, shaderVersion);
- }
--}  // namespace sh
-\ No newline at end of file
-+}  // namespace sh
-diff --git a/src/compiler/translator/RewriteTexelFetchOffset.h b/src/compiler/translator/RewriteTexelFetchOffset.h
-index 4218f0b..c6db664 100644
---- a/src/compiler/translator/RewriteTexelFetchOffset.h
-+++ b/src/compiler/translator/RewriteTexelFetchOffset.h
-@@ -27,4 +27,4 @@ void RewriteTexelFetchOffset(TIntermNode *root,
- }  // namespace sh
--#endif  // COMPILER_TRANSLATOR_REWRITE_TEXELFETCHOFFSET_H_
-\ No newline at end of file
-+#endif  // COMPILER_TRANSLATOR_REWRITE_TEXELFETCHOFFSET_H_
-diff --git a/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp b/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp
-index ef708cb..d205805 100644
---- a/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp
-+++ b/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp
-@@ -109,4 +109,4 @@ void RewriteUnaryMinusOperatorInt(TIntermNode *root)
-     Traverser::Apply(root);
- }
+     function->setHasPrototypeDeclaration();
  
--}  // namespace sh
-\ No newline at end of file
-+}  // namespace sh
-diff --git a/src/compiler/translator/RewriteUnaryMinusOperatorInt.h b/src/compiler/translator/RewriteUnaryMinusOperatorInt.h
-index 50f0c44..802ed57 100644
---- a/src/compiler/translator/RewriteUnaryMinusOperatorInt.h
-+++ b/src/compiler/translator/RewriteUnaryMinusOperatorInt.h
-@@ -17,4 +17,4 @@ void RewriteUnaryMinusOperatorInt(TIntermNode *root);
++    // WebKit note: We currently pass true instead of false for the last parameter
++    // here because some compilers have an issue with nameless parameters in function
++    // declarations.
+     TIntermFunctionPrototype *prototype =
+-        createPrototypeNodeFromFunction(*function, location, false);
++        createPrototypeNodeFromFunction(*function, location, true);
  
- }  // namespace sh
+     symbolTable.pop();
  
--#endif  // COMPILER_TRANSLATOR_REWRITEUNARYMINUSOPERATORINT_H_
-\ No newline at end of file
-+#endif  // COMPILER_TRANSLATOR_REWRITEUNARYMINUSOPERATORINT_H_
 diff --git a/src/compiler/translator/TranslatorHLSL.h b/src/compiler/translator/TranslatorHLSL.h
-index 213d860..d2add14 100644
+index d7005a603..e8436e98e 100644
 --- a/src/compiler/translator/TranslatorHLSL.h
 +++ b/src/compiler/translator/TranslatorHLSL.h
-@@ -13,7 +13,9 @@ class TranslatorHLSL : public TCompiler
+@@ -16,7 +16,7 @@ class TranslatorHLSL : public TCompiler
  {
    public:
      TranslatorHLSL(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output);
-+#ifdef ANGLE_ENABLE_HLSL
-     TranslatorHLSL *getAsTranslatorHLSL() override { return this; }
-+#endif // ANGLE_ENABLE_HLSL
+-    TranslatorHLSL *getAsTranslatorHLSL() override { return this; }
++    TranslatorHLSL *getAsTranslatorHLSL() { return this; }
  
-     bool hasInterfaceBlock(const std::string &interfaceBlockName) const;
-     unsigned int getInterfaceBlockRegister(const std::string &interfaceBlockName) const;
+     bool hasUniformBlock(const std::string &interfaceBlockName) const;
+     unsigned int getUniformBlockRegister(const std::string &interfaceBlockName) const;
 diff --git a/src/compiler/translator/glslang_tab.cpp b/src/compiler/translator/glslang_tab.cpp
-index d9b8ada..3e50fbc 100644
+index ce4aacf40..14cd5360c 100644
 --- a/src/compiler/translator/glslang_tab.cpp
 +++ b/src/compiler/translator/glslang_tab.cpp
 @@ -1,5 +1,7 @@
@@ -375,7 +225,7 @@ index d9b8ada..3e50fbc 100644
  
     Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
 diff --git a/src/compiler/translator/glslang_tab.h b/src/compiler/translator/glslang_tab.h
-index d0e691d..74a56da 100644
+index 1f5308551..cb43a46df 100644
 --- a/src/compiler/translator/glslang_tab.h
 +++ b/src/compiler/translator/glslang_tab.h
 @@ -1,5 +1,7 @@
@@ -386,216 +236,7833 @@ index d0e691d..74a56da 100644
  /* Bison interface for Yacc-like parsers in C
  
     Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
-diff --git a/src/libANGLE/Caps.cpp b/src/libANGLE/Caps.cpp
-index 47e1cf0..0f4d69d 100644
---- a/src/libANGLE/Caps.cpp
-+++ b/src/libANGLE/Caps.cpp
-@@ -77,7 +77,10 @@ void TextureCapsMap::clear()
+diff --git a/src/libANGLE/MemoryProgramCache.cpp b/src/libANGLE/MemoryProgramCache.cpp
+index 9eec12e3e..2a9c6836a 100644
+--- a/src/libANGLE/MemoryProgramCache.cpp
++++ b/src/libANGLE/MemoryProgramCache.cpp
+@@ -234,7 +234,10 @@ LinkResult MemoryProgramCache::Deserialize(const Context *context,
  
- const TextureCaps &TextureCapsMap::get(GLenum internalFormat) const
- {
+     static_assert(MAX_VERTEX_ATTRIBS <= sizeof(unsigned long) * 8,
+                   "Too many vertex attribs for mask");
 +#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static TextureCaps defaultUnsupportedTexture;
++#pragma clang diagnostic ignored "-Wconversion"
+     state->mActiveAttribLocationsMask = stream.readInt<unsigned long>();
 +#pragma clang diagnostic pop
-     InternalFormatToCapsMap::const_iterator iter = mCapsMap.find(internalFormat);
-     return (iter != mCapsMap.end()) ? iter->second : defaultUnsupportedTexture;
- }
-@@ -594,7 +597,10 @@ const ExtensionInfoMap &GetExtensionInfoMap()
-         return map;
-     };
  
+     unsigned int attribCount = stream.readInt<unsigned int>();
+     ASSERT(state->mAttributes.empty());
+@@ -408,7 +411,10 @@ LinkResult MemoryProgramCache::Deserialize(const Context *context,
+     state->mAtomicCounterUniformRange   = RangeUI(atomicCounterRangeLow, atomicCounterRangeHigh);
+     static_assert(SHADER_TYPE_MAX <= sizeof(unsigned long) * 8, "Too many shader types");
 +#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static const ExtensionInfoMap extensionInfo = buildExtensionInfoMap();
++#pragma clang diagnostic ignored "-Wconversion"
+     state->mLinkedShaderStages = stream.readInt<unsigned long>();
 +#pragma clang diagnostic pop
-     return extensionInfo;
- }
  
-diff --git a/src/libANGLE/Device.cpp b/src/libANGLE/Device.cpp
-index eb30b20..a94d500 100644
---- a/src/libANGLE/Device.cpp
-+++ b/src/libANGLE/Device.cpp
-@@ -38,7 +38,10 @@ static std::string GenerateExtensionsString(const T &extensions)
- typedef std::set<egl::Device *> DeviceSet;
- static DeviceSet *GetDeviceSet()
+     return program->getImplementation()->load(context, infoLog, &stream);
+ }
+diff --git a/src/libANGLE/Platform.cpp b/src/libANGLE/Platform.cpp
+index 702091624..c51289423 100644
+--- a/src/libANGLE/Platform.cpp
++++ b/src/libANGLE/Platform.cpp
+@@ -15,7 +15,14 @@
+ namespace
  {
+ // TODO(jmadill): Make methods owned by egl::Display.
+-angle::PlatformMethods g_platformMethods;
++#if defined(__clang__)
 +#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static DeviceSet devices;
++#pragma clang diagnostic ignored "-Wglobal-constructors"
++#endif
++    angle::PlatformMethods g_platformMethods;
++#if defined(__clang__)
 +#pragma clang diagnostic pop
-     return &devices;
++#endif
+ }  // anonymous namespace
+ angle::PlatformMethods::PlatformMethods()
+diff --git a/src/tests/compiler_tests/QualificationOrder_test.cpp b/src/tests/compiler_tests/QualificationOrder_test.cpp
+index c0249dbb9..c82acffd7 100644
+--- a/src/tests/compiler_tests/QualificationOrder_test.cpp
++++ b/src/tests/compiler_tests/QualificationOrder_test.cpp
+@@ -429,7 +429,7 @@ TEST_F(QualificationOrderFragmentShaderTest, InvalidFunctionParametersInvariant)
+         "}\n"
+         "void main()\n"
+         "{\n"
+-        "     gl_FragColor = vec4(foo0(value));\n"
++        "   gl_FragColor = vec4(foo0(value));\n"
+         "}\n";
+     if (compile(shaderString))
+@@ -449,7 +449,7 @@ TEST_F(QualificationOrderFragmentShaderTest, InvalidFunctionParametersAttribute)
+         "}\n"
+         "void main()\n"
+         "{\n"
+-        "     gl_FragColor = vec4(foo0(value));\n"
++        "   gl_FragColor = vec4(foo0(value));\n"
+         "}\n";
+     if (compile(shaderString))
+@@ -469,7 +469,7 @@ TEST_F(QualificationOrderFragmentShaderTest, InvalidFunctionParametersVarying)
+         "}\n"
+         "void main()\n"
+         "{\n"
+-        "     gl_FragColor = vec4(foo0(value));\n"
++        "   gl_FragColor = vec4(foo0(value));\n"
+         "}\n";
+     if (compile(shaderString))
+@@ -491,7 +491,7 @@ TEST_F(QualificationOrderFragmentShaderTest, InvalidFunctionParametersLayout)
+         "out vec4 colorOUT;\n"
+         "void main()\n"
+         "{\n"
+-        "     colorOUT = vec4(foo0(value));\n"
++        "   colorOUT = vec4(foo0(value));\n"
+         "}\n";
+     if (compile(shaderString))
+@@ -513,7 +513,7 @@ TEST_F(QualificationOrderFragmentShaderTest, InvalidFunctionParametersCentroidIn
+         "out vec4 colorOUT;\n"
+         "void main()\n"
+         "{\n"
+-        "     colorOUT = vec4(foo0(value));\n"
++        "   colorOUT = vec4(foo0(value));\n"
+         "}\n";
+     if (compile(shaderString))
+@@ -535,7 +535,7 @@ TEST_F(QualificationOrderFragmentShaderTest, InvalidFunctionParametersFlatIn)
+         "out vec4 colorOUT;\n"
+         "void main()\n"
+         "{\n"
+-        "     colorOUT = vec4(foo0(value));\n"
++        "   colorOUT = vec4(foo0(value));\n"
+         "}\n";
+     if (compile(shaderString))
+diff --git a/src/tests/deqp_support/es2fShaderMatrixTests.cpp b/src/tests/deqp_support/es2fShaderMatrixTests.cpp
+index 9feb4dcfa..54d8474fd 100644
+--- a/src/tests/deqp_support/es2fShaderMatrixTests.cpp
++++ b/src/tests/deqp_support/es2fShaderMatrixTests.cpp
+@@ -69,77 +69,77 @@ using tcu::Mat4;
+ // Uniform / constant values for tests.
+ // \note Input1 should not contain 0 components as it is used as divisor in div cases.
+ // \todo [2012-02-14 pyry] Make these dynamic.
+-static const float    s_constInFloat[2]       = { 0.5f, -0.2f };
+-static const Vec2     s_constInVec2[2]        = { Vec2(1.2f, 0.5f), Vec2(0.5f, 1.0f) };
+-static const Vec3     s_constInVec3[2]        = { Vec3(1.1f, 0.1f, 0.5f), Vec3(-0.2f, 0.5f, 0.8f) };
+-static const Vec4     s_constInVec4[2]        = { Vec4(1.4f, 0.2f, -0.5f, 0.7f), Vec4(0.2f, -1.0f, 0.5f, 0.8f) };
++static const float  s_constInFloat[2]   = { 0.5f, -0.2f };
++static const Vec2   s_constInVec2[2]    = { Vec2(1.2f, 0.5f), Vec2(0.5f, 1.0f) };
++static const Vec3   s_constInVec3[2]    = { Vec3(1.1f, 0.1f, 0.5f), Vec3(-0.2f, 0.5f, 0.8f) };
++static const Vec4   s_constInVec4[2]    = { Vec4(1.4f, 0.2f, -0.5f, 0.7f), Vec4(0.2f, -1.0f, 0.5f, 0.8f) };
+ static const float s_constInMat20[] = { 0.6f, -1.0f, 0.7f, 0.4f };
+ static const float s_constInMat21[] = { -0.5f, -0.4f, 0.7f, -0.8f };
+ static const float s_constInMat31[] =
+ {
+-      1.2f,  0.1f, -0.1f,
+-      0.1f,  0.9f,  0.2f,
+-      0.2f, -0.1f,  0.7f
++    1.2f,  0.1f, -0.1f,
++    0.1f,  0.9f,  0.2f,
++    0.2f, -0.1f,  0.7f
+ };
+ static const float s_constInMat41[] =
+ {
+-       1.2f, -0.2f,  0.4f,  0.1f,
+-       0.1f,  0.8f, -0.1f, -0.2f,
+-      -0.2f,  0.1f, -1.1f,  0.3f,
+-       0.1f,  0.2f,  0.3f,  0.9f
++     1.2f, -0.2f,  0.4f,  0.1f,
++     0.1f,  0.8f, -0.1f, -0.2f,
++    -0.2f,  0.1f, -1.1f,  0.3f,
++     0.1f,  0.2f,  0.3f,  0.9f
+ };
+-static const Mat2     s_constInMat2[2]        = { tcu::Mat2(s_constInMat20), tcu::Mat2(s_constInMat21) };
+-static const Mat3     s_constInMat3[2]        = { tcu::translationMatrix(tcu::Vec2(0.2f, -0.3f)), tcu::Mat3(s_constInMat31) };
+-static const Mat4     s_constInMat4[2]        = { tcu::translationMatrix(tcu::Vec3(0.2f, -0.3f, 0.15f)), tcu::Mat4(s_constInMat41) };
++static const Mat2   s_constInMat2[2]    = { tcu::Mat2(s_constInMat20), tcu::Mat2(s_constInMat21) };
++static const Mat3   s_constInMat3[2]    = { tcu::translationMatrix(tcu::Vec2(0.2f, -0.3f)), tcu::Mat3(s_constInMat31) };
++static const Mat4   s_constInMat4[2]    = { tcu::translationMatrix(tcu::Vec3(0.2f, -0.3f, 0.15f)), tcu::Mat4(s_constInMat41) };
+ namespace MatrixCaseUtils
+ {
+ enum InputType
+ {
+-      INPUTTYPE_CONST = 0,
+-      INPUTTYPE_UNIFORM,
+-      INPUTTYPE_DYNAMIC,
++    INPUTTYPE_CONST = 0,
++    INPUTTYPE_UNIFORM,
++    INPUTTYPE_DYNAMIC,
+-      INPUTTYPE_LAST
++    INPUTTYPE_LAST
+ };
+ struct ShaderInput
+ {
+-      ShaderInput (InputType inputType_, DataType dataType_, Precision precision_)
+-              : inputType     (inputType_)
+-              , dataType      (dataType_)
+-              , precision     (precision_)
+-      {
+-      }
+-
+-      InputType               inputType;
+-      DataType                dataType;
+-      Precision               precision;
++    ShaderInput (InputType inputType_, DataType dataType_, Precision precision_)
++        : inputType (inputType_)
++        , dataType  (dataType_)
++        , precision (precision_)
++    {
++    }
++
++    InputType       inputType;
++    DataType        dataType;
++    Precision       precision;
+ };
+ enum MatrixOp
+ {
+-      OP_ADD = 0,
+-      OP_SUB,
+-      OP_MUL,
+-      OP_DIV,
+-      OP_COMP_MUL,
+-      OP_UNARY_PLUS,
+-      OP_NEGATION,
+-      OP_PRE_INCREMENT,
+-      OP_PRE_DECREMENT,
+-      OP_POST_INCREMENT,
+-      OP_POST_DECREMENT,
+-      OP_ADD_INTO,
+-      OP_SUBTRACT_FROM,
+-      OP_MULTIPLY_INTO,
+-      OP_DIVIDE_INTO,
+-
+-      OP_LAST
++    OP_ADD = 0,
++    OP_SUB,
++    OP_MUL,
++    OP_DIV,
++    OP_COMP_MUL,
++    OP_UNARY_PLUS,
++    OP_NEGATION,
++    OP_PRE_INCREMENT,
++    OP_PRE_DECREMENT,
++    OP_POST_INCREMENT,
++    OP_POST_DECREMENT,
++    OP_ADD_INTO,
++    OP_SUBTRACT_FROM,
++    OP_MULTIPLY_INTO,
++    OP_DIVIDE_INTO,
++
++    OP_LAST
+ };
+ // Type traits.
+@@ -147,16 +147,16 @@ enum MatrixOp
+ template <int DataT>
+ struct TypeTraits;
+-#define DECLARE_TYPE_TRAIT(DATATYPE, TYPE)    \
+-template<>                                                                    \
+-struct TypeTraits<DATATYPE> {                         \
+-      typedef TYPE Type;                                              \
++#define DECLARE_TYPE_TRAIT(DATATYPE, TYPE)  \
++template<>                                  \
++struct TypeTraits<DATATYPE> {               \
++    typedef TYPE Type;                      \
  }
  
-diff --git a/src/libANGLE/Display.cpp b/src/libANGLE/Display.cpp
-index 92d7dda..5711117 100644
---- a/src/libANGLE/Display.cpp
-+++ b/src/libANGLE/Display.cpp
-@@ -90,21 +90,30 @@ typedef std::map<EGLNativeWindowType, Surface*> WindowSurfaceMap;
- // associated with it.
- static WindowSurfaceMap *GetWindowSurfaces()
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT,                float);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC2,   tcu::Vec2);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC3,   tcu::Vec3);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC4,   tcu::Vec4);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT,      float);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC2, tcu::Vec2);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC3, tcu::Vec3);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC4, tcu::Vec4);
+ DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT2, tcu::Mat2);
+ DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT3, tcu::Mat3);
+ DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT4, tcu::Mat4);
+@@ -165,169 +165,169 @@ DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT4, tcu::Mat4);
+ enum OperationType
  {
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static WindowSurfaceMap windowSurfaces;
-+#pragma clang diagnostic pop
-     return &windowSurfaces;
+-      OPERATIONTYPE_BINARY_OPERATOR = 0,
+-      OPERATIONTYPE_BINARY_FUNCTION,
+-      OPERATIONTYPE_UNARY_PREFIX_OPERATOR,
+-      OPERATIONTYPE_UNARY_POSTFIX_OPERATOR,
+-      OPERATIONTYPE_ASSIGNMENT,
++    OPERATIONTYPE_BINARY_OPERATOR = 0,
++    OPERATIONTYPE_BINARY_FUNCTION,
++    OPERATIONTYPE_UNARY_PREFIX_OPERATOR,
++    OPERATIONTYPE_UNARY_POSTFIX_OPERATOR,
++    OPERATIONTYPE_ASSIGNMENT,
+-      OPERATIONTYPE_LAST
++    OPERATIONTYPE_LAST
+ };
+ static const char* getOperationName (MatrixOp op)
+ {
+-      switch (op)
+-      {
+-              case OP_ADD:                    return "+";
+-              case OP_SUB:                    return "-";
+-              case OP_MUL:                    return "*";
+-              case OP_DIV:                    return "/";
+-              case OP_COMP_MUL:               return "matrixCompMult";
+-              case OP_UNARY_PLUS:             return "+";
+-              case OP_NEGATION:               return "-";
+-              case OP_PRE_INCREMENT:  return "++";
+-              case OP_PRE_DECREMENT:  return "--";
+-              case OP_POST_INCREMENT: return "++";
+-              case OP_POST_DECREMENT: return "--";
+-              case OP_ADD_INTO:               return "+=";
+-              case OP_SUBTRACT_FROM:  return "-=";
+-              case OP_MULTIPLY_INTO:  return "*=";
+-              case OP_DIVIDE_INTO:    return "/=";
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-                      return "";
+-      }
++    switch (op)
++    {
++        case OP_ADD:            return "+";
++        case OP_SUB:            return "-";
++        case OP_MUL:            return "*";
++        case OP_DIV:            return "/";
++        case OP_COMP_MUL:       return "matrixCompMult";
++        case OP_UNARY_PLUS:     return "+";
++        case OP_NEGATION:       return "-";
++        case OP_PRE_INCREMENT:  return "++";
++        case OP_PRE_DECREMENT:  return "--";
++        case OP_POST_INCREMENT: return "++";
++        case OP_POST_DECREMENT: return "--";
++        case OP_ADD_INTO:       return "+=";
++        case OP_SUBTRACT_FROM:  return "-=";
++        case OP_MULTIPLY_INTO:  return "*=";
++        case OP_DIVIDE_INTO:    return "/=";
++        default:
++            DE_ASSERT(DE_FALSE);
++            return "";
++    }
  }
  
- typedef std::map<EGLNativeDisplayType, Display *> ANGLEPlatformDisplayMap;
- static ANGLEPlatformDisplayMap *GetANGLEPlatformDisplayMap()
+ static OperationType getOperationType (MatrixOp op)
  {
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static ANGLEPlatformDisplayMap displays;
-+#pragma clang diagnostic pop
-     return &displays;
+-      switch (op)
+-      {
+-              case OP_ADD:                    return OPERATIONTYPE_BINARY_OPERATOR;
+-              case OP_SUB:                    return OPERATIONTYPE_BINARY_OPERATOR;
+-              case OP_MUL:                    return OPERATIONTYPE_BINARY_OPERATOR;
+-              case OP_DIV:                    return OPERATIONTYPE_BINARY_OPERATOR;
+-              case OP_COMP_MUL:               return OPERATIONTYPE_BINARY_FUNCTION;
+-              case OP_UNARY_PLUS:             return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+-              case OP_NEGATION:               return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+-              case OP_PRE_INCREMENT:  return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+-              case OP_PRE_DECREMENT:  return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+-              case OP_POST_INCREMENT: return OPERATIONTYPE_UNARY_POSTFIX_OPERATOR;
+-              case OP_POST_DECREMENT: return OPERATIONTYPE_UNARY_POSTFIX_OPERATOR;
+-              case OP_ADD_INTO:               return OPERATIONTYPE_ASSIGNMENT;
+-              case OP_SUBTRACT_FROM:  return OPERATIONTYPE_ASSIGNMENT;
+-              case OP_MULTIPLY_INTO:  return OPERATIONTYPE_ASSIGNMENT;
+-              case OP_DIVIDE_INTO:    return OPERATIONTYPE_ASSIGNMENT;
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-                      return OPERATIONTYPE_LAST;
+-      }
++    switch (op)
++    {
++        case OP_ADD:            return OPERATIONTYPE_BINARY_OPERATOR;
++        case OP_SUB:            return OPERATIONTYPE_BINARY_OPERATOR;
++        case OP_MUL:            return OPERATIONTYPE_BINARY_OPERATOR;
++        case OP_DIV:            return OPERATIONTYPE_BINARY_OPERATOR;
++        case OP_COMP_MUL:       return OPERATIONTYPE_BINARY_FUNCTION;
++        case OP_UNARY_PLUS:     return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
++        case OP_NEGATION:       return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
++        case OP_PRE_INCREMENT:  return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
++        case OP_PRE_DECREMENT:  return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
++        case OP_POST_INCREMENT: return OPERATIONTYPE_UNARY_POSTFIX_OPERATOR;
++        case OP_POST_DECREMENT: return OPERATIONTYPE_UNARY_POSTFIX_OPERATOR;
++        case OP_ADD_INTO:       return OPERATIONTYPE_ASSIGNMENT;
++        case OP_SUBTRACT_FROM:  return OPERATIONTYPE_ASSIGNMENT;
++        case OP_MULTIPLY_INTO:  return OPERATIONTYPE_ASSIGNMENT;
++        case OP_DIVIDE_INTO:    return OPERATIONTYPE_ASSIGNMENT;
++        default:
++            DE_ASSERT(DE_FALSE);
++            return OPERATIONTYPE_LAST;
++    }
  }
  
- typedef std::map<Device *, Display *> DevicePlatformDisplayMap;
- static DevicePlatformDisplayMap *GetDevicePlatformDisplayMap()
+ enum TestMatrixType
  {
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static DevicePlatformDisplayMap displays;
-+#pragma clang diagnostic pop
-     return &displays;
+-      TESTMATRIXTYPE_DEFAULT = 0,
+-      TESTMATRIXTYPE_NEGATED,
+-      TESTMATRIXTYPE_INCREMENTED,
+-      TESTMATRIXTYPE_DECREMENTED,
++    TESTMATRIXTYPE_DEFAULT = 0,
++    TESTMATRIXTYPE_NEGATED,
++    TESTMATRIXTYPE_INCREMENTED,
++    TESTMATRIXTYPE_DECREMENTED,
+-      TESTMATRIXTYPE_LAST
++    TESTMATRIXTYPE_LAST
+ };
+ static TestMatrixType getOperationTestMatrixType (MatrixOp op)
+ {
+-      switch(op)
+-      {
+-              case OP_ADD:                    return TESTMATRIXTYPE_DEFAULT;
+-              case OP_SUB:                    return TESTMATRIXTYPE_DEFAULT;
+-              case OP_MUL:                    return TESTMATRIXTYPE_DEFAULT;
+-              case OP_DIV:                    return TESTMATRIXTYPE_DEFAULT;
+-              case OP_COMP_MUL:               return TESTMATRIXTYPE_DEFAULT;
+-              case OP_UNARY_PLUS:             return TESTMATRIXTYPE_DEFAULT;
+-              case OP_NEGATION:               return TESTMATRIXTYPE_NEGATED;
+-              case OP_PRE_INCREMENT:  return TESTMATRIXTYPE_NEGATED;
+-              case OP_PRE_DECREMENT:  return TESTMATRIXTYPE_INCREMENTED;
+-              case OP_POST_INCREMENT: return TESTMATRIXTYPE_NEGATED;
+-              case OP_POST_DECREMENT: return TESTMATRIXTYPE_DEFAULT;
+-              case OP_ADD_INTO:               return TESTMATRIXTYPE_DECREMENTED;
+-              case OP_SUBTRACT_FROM:  return TESTMATRIXTYPE_DEFAULT;
+-              case OP_MULTIPLY_INTO:  return TESTMATRIXTYPE_DEFAULT;
+-              case OP_DIVIDE_INTO:    return TESTMATRIXTYPE_DEFAULT;
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-                      return TESTMATRIXTYPE_LAST;
+-      }
++    switch(op)
++    {
++        case OP_ADD:            return TESTMATRIXTYPE_DEFAULT;
++        case OP_SUB:            return TESTMATRIXTYPE_DEFAULT;
++        case OP_MUL:            return TESTMATRIXTYPE_DEFAULT;
++        case OP_DIV:            return TESTMATRIXTYPE_DEFAULT;
++        case OP_COMP_MUL:       return TESTMATRIXTYPE_DEFAULT;
++        case OP_UNARY_PLUS:     return TESTMATRIXTYPE_DEFAULT;
++        case OP_NEGATION:       return TESTMATRIXTYPE_NEGATED;
++        case OP_PRE_INCREMENT:  return TESTMATRIXTYPE_NEGATED;
++        case OP_PRE_DECREMENT:  return TESTMATRIXTYPE_INCREMENTED;
++        case OP_POST_INCREMENT: return TESTMATRIXTYPE_NEGATED;
++        case OP_POST_DECREMENT: return TESTMATRIXTYPE_DEFAULT;
++        case OP_ADD_INTO:       return TESTMATRIXTYPE_DECREMENTED;
++        case OP_SUBTRACT_FROM:  return TESTMATRIXTYPE_DEFAULT;
++        case OP_MULTIPLY_INTO:  return TESTMATRIXTYPE_DEFAULT;
++        case OP_DIVIDE_INTO:    return TESTMATRIXTYPE_DEFAULT;
++
++        default:
++            DE_ASSERT(DE_FALSE);
++            return TESTMATRIXTYPE_LAST;
++    }
  }
  
-@@ -921,7 +930,10 @@ const ClientExtensions &Display::getClientExtensions()
+ static bool isOperationBinary (MatrixOp op)
+ {
+-      return getOperationType(op) == OPERATIONTYPE_BINARY_OPERATOR ||
+-             getOperationType(op) == OPERATIONTYPE_BINARY_FUNCTION ||
+-             getOperationType(op) == OPERATIONTYPE_ASSIGNMENT;
++    return getOperationType(op) == OPERATIONTYPE_BINARY_OPERATOR ||
++           getOperationType(op) == OPERATIONTYPE_BINARY_FUNCTION ||
++           getOperationType(op) == OPERATIONTYPE_ASSIGNMENT;
+ }
  
const std::string &Display::getClientExtensionString()
static bool isOperationMatrixScalar (MatrixOp op)
  {
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static const std::string clientExtensionsString = GenerateExtensionsString(getClientExtensions());
-+#pragma clang diagnostic pop
-     return clientExtensionsString;
+-      return op == OP_ADD || op == OP_SUB || op == OP_MUL || op == OP_DIV;
++    return op == OP_ADD || op == OP_SUB || op == OP_MUL || op == OP_DIV;
  }
  
-diff --git a/src/libANGLE/HandleRangeAllocator.cpp b/src/libANGLE/HandleRangeAllocator.cpp
-index f219f95..3831aca 100644
---- a/src/libANGLE/HandleRangeAllocator.cpp
-+++ b/src/libANGLE/HandleRangeAllocator.cpp
-@@ -223,4 +223,4 @@ bool HandleRangeAllocator::isUsed(GLuint handle) const
-     return current->second >= handle;
+ static bool isOperationMatrixVector (MatrixOp op)
+ {
+-      return op == OP_MUL;
++    return op == OP_MUL;
  }
  
--}  // namespace gl
-\ No newline at end of file
-+}  // namespace gl
-diff --git a/src/libANGLE/HandleRangeAllocator.h b/src/libANGLE/HandleRangeAllocator.h
-index 20f9a11..1023a84 100644
---- a/src/libANGLE/HandleRangeAllocator.h
-+++ b/src/libANGLE/HandleRangeAllocator.h
-@@ -56,4 +56,4 @@ class HandleRangeAllocator final : angle::NonCopyable
+ static bool isOperationMatrixMatrix (MatrixOp op)
+ {
+-      return op == OP_ADD || op == OP_SUB || op == OP_MUL || op == OP_DIV || op == OP_COMP_MUL;
++    return op == OP_ADD || op == OP_SUB || op == OP_MUL || op == OP_DIV || op == OP_COMP_MUL;
+ }
  
- }  // namespace gl
+ static bool isOperationUnary (MatrixOp op)
+ {
+-      return  op == OP_UNARY_PLUS                     ||
+-                      op == OP_NEGATION                       ||
+-                      op == OP_PRE_INCREMENT          ||
+-                      op == OP_PRE_DECREMENT          ||
+-                      op == OP_POST_INCREMENT         ||
+-                      op == OP_POST_DECREMENT;
++    return  op == OP_UNARY_PLUS         ||
++            op == OP_NEGATION           ||
++            op == OP_PRE_INCREMENT      ||
++            op == OP_PRE_DECREMENT      ||
++            op == OP_POST_INCREMENT     ||
++            op == OP_POST_DECREMENT;
+ }
  
--#endif  // LIBANGLE_HANDLERANGEALLOCATOR_H_
-\ No newline at end of file
-+#endif  // LIBANGLE_HANDLERANGEALLOCATOR_H_
-diff --git a/src/libANGLE/Path.h b/src/libANGLE/Path.h
-index b103c84..85f49c1 100644
---- a/src/libANGLE/Path.h
-+++ b/src/libANGLE/Path.h
-@@ -68,4 +68,4 @@ class Path final : angle::NonCopyable
+ static bool isOperationValueModifying (MatrixOp op)
+ {
+-      return  op == OP_PRE_INCREMENT          ||
+-                      op == OP_PRE_DECREMENT          ||
+-                      op == OP_POST_INCREMENT         ||
+-                      op == OP_POST_DECREMENT;
++    return  op == OP_PRE_INCREMENT      ||
++            op == OP_PRE_DECREMENT      ||
++            op == OP_POST_INCREMENT     ||
++            op == OP_POST_DECREMENT;
+ }
  
- }  // namespace gl
+ static bool isOperationAssignment (MatrixOp op)
+ {
+-      return  op == OP_ADD_INTO                ||
+-                      op == OP_SUBTRACT_FROM   ||
+-                      op == OP_MULTIPLY_INTO   ||
+-                      op == OP_DIVIDE_INTO;
++    return  op == OP_ADD_INTO        ||
++            op == OP_SUBTRACT_FROM   ||
++            op == OP_MULTIPLY_INTO   ||
++            op == OP_DIVIDE_INTO;
+ }
  
--#endif  // LIBANGLE_PATH_H_
-\ No newline at end of file
-+#endif  // LIBANGLE_PATH_H_
-diff --git a/src/libANGLE/formatutils.cpp b/src/libANGLE/formatutils.cpp
-index ff285dd..55a5fc8 100644
---- a/src/libANGLE/formatutils.cpp
-+++ b/src/libANGLE/formatutils.cpp
-@@ -615,7 +615,10 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
+ // Operation nature
  
- static const InternalFormatInfoMap &GetInternalFormatMap()
+ enum OperationNature
  {
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static const InternalFormatInfoMap formatMap = BuildInternalFormatInfoMap();
-+#pragma clang diagnostic pop
-     return formatMap;
+-      OPERATIONNATURE_PURE = 0,
+-      OPERATIONNATURE_MUTATING,
+-      OPERATIONNATURE_ASSIGNMENT,
++    OPERATIONNATURE_PURE = 0,
++    OPERATIONNATURE_MUTATING,
++    OPERATIONNATURE_ASSIGNMENT,
+-      OPERATIONNATURE_LAST
++    OPERATIONNATURE_LAST
+ };
+ static OperationNature getOperationNature (MatrixOp op)
+ {
+-      if (isOperationAssignment(op))
+-              return OPERATIONNATURE_ASSIGNMENT;
++    if (isOperationAssignment(op))
++        return OPERATIONNATURE_ASSIGNMENT;
+-      if (isOperationValueModifying(op))
+-              return OPERATIONNATURE_MUTATING;
++    if (isOperationValueModifying(op))
++        return OPERATIONNATURE_MUTATING;
+-      return OPERATIONNATURE_PURE;
++    return OPERATIONNATURE_PURE;
  }
  
-@@ -859,7 +862,10 @@ GLenum GetSizedInternalFormat(GLenum internalFormat, GLenum type)
+ // Input value loader.
+@@ -335,47 +335,47 @@ static OperationNature getOperationNature (MatrixOp op)
+ template <int InputT, int DataT>
+ typename TypeTraits<DataT>::Type getInputValue (const ShaderEvalContext& evalCtx, int inputNdx);
+-template <> inline float              getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT>                     (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInFloat[inputNdx];  }
+-template <> inline tcu::Vec2  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_VEC2>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec2[inputNdx];   }
+-template <> inline tcu::Vec3  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_VEC3>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec3[inputNdx];   }
+-template <> inline tcu::Vec4  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_VEC4>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec4[inputNdx];   }
+-template <> inline tcu::Mat2  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT2>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInMat2[inputNdx];   }
+-template <> inline tcu::Mat3  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT3>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInMat3[inputNdx];   }
+-template <> inline tcu::Mat4  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT4>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInMat4[inputNdx];   }
++template <> inline float        getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT>         (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInFloat[inputNdx];  }
++template <> inline tcu::Vec2    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_VEC2>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec2[inputNdx];   }
++template <> inline tcu::Vec3    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_VEC3>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec3[inputNdx];   }
++template <> inline tcu::Vec4    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_VEC4>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec4[inputNdx];   }
++template <> inline tcu::Mat2    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT2>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInMat2[inputNdx];   }
++template <> inline tcu::Mat3    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT3>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInMat3[inputNdx];   }
++template <> inline tcu::Mat4    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT4>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInMat4[inputNdx];   }
+-template <> inline float              getInputValue<INPUTTYPE_DYNAMIC,        TYPE_FLOAT>                     (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.x();                                       }
+-template <> inline tcu::Vec2  getInputValue<INPUTTYPE_DYNAMIC,        TYPE_FLOAT_VEC2>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1);                     }
+-template <> inline tcu::Vec3  getInputValue<INPUTTYPE_DYNAMIC,        TYPE_FLOAT_VEC3>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1, 2);          }
+-template <> inline tcu::Vec4  getInputValue<INPUTTYPE_DYNAMIC,        TYPE_FLOAT_VEC4>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1, 2, 3);       }
++template <> inline float        getInputValue<INPUTTYPE_DYNAMIC,    TYPE_FLOAT>         (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.x();                   }
++template <> inline tcu::Vec2    getInputValue<INPUTTYPE_DYNAMIC,    TYPE_FLOAT_VEC2>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1);         }
++template <> inline tcu::Vec3    getInputValue<INPUTTYPE_DYNAMIC,    TYPE_FLOAT_VEC3>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1, 2);      }
++template <> inline tcu::Vec4    getInputValue<INPUTTYPE_DYNAMIC,    TYPE_FLOAT_VEC4>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1, 2, 3);   }
  
const FormatSet &GetAllSizedInternalFormats()
template <> inline tcu::Mat2 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT2> (const ShaderEvalContext& evalCtx, int inputNdx)
  {
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static FormatSet formatSet = BuildAllSizedInternalFormatSet();
-+#pragma clang diagnostic pop
-     return formatSet;
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat2 m;
+-      m.setColumn(0, evalCtx.in[0].swizzle(0,1));
+-      m.setColumn(1, evalCtx.in[1].swizzle(0,1));
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat2 m;
++    m.setColumn(0, evalCtx.in[0].swizzle(0,1));
++    m.setColumn(1, evalCtx.in[1].swizzle(0,1));
++    return m;
+ }
+ template <> inline tcu::Mat3 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT3> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat3 m;
+-      m.setColumn(0, evalCtx.in[0].swizzle(0,1,2));
+-      m.setColumn(1, evalCtx.in[1].swizzle(0,1,2));
+-      m.setColumn(2, evalCtx.in[2].swizzle(0,1,2));
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat3 m;
++    m.setColumn(0, evalCtx.in[0].swizzle(0,1,2));
++    m.setColumn(1, evalCtx.in[1].swizzle(0,1,2));
++    m.setColumn(2, evalCtx.in[2].swizzle(0,1,2));
++    return m;
  }
  
-diff --git a/src/libANGLE/renderer/PathImpl.h b/src/libANGLE/renderer/PathImpl.h
-index 3607f69..cb03ed6 100644
---- a/src/libANGLE/renderer/PathImpl.h
-+++ b/src/libANGLE/renderer/PathImpl.h
-@@ -33,4 +33,4 @@ class PathImpl : angle::NonCopyable
+ template <> inline tcu::Mat4 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT4> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat4 m;
+-      m.setColumn(0, evalCtx.in[0]);
+-      m.setColumn(1, evalCtx.in[1]);
+-      m.setColumn(2, evalCtx.in[2]);
+-      m.setColumn(3, evalCtx.in[3]);
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat4 m;
++    m.setColumn(0, evalCtx.in[0]);
++    m.setColumn(1, evalCtx.in[1]);
++    m.setColumn(2, evalCtx.in[2]);
++    m.setColumn(3, evalCtx.in[3]);
++    return m;
+ }
  
- }  // namespace rx
+ // Reduction from expression result to vec3.
+@@ -392,13 +392,13 @@ inline tcu::Vec3 reduceToVec3 (const tcu::Mat4& value) { return value.getColumn(
+ template <typename T, int Rows, int Cols>
+ tcu::Matrix<T, Rows, Cols> matrixCompMult (const tcu::Matrix<T, Rows, Cols>& a, const tcu::Matrix<T, Rows, Cols>& b)
+ {
+-      tcu::Matrix<T, Rows, Cols> retVal;
++    tcu::Matrix<T, Rows, Cols> retVal;
  
--#endif  // LIBANGLE_RENDERER_PATHIMPL_H_
-\ No newline at end of file
-+#endif  // LIBANGLE_RENDERER_PATHIMPL_H_
-diff --git a/src/libANGLE/validationES3.cpp b/src/libANGLE/validationES3.cpp
-index 2f93651..49aa604 100644
---- a/src/libANGLE/validationES3.cpp
-+++ b/src/libANGLE/validationES3.cpp
-@@ -524,7 +524,10 @@ static bool IsValidES3CopyTexImageCombination(const Format &textureFormat,
-     const auto &textureFormatInfo     = *textureFormat.info;
-     const auto &framebufferFormatInfo = *framebufferFormat.info;
+-      for (int r = 0; r < Rows; ++r)
+-              for (int c = 0; c < Cols; ++c)
+-                      retVal(r,c) = a(r,c) * b(r, c);
++    for (int r = 0; r < Rows; ++r)
++        for (int c = 0; c < Cols; ++c)
++            retVal(r,c) = a(r,c) * b(r, c);
  
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wexit-time-destructors"
-     static const CopyConversionSet conversionSet = BuildValidES3CopyTexImageCombinations();
-+#pragma clang diagnostic pop
-     if (conversionSet.find(CopyConversion(textureFormatInfo.format,
-                                           framebufferFormatInfo.format)) != conversionSet.end())
-     {
-diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
-index 9bb75910ac0..ccaf7e6f343 100644
---- a/include/EGL/eglplatform.h
-+++ b/include/EGL/eglplatform.h
-@@ -89,6 +89,12 @@ typedef int   EGLNativeDisplayType;
- typedef void *EGLNativeWindowType;
- typedef void *EGLNativePixmapType;
+-      return retVal;
++    return retVal;
+ }
+ // negate
+@@ -406,13 +406,13 @@ tcu::Matrix<T, Rows, Cols> matrixCompMult (const tcu::Matrix<T, Rows, Cols>& a,
+ template <typename T, int Rows, int Cols>
+ tcu::Matrix<T, Rows, Cols> negate (const tcu::Matrix<T, Rows, Cols>& mat)
+ {
+-      tcu::Matrix<T, Rows, Cols> retVal;
++    tcu::Matrix<T, Rows, Cols> retVal;
+-      for (int r = 0; r < Rows; ++r)
+-              for (int c = 0; c < Cols; ++c)
+-                      retVal(r,c) = -mat(r, c);
++    for (int r = 0; r < Rows; ++r)
++        for (int c = 0; c < Cols; ++c)
++            retVal(r,c) = -mat(r, c);
+-      return retVal;
++    return retVal;
+ }
+ // increment/decrement
+@@ -420,25 +420,25 @@ tcu::Matrix<T, Rows, Cols> negate (const tcu::Matrix<T, Rows, Cols>& mat)
+ template <typename T, int Rows, int Cols>
+ tcu::Matrix<T, Rows, Cols> increment (const tcu::Matrix<T, Rows, Cols>& mat)
+ {
+-      tcu::Matrix<T, Rows, Cols> retVal;
++    tcu::Matrix<T, Rows, Cols> retVal;
+-      for (int r = 0; r < Rows; ++r)
+-              for (int c = 0; c < Cols; ++c)
+-                      retVal(r,c) = mat(r, c) + 1.0f;
++    for (int r = 0; r < Rows; ++r)
++        for (int c = 0; c < Cols; ++c)
++            retVal(r,c) = mat(r, c) + 1.0f;
+-      return retVal;
++    return retVal;
+ }
+ template <typename T, int Rows, int Cols>
+ tcu::Matrix<T, Rows, Cols> decrement (const tcu::Matrix<T, Rows, Cols>& mat)
+ {
+-      tcu::Matrix<T, Rows, Cols> retVal;
++    tcu::Matrix<T, Rows, Cols> retVal;
+-      for (int r = 0; r < Rows; ++r)
+-              for (int c = 0; c < Cols; ++c)
+-                      retVal(r,c) = mat(r, c) - 1.0f;
++    for (int r = 0; r < Rows; ++r)
++        for (int c = 0; c < Cols; ++c)
++            retVal(r,c) = mat(r, c) - 1.0f;
+-      return retVal;
++    return retVal;
+ }
+ // Evaluator template.
+@@ -449,244 +449,244 @@ struct Evaluator;
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_ADD, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) + getInputValue<In1Type, In1DataType>(evalCtx, 1));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) + getInputValue<In1Type, In1DataType>(evalCtx, 1));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_SUB, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) - getInputValue<In1Type, In1DataType>(evalCtx, 1));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) - getInputValue<In1Type, In1DataType>(evalCtx, 1));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_MUL, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) * getInputValue<In1Type, In1DataType>(evalCtx, 1));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) * getInputValue<In1Type, In1DataType>(evalCtx, 1));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_DIV, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) / getInputValue<In1Type, In1DataType>(evalCtx, 1));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) / getInputValue<In1Type, In1DataType>(evalCtx, 1));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_COMP_MUL, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(matrixCompMult(getInputValue<In0Type, In0DataType>(evalCtx, 0), getInputValue<In1Type, In1DataType>(evalCtx, 1)));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(matrixCompMult(getInputValue<In0Type, In0DataType>(evalCtx, 0), getInputValue<In1Type, In1DataType>(evalCtx, 1)));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_UNARY_PLUS, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_NEGATION, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(negate(getInputValue<In0Type, In0DataType>(evalCtx, 0)));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(negate(getInputValue<In0Type, In0DataType>(evalCtx, 0)));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_PRE_INCREMENT, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              // modifying reduction: sum modified value too
+-              evalCtx.color.xyz() = reduceToVec3(increment(getInputValue<In0Type, In0DataType>(evalCtx, 0))) + reduceToVec3(increment(getInputValue<In0Type, In0DataType>(evalCtx, 0)));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        // modifying reduction: sum modified value too
++        evalCtx.color.xyz() = reduceToVec3(increment(getInputValue<In0Type, In0DataType>(evalCtx, 0))) + reduceToVec3(increment(getInputValue<In0Type, In0DataType>(evalCtx, 0)));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_PRE_DECREMENT, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              // modifying reduction: sum modified value too
+-              evalCtx.color.xyz() = reduceToVec3(decrement(getInputValue<In0Type, In0DataType>(evalCtx, 0))) + reduceToVec3(decrement(getInputValue<In0Type, In0DataType>(evalCtx, 0)));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        // modifying reduction: sum modified value too
++        evalCtx.color.xyz() = reduceToVec3(decrement(getInputValue<In0Type, In0DataType>(evalCtx, 0))) + reduceToVec3(decrement(getInputValue<In0Type, In0DataType>(evalCtx, 0)));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_POST_INCREMENT, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              // modifying reduction: sum modified value too
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0)) + reduceToVec3(increment(getInputValue<In0Type, In0DataType>(evalCtx, 0)));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        // modifying reduction: sum modified value too
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0)) + reduceToVec3(increment(getInputValue<In0Type, In0DataType>(evalCtx, 0)));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_POST_DECREMENT, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              // modifying reduction: sum modified value too
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0)) + reduceToVec3(decrement(getInputValue<In0Type, In0DataType>(evalCtx, 0)));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        // modifying reduction: sum modified value too
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0)) + reduceToVec3(decrement(getInputValue<In0Type, In0DataType>(evalCtx, 0)));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_ADD_INTO, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) + getInputValue<In1Type, In1DataType>(evalCtx, 1));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) + getInputValue<In1Type, In1DataType>(evalCtx, 1));
++    }
+ };
  
-+#elif defined(WL_EGL_PLATFORM)
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_SUBTRACT_FROM, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) - getInputValue<In1Type, In1DataType>(evalCtx, 1));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) - getInputValue<In1Type, In1DataType>(evalCtx, 1));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_MULTIPLY_INTO, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) * getInputValue<In1Type, In1DataType>(evalCtx, 1));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) * getInputValue<In1Type, In1DataType>(evalCtx, 1));
++    }
+ };
+ template <int In0Type, int In0DataType, int In1Type, int In1DataType>
+ struct Evaluator<OP_DIVIDE_INTO, In0Type, In0DataType, In1Type, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx)
+-      {
+-              evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) / getInputValue<In1Type, In1DataType>(evalCtx, 1));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx)
++    {
++        evalCtx.color.xyz() = reduceToVec3(getInputValue<In0Type, In0DataType>(evalCtx, 0) / getInputValue<In1Type, In1DataType>(evalCtx, 1));
++    }
+ };
+ ShaderEvalFunc getEvalFunc (const ShaderInput& in0, const ShaderInput& in1, MatrixOp op)
+ {
+-      DE_STATIC_ASSERT(TYPE_LAST              <= (1<<7));
+-      DE_STATIC_ASSERT(OP_LAST                <= (1<<4));
+-      DE_STATIC_ASSERT(INPUTTYPE_LAST <= (1<<2));
+-
+-#define PACK_EVAL_CASE(OP, IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)        (((OP) << 18) | ((IN0TYPE) << 16) | ((IN0DATATYPE) << 9) | ((IN1TYPE) << 7) | (IN1DATATYPE))
+-
+-#define MAKE_EVAL_CASE(OP, IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)                \
+-      case PACK_EVAL_CASE(OP, IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE):    \
+-              return Evaluator<OP, IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE>::evaluate
+-
+-#define SCALAR_OPS(IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)        \
+-      MAKE_EVAL_CASE(OP_ADD,          IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
+-      MAKE_EVAL_CASE(OP_SUB,          IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
+-      MAKE_EVAL_CASE(OP_MUL,          IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
+-      MAKE_EVAL_CASE(OP_DIV,          IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)
+-
+-#define ALL_OPS(IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)   \
+-      MAKE_EVAL_CASE(OP_ADD,                  IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
+-      MAKE_EVAL_CASE(OP_SUB,                  IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
+-      MAKE_EVAL_CASE(OP_MUL,                  IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
+-      MAKE_EVAL_CASE(OP_DIV,                  IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
+-      MAKE_EVAL_CASE(OP_COMP_MUL,             IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);
+-
+-#define MUL_OP(IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)    \
+-      MAKE_EVAL_CASE(OP_MUL, IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)
+-
+-#define MAKE_MAT_SCALAR_VEC_CASES(OP, TYPE0, TYPE1)                           \
+-      OP(INPUTTYPE_CONST,             TYPE0, INPUTTYPE_CONST,         TYPE1); \
+-      OP(INPUTTYPE_DYNAMIC,   TYPE0, INPUTTYPE_CONST,         TYPE1); \
+-      OP(INPUTTYPE_CONST,             TYPE0, INPUTTYPE_DYNAMIC,       TYPE1); \
+-      OP(INPUTTYPE_DYNAMIC,   TYPE0, INPUTTYPE_DYNAMIC,       TYPE1)
+-
+-#define MAKE_MAT_MAT_CASES(OP, MATTYPE)                                                               \
+-      OP(INPUTTYPE_CONST,             MATTYPE, INPUTTYPE_CONST,       MATTYPE);       \
+-      OP(INPUTTYPE_DYNAMIC,   MATTYPE, INPUTTYPE_CONST,       MATTYPE)
+-
+-#define UNARY_OP(IN0TYPE, IN0DATATYPE)                                                                                                                \
+-      MAKE_EVAL_CASE(OP_UNARY_PLUS,           IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST);      \
+-      MAKE_EVAL_CASE(OP_NEGATION,                     IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST);      \
+-      MAKE_EVAL_CASE(OP_PRE_INCREMENT,        IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST);      \
+-      MAKE_EVAL_CASE(OP_PRE_DECREMENT,        IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST);      \
+-      MAKE_EVAL_CASE(OP_POST_INCREMENT,       IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST);      \
+-      MAKE_EVAL_CASE(OP_POST_DECREMENT,       IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST)
+-
+-#define MAKE_UNARY_CASES(OP, MATTYPE) \
+-      OP(INPUTTYPE_CONST,             MATTYPE);       \
+-      OP(INPUTTYPE_DYNAMIC,   MATTYPE)
+-
+-#define ASSIGN_OP(IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)                                                 \
+-      MAKE_EVAL_CASE(OP_ADD_INTO,                     IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
+-      MAKE_EVAL_CASE(OP_SUBTRACT_FROM,        IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
+-      MAKE_EVAL_CASE(OP_MULTIPLY_INTO,        IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
+-      MAKE_EVAL_CASE(OP_DIVIDE_INTO,          IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)
+-
+-#define MAKE_ASSIGNMENT_CASES(OP, MATTYPE)                                            \
+-      OP(INPUTTYPE_CONST,             MATTYPE, INPUTTYPE_CONST,       MATTYPE);       \
+-      OP(INPUTTYPE_DYNAMIC,   MATTYPE, INPUTTYPE_CONST,       MATTYPE);       \
+-      OP(INPUTTYPE_CONST,             MATTYPE, INPUTTYPE_DYNAMIC,     MATTYPE);       \
+-      OP(INPUTTYPE_DYNAMIC,   MATTYPE, INPUTTYPE_DYNAMIC,     MATTYPE)
+-
+-      // \note At the moment there is no difference between uniform and const inputs. This saves binary size.
+-      InputType in0Type = in0.inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_DYNAMIC : INPUTTYPE_CONST;
+-      InputType in1Type = in1.inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_DYNAMIC : INPUTTYPE_CONST;
+-
+-      switch (PACK_EVAL_CASE(op, in0Type, in0.dataType, in1Type, in1.dataType))
+-      {
+-              // Matrix-scalar.
+-              MAKE_MAT_SCALAR_VEC_CASES(SCALAR_OPS,   TYPE_FLOAT_MAT2, TYPE_FLOAT);
+-              MAKE_MAT_SCALAR_VEC_CASES(SCALAR_OPS,   TYPE_FLOAT_MAT3, TYPE_FLOAT);
+-              MAKE_MAT_SCALAR_VEC_CASES(SCALAR_OPS,   TYPE_FLOAT_MAT4, TYPE_FLOAT);
+-
+-              // Matrix-vector.
+-              MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,               TYPE_FLOAT_MAT2, TYPE_FLOAT_VEC2);
+-              MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,               TYPE_FLOAT_MAT3, TYPE_FLOAT_VEC3);
+-              MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,               TYPE_FLOAT_MAT4, TYPE_FLOAT_VEC4);
+-
+-              // Vector-matrix.
+-              MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,               TYPE_FLOAT_VEC2, TYPE_FLOAT_MAT2);
+-              MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,               TYPE_FLOAT_VEC3, TYPE_FLOAT_MAT3);
+-              MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,               TYPE_FLOAT_VEC4, TYPE_FLOAT_MAT4);
+-
+-              // Matrix-matrix.
+-              MAKE_MAT_MAT_CASES(ALL_OPS,     TYPE_FLOAT_MAT2);
+-              MAKE_MAT_MAT_CASES(ALL_OPS,     TYPE_FLOAT_MAT3);
+-              MAKE_MAT_MAT_CASES(ALL_OPS,     TYPE_FLOAT_MAT4);
+-
+-              // Unary matrix
+-              MAKE_UNARY_CASES(UNARY_OP, TYPE_FLOAT_MAT2);
+-              MAKE_UNARY_CASES(UNARY_OP, TYPE_FLOAT_MAT3);
+-              MAKE_UNARY_CASES(UNARY_OP, TYPE_FLOAT_MAT4);
+-
+-              // Assignment matrix
+-              MAKE_ASSIGNMENT_CASES(ASSIGN_OP, TYPE_FLOAT_MAT2);
+-              MAKE_ASSIGNMENT_CASES(ASSIGN_OP, TYPE_FLOAT_MAT3);
+-              MAKE_ASSIGNMENT_CASES(ASSIGN_OP, TYPE_FLOAT_MAT4);
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-                      return DE_NULL;
+-      }
++    DE_STATIC_ASSERT(TYPE_LAST      <= (1<<7));
++    DE_STATIC_ASSERT(OP_LAST        <= (1<<4));
++    DE_STATIC_ASSERT(INPUTTYPE_LAST <= (1<<2));
 +
-+typedef struct wl_display    *EGLNativeDisplayType;
-+typedef struct wl_egl_pixmap *EGLNativePixmapType;
-+typedef struct wl_egl_window *EGLNativeWindowType;
++#define PACK_EVAL_CASE(OP, IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)  (((OP) << 18) | ((IN0TYPE) << 16) | ((IN0DATATYPE) << 9) | ((IN1TYPE) << 7) | (IN1DATATYPE))
 +
- #elif defined(__ANDROID__) || defined(ANDROID)
- #include <android/native_window.h>
-@@ -107,6 +113,8 @@ typedef intptr_t EGLNativePixmapType;
++#define MAKE_EVAL_CASE(OP, IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)      \
++    case PACK_EVAL_CASE(OP, IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE):    \
++        return Evaluator<OP, IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE>::evaluate
++
++#define SCALAR_OPS(IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)  \
++    MAKE_EVAL_CASE(OP_ADD,      IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
++    MAKE_EVAL_CASE(OP_SUB,      IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
++    MAKE_EVAL_CASE(OP_MUL,      IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
++    MAKE_EVAL_CASE(OP_DIV,      IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)
++
++#define ALL_OPS(IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE) \
++    MAKE_EVAL_CASE(OP_ADD,          IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
++    MAKE_EVAL_CASE(OP_SUB,          IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
++    MAKE_EVAL_CASE(OP_MUL,          IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
++    MAKE_EVAL_CASE(OP_DIV,          IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
++    MAKE_EVAL_CASE(OP_COMP_MUL,     IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);
++
++#define MUL_OP(IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)  \
++    MAKE_EVAL_CASE(OP_MUL, IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)
++
++#define MAKE_MAT_SCALAR_VEC_CASES(OP, TYPE0, TYPE1)             \
++    OP(INPUTTYPE_CONST,     TYPE0, INPUTTYPE_CONST,     TYPE1); \
++    OP(INPUTTYPE_DYNAMIC,   TYPE0, INPUTTYPE_CONST,     TYPE1); \
++    OP(INPUTTYPE_CONST,     TYPE0, INPUTTYPE_DYNAMIC,   TYPE1); \
++    OP(INPUTTYPE_DYNAMIC,   TYPE0, INPUTTYPE_DYNAMIC,   TYPE1)
++
++#define MAKE_MAT_MAT_CASES(OP, MATTYPE)                             \
++    OP(INPUTTYPE_CONST,     MATTYPE, INPUTTYPE_CONST,   MATTYPE);   \
++    OP(INPUTTYPE_DYNAMIC,   MATTYPE, INPUTTYPE_CONST,   MATTYPE)
++
++#define UNARY_OP(IN0TYPE, IN0DATATYPE)                                                      \
++    MAKE_EVAL_CASE(OP_UNARY_PLUS,       IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST);  \
++    MAKE_EVAL_CASE(OP_NEGATION,         IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST);  \
++    MAKE_EVAL_CASE(OP_PRE_INCREMENT,    IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST);  \
++    MAKE_EVAL_CASE(OP_PRE_DECREMENT,    IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST);  \
++    MAKE_EVAL_CASE(OP_POST_INCREMENT,   IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST);  \
++    MAKE_EVAL_CASE(OP_POST_DECREMENT,   IN0TYPE, IN0DATATYPE, INPUTTYPE_CONST, TYPE_LAST)
++
++#define MAKE_UNARY_CASES(OP, MATTYPE)   \
++    OP(INPUTTYPE_CONST,     MATTYPE);   \
++    OP(INPUTTYPE_DYNAMIC,   MATTYPE)
++
++#define ASSIGN_OP(IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)                           \
++    MAKE_EVAL_CASE(OP_ADD_INTO,         IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
++    MAKE_EVAL_CASE(OP_SUBTRACT_FROM,    IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
++    MAKE_EVAL_CASE(OP_MULTIPLY_INTO,    IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE);    \
++    MAKE_EVAL_CASE(OP_DIVIDE_INTO,      IN0TYPE, IN0DATATYPE, IN1TYPE, IN1DATATYPE)
++
++#define MAKE_ASSIGNMENT_CASES(OP, MATTYPE)                      \
++    OP(INPUTTYPE_CONST,     MATTYPE, INPUTTYPE_CONST,   MATTYPE);   \
++    OP(INPUTTYPE_DYNAMIC,   MATTYPE, INPUTTYPE_CONST,   MATTYPE);   \
++    OP(INPUTTYPE_CONST,     MATTYPE, INPUTTYPE_DYNAMIC, MATTYPE);   \
++    OP(INPUTTYPE_DYNAMIC,   MATTYPE, INPUTTYPE_DYNAMIC, MATTYPE)
++
++    // \note At the moment there is no difference between uniform and const inputs. This saves binary size.
++    InputType in0Type = in0.inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_DYNAMIC : INPUTTYPE_CONST;
++    InputType in1Type = in1.inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_DYNAMIC : INPUTTYPE_CONST;
++
++    switch (PACK_EVAL_CASE(op, in0Type, in0.dataType, in1Type, in1.dataType))
++    {
++        // Matrix-scalar.
++        MAKE_MAT_SCALAR_VEC_CASES(SCALAR_OPS,   TYPE_FLOAT_MAT2, TYPE_FLOAT);
++        MAKE_MAT_SCALAR_VEC_CASES(SCALAR_OPS,   TYPE_FLOAT_MAT3, TYPE_FLOAT);
++        MAKE_MAT_SCALAR_VEC_CASES(SCALAR_OPS,   TYPE_FLOAT_MAT4, TYPE_FLOAT);
++
++        // Matrix-vector.
++        MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,       TYPE_FLOAT_MAT2, TYPE_FLOAT_VEC2);
++        MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,       TYPE_FLOAT_MAT3, TYPE_FLOAT_VEC3);
++        MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,       TYPE_FLOAT_MAT4, TYPE_FLOAT_VEC4);
++
++        // Vector-matrix.
++        MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,       TYPE_FLOAT_VEC2, TYPE_FLOAT_MAT2);
++        MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,       TYPE_FLOAT_VEC3, TYPE_FLOAT_MAT3);
++        MAKE_MAT_SCALAR_VEC_CASES(MUL_OP,       TYPE_FLOAT_VEC4, TYPE_FLOAT_MAT4);
++
++        // Matrix-matrix.
++        MAKE_MAT_MAT_CASES(ALL_OPS, TYPE_FLOAT_MAT2);
++        MAKE_MAT_MAT_CASES(ALL_OPS, TYPE_FLOAT_MAT3);
++        MAKE_MAT_MAT_CASES(ALL_OPS, TYPE_FLOAT_MAT4);
++
++        // Unary matrix
++        MAKE_UNARY_CASES(UNARY_OP, TYPE_FLOAT_MAT2);
++        MAKE_UNARY_CASES(UNARY_OP, TYPE_FLOAT_MAT3);
++        MAKE_UNARY_CASES(UNARY_OP, TYPE_FLOAT_MAT4);
++
++        // Assignment matrix
++        MAKE_ASSIGNMENT_CASES(ASSIGN_OP, TYPE_FLOAT_MAT2);
++        MAKE_ASSIGNMENT_CASES(ASSIGN_OP, TYPE_FLOAT_MAT3);
++        MAKE_ASSIGNMENT_CASES(ASSIGN_OP, TYPE_FLOAT_MAT4);
++
++        default:
++            DE_ASSERT(DE_FALSE);
++            return DE_NULL;
++    }
  
- #elif defined(__unix__)
+ #undef PACK_EVAL_CASE
+ #undef MAKE_EVAL_CASE
+@@ -701,35 +701,35 @@ ShaderEvalFunc getEvalFunc (const ShaderInput& in0, const ShaderInput& in1, Matr
+ template <int Size>
+ void writeVectorConstructor (std::ostream& str, const tcu::Vector<float, Size>& v)
+ {
+-      str << "vec" << Size << "(";
+-      for (int ndx = 0; ndx < Size; ndx++)
+-      {
+-              if (ndx != 0)
+-                      str << ", ";
+-              str << de::floatToString(v[ndx], 1);
+-      }
+-      str << ")";
++    str << "vec" << Size << "(";
++    for (int ndx = 0; ndx < Size; ndx++)
++    {
++        if (ndx != 0)
++            str << ", ";
++        str << de::floatToString(v[ndx], 1);
++    }
++    str << ")";
+ }
  
-+#if defined(ANGLE_USE_X11) && !defined(MESA_EGL_NO_X11_HEADERS)
+ template <int Cols, int Rows>
+ void writeMatrixConstructor (std::ostream& str, const tcu::Matrix<float, Rows, Cols>& m)
+ {
+-      if (Rows == Cols)
+-              str << "mat" << Cols;
+-      else
+-              str << "mat" << Cols << "x" << Rows;
+-
+-      str << "(";
+-      for (int colNdx = 0; colNdx < Cols; colNdx++)
+-      {
+-              for (int rowNdx = 0; rowNdx < Rows; rowNdx++)
+-              {
+-                      if (rowNdx > 0 || colNdx > 0)
+-                              str << ", ";
+-                      str << de::floatToString(m(rowNdx, colNdx), 1);
+-              }
+-      }
+-      str << ")";
++    if (Rows == Cols)
++        str << "mat" << Cols;
++    else
++        str << "mat" << Cols << "x" << Rows;
 +
- /* X11 (tentative)  */
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
-@@ -116,6 +124,14 @@ typedef Pixmap   EGLNativePixmapType;
- typedef Window   EGLNativeWindowType;
++    str << "(";
++    for (int colNdx = 0; colNdx < Cols; colNdx++)
++    {
++        for (int rowNdx = 0; rowNdx < Rows; rowNdx++)
++        {
++            if (rowNdx > 0 || colNdx > 0)
++                str << ", ";
++            str << de::floatToString(m(rowNdx, colNdx), 1);
++        }
++    }
++    str << ")";
+ }
  
- #else
+ } // MatrixCaseUtils
+@@ -739,26 +739,26 @@ using namespace MatrixCaseUtils;
+ class ShaderMatrixCase : public ShaderRenderCase
+ {
+ public:
+-                                      ShaderMatrixCase                        (Context& context, const char* name, const char* desc, const ShaderInput& in0, const ShaderInput& in1, MatrixOp op, bool isVertexCase);
+-                                      ~ShaderMatrixCase                       (void);
++                    ShaderMatrixCase            (Context& context, const char* name, const char* desc, const ShaderInput& in0, const ShaderInput& in1, MatrixOp op, bool isVertexCase);
++                    ~ShaderMatrixCase           (void);
+-      void                    init                                            (void);
++    void            init                        (void);
+ protected:
+-      std::string             genGLSLMatToVec3Reduction       (const glu::DataType& matType, const char* varName);
+-      void                    setupUniforms                           (int programID, const tcu::Vec4& constCoords);
++    std::string     genGLSLMatToVec3Reduction   (const glu::DataType& matType, const char* varName);
++    void            setupUniforms               (int programID, const tcu::Vec4& constCoords);
+ private:
+-      ShaderInput             m_in0;
+-      ShaderInput             m_in1;
+-      MatrixOp                m_op;
++    ShaderInput     m_in0;
++    ShaderInput     m_in1;
++    MatrixOp        m_op;
+ };
+ ShaderMatrixCase::ShaderMatrixCase (Context& context, const char* name, const char* desc, const ShaderInput& in0, const ShaderInput& in1, MatrixOp op, bool isVertexCase)
+-      : ShaderRenderCase      (context.getTestContext(), context.getRenderContext(), context.getContextInfo(), name, desc, isVertexCase, getEvalFunc(in0, in1, op))
+-      , m_in0                         (in0)
+-      , m_in1                         (in1)
+-      , m_op                          (op)
++    : ShaderRenderCase  (context.getTestContext(), context.getRenderContext(), context.getContextInfo(), name, desc, isVertexCase, getEvalFunc(in0, in1, op))
++    , m_in0             (in0)
++    , m_in1             (in1)
++    , m_op              (op)
+ {
+ }
+@@ -768,315 +768,315 @@ ShaderMatrixCase::~ShaderMatrixCase (void)
+ void ShaderMatrixCase::init (void)
+ {
+-      std::ostringstream      vtx;
+-      std::ostringstream      frag;
+-      std::ostringstream&     op                              = m_isVertexCase ? vtx : frag;
+-
+-      bool                            isInDynMat0             = isDataTypeMatrix(m_in0.dataType) && m_in0.inputType == INPUTTYPE_DYNAMIC;
+-      bool                            isInDynMat1             = isDataTypeMatrix(m_in1.dataType) && m_in1.inputType == INPUTTYPE_DYNAMIC;
+-      string                          inValue0;
+-      string                          inValue1;
+-      DataType                        resultType              = TYPE_LAST;
+-      Precision                       resultPrec              = m_in0.precision;
+-      vector<string>          passVars;
+-      int                                     numInputs               = (isOperationBinary(m_op)) ? (2) : (1);
+-
+-      std::string                     operationValue0;
+-      std::string                     operationValue1;
+-
+-      DE_ASSERT(!isInDynMat0 || !isInDynMat1); // Only single dynamic matrix input is allowed.
+-      DE_UNREF(isInDynMat0 && isInDynMat1);
+-
+-      // Compute result type.
+-      if (isDataTypeMatrix(m_in0.dataType) && isDataTypeMatrix(m_in1.dataType))
+-      {
+-              DE_ASSERT(m_in0.dataType == m_in1.dataType);
+-              resultType = m_in0.dataType;
+-      }
+-      else if (getOperationType(m_op) == OPERATIONTYPE_UNARY_PREFIX_OPERATOR ||
+-                       getOperationType(m_op) == OPERATIONTYPE_UNARY_POSTFIX_OPERATOR)
+-      {
+-              resultType = m_in0.dataType;
+-      }
+-      else
+-      {
+-              int                     matNdx          = isDataTypeMatrix(m_in0.dataType) ? 0 : 1;
+-              DataType        matrixType      = matNdx == 0 ? m_in0.dataType : m_in1.dataType;
+-              DataType        otherType       = matNdx == 0 ? m_in1.dataType : m_in0.dataType;
+-
+-              if (otherType == TYPE_FLOAT)
+-                      resultType = matrixType;
+-              else
+-              {
+-                      DE_ASSERT(isDataTypeVector(otherType));
+-                      resultType = otherType;
+-              }
+-      }
+-
+-      vtx << "attribute highp vec4 a_position;\n";
+-      if (m_isVertexCase)
+-      {
+-              vtx << "varying mediump vec4 v_color;\n";
+-              frag << "varying mediump vec4 v_color;\n";
+-      }
+-
+-      // Input declarations.
+-      for (int inNdx = 0; inNdx < numInputs; inNdx++)
+-      {
+-              const ShaderInput&      in                      = inNdx > 0 ? m_in1 : m_in0;
+-              const char*                     precName        = getPrecisionName(in.precision);
+-              const char*                     typeName        = getDataTypeName(in.dataType);
+-              string&                         inValue         = inNdx > 0 ? inValue1 : inValue0;
+-
+-              if (in.inputType == INPUTTYPE_DYNAMIC)
+-              {
+-                      vtx << "attribute " << precName << " " << typeName << " a_";
+-
+-                      if (isDataTypeMatrix(in.dataType))
+-                      {
+-                              // a_matN, v_matN
+-                              vtx << typeName << ";\n";
+-                              if (!m_isVertexCase)
+-                              {
+-                                      vtx << "varying " << precName << " " << typeName << " v_" << typeName << ";\n";
+-                                      frag << "varying " << precName << " " << typeName << " v_" << typeName << ";\n";
+-                                      passVars.push_back(typeName);
+-                              }
+-
+-                              inValue = string(m_isVertexCase ? "a_" : "v_") + getDataTypeName(in.dataType);
+-                      }
+-                      else
+-                      {
+-                              // a_coords, v_coords
+-                              vtx << "coords;\n";
+-                              if (!m_isVertexCase)
+-                              {
+-                                      vtx << "varying " << precName << " " << typeName << " v_coords;\n";
+-                                      frag << "varying " << precName << " " << typeName << " v_coords;\n";
+-                                      passVars.push_back("coords");
+-                              }
+-
+-                              inValue = m_isVertexCase ? "a_coords" : "v_coords";
+-                      }
+-              }
+-              else if (in.inputType == INPUTTYPE_UNIFORM)
+-              {
+-                      op << "uniform " << precName << " " << typeName << " u_in" << inNdx << ";\n";
+-                      inValue = string("u_in") + de::toString(inNdx);
+-              }
+-              else if (in.inputType == INPUTTYPE_CONST)
+-              {
+-                      op << "const " << precName << " " << typeName << " in" << inNdx << " = ";
+-
+-                      // Generate declaration.
+-                      switch (in.dataType)
+-                      {
+-                              case TYPE_FLOAT:                op << de::floatToString(s_constInFloat[inNdx], 1);                                      break;
+-                              case TYPE_FLOAT_VEC2:   writeVectorConstructor<2>(op, s_constInVec2[inNdx]);                            break;
+-                              case TYPE_FLOAT_VEC3:   writeVectorConstructor<3>(op, s_constInVec3[inNdx]);                            break;
+-                              case TYPE_FLOAT_VEC4:   writeVectorConstructor<4>(op, s_constInVec4[inNdx]);                            break;
+-                              case TYPE_FLOAT_MAT2:   writeMatrixConstructor<2, 2>(op, Mat2(s_constInMat2[inNdx]));           break;
+-                              case TYPE_FLOAT_MAT3:   writeMatrixConstructor<3, 3>(op, Mat3(s_constInMat3[inNdx]));           break;
+-                              case TYPE_FLOAT_MAT4:   writeMatrixConstructor<4, 4>(op, Mat4(s_constInMat4[inNdx]));           break;
+-
+-                              default:
+-                                      DE_ASSERT(DE_FALSE);
+-                      }
+-
+-                      op << ";\n";
+-
+-                      inValue = string("in") + de::toString(inNdx);
+-              }
+-      }
+-
+-      vtx << "\n"
+-              << "void main (void)\n"
+-              << "{\n"
+-              << "    gl_Position = a_position;\n";
+-      frag << "\n"
+-               << "void main (void)\n"
+-               << "{\n";
+-
+-      if (m_isVertexCase)
+-      {
+-              frag << "       gl_FragColor = v_color;\n";
+-      }
+-      else
+-      {
+-              for (vector<string>::const_iterator copyIter = passVars.begin(); copyIter != passVars.end(); copyIter++)
+-                      vtx << "        v_" << *copyIter << " = " << "a_" << *copyIter << ";\n";
+-      }
+-
+-      // Operation.
+-
+-      switch (getOperationNature(m_op))
+-      {
+-              case OPERATIONNATURE_PURE:
+-                      DE_ASSERT(getOperationType(m_op) != OPERATIONTYPE_ASSIGNMENT);
+-
+-                      operationValue0 = inValue0;
+-                      operationValue1 = inValue1;
+-                      break;
+-
+-              case OPERATIONNATURE_MUTATING:
+-                      DE_ASSERT(getOperationType(m_op) != OPERATIONTYPE_ASSIGNMENT);
+-
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " tmpValue = " << inValue0 << ";\n";
+-
+-                      operationValue0 = "tmpValue";
+-                      operationValue1 = inValue1;
+-                      break;
+-
+-              case OPERATIONNATURE_ASSIGNMENT:
+-                      DE_ASSERT(getOperationType(m_op) == OPERATIONTYPE_ASSIGNMENT);
+-
+-                      operationValue0 = inValue0;
+-                      operationValue1 = inValue1;
+-                      break;
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-      }
+-
+-      switch (getOperationType(m_op))
+-      {
+-              case OPERATIONTYPE_BINARY_OPERATOR:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << " " << getOperationName(m_op) << " " << operationValue1 << ";\n";
+-                      break;
+-
+-              case OPERATIONTYPE_UNARY_PREFIX_OPERATOR:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << getOperationName(m_op) << operationValue0 << ";\n";
+-                      break;
+-
+-              case OPERATIONTYPE_UNARY_POSTFIX_OPERATOR:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << getOperationName(m_op) << ";\n";
+-                      break;
+-
+-              case OPERATIONTYPE_BINARY_FUNCTION:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << getOperationName(m_op) << "(" << operationValue0 << ", " << operationValue1 << ");\n";
+-                      break;
+-
+-              case OPERATIONTYPE_ASSIGNMENT:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << ";\n";
+-                      op << " res " << getOperationName(m_op) << " " << operationValue1 << ";\n";
+-                      break;
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-      }
+-
+-      // Reduction to vec3 (rgb). Check the used value too if it was modified.
+-      op << " " << (m_isVertexCase ? "v_color" : "gl_FragColor") << " = ";
+-
+-      if (isOperationValueModifying(m_op))
+-              op << "vec4(" << genGLSLMatToVec3Reduction(resultType, "res") << ", 1.0) + vec4(" << genGLSLMatToVec3Reduction(resultType, "tmpValue") << ", 0.0);\n";
+-      else
+-              op << "vec4(" << genGLSLMatToVec3Reduction(resultType, "res") << ", 1.0);\n";
+-
+-      vtx << "}\n";
+-      frag << "}\n";
+-
+-      m_vertShaderSource      = vtx.str();
+-      m_fragShaderSource      = frag.str();
+-
+-      // \todo [2012-02-14 pyry] Compute better values for matrix tests.
+-      m_userAttribTransforms.resize(4);
+-      for (int attribNdx = 0; attribNdx < 4; attribNdx++)
+-      {
+-              m_userAttribTransforms[attribNdx] = Mat4(0.0f);
+-              m_userAttribTransforms[attribNdx]((0 + attribNdx) % 4, 0) = 1.0f;
+-              m_userAttribTransforms[attribNdx]((1 + attribNdx) % 4, 1) = 1.0f;
+-              m_userAttribTransforms[attribNdx]((2 + attribNdx) % 4, 2) = 1.0f;
+-              m_userAttribTransforms[attribNdx]((3 + attribNdx) % 4, 3) = 1.0f;
+-      }
+-
+-      // prevent bad reference cases such as black result images by fine-tuning used matrices
+-      if (getOperationTestMatrixType(m_op) != TESTMATRIXTYPE_DEFAULT)
+-      {
+-              for (int attribNdx = 0; attribNdx < 4; attribNdx++)
+-              {
+-                      for (int row = 0; row < 4; row++)
+-                      for (int col = 0; col < 4; col++)
+-                      {
+-                              switch (getOperationTestMatrixType(m_op))
+-                              {
+-                                      case TESTMATRIXTYPE_NEGATED:
+-                                              m_userAttribTransforms[attribNdx](row, col) = -m_userAttribTransforms[attribNdx](row, col);
+-                                              break;
+-                                      case TESTMATRIXTYPE_INCREMENTED:
+-                                              m_userAttribTransforms[attribNdx](row, col) += 0.3f;
+-                                              break;
+-                                      case TESTMATRIXTYPE_DECREMENTED:
+-                                              m_userAttribTransforms[attribNdx](row, col) -= 0.1f;
+-                                              break;
+-
+-                                      default:
+-                                              DE_ASSERT(DE_FALSE);
+-                                              break;
+-                              }
+-                      }
+-              }
+-      }
+-
+-      ShaderRenderCase::init();
++    std::ostringstream  vtx;
++    std::ostringstream  frag;
++    std::ostringstream& op              = m_isVertexCase ? vtx : frag;
 +
-+typedef void             *EGLNativeDisplayType;
-+typedef khronos_uintptr_t EGLNativePixmapType;
-+typedef khronos_uintptr_t EGLNativeWindowType;
++    bool                isInDynMat0     = isDataTypeMatrix(m_in0.dataType) && m_in0.inputType == INPUTTYPE_DYNAMIC;
++    bool                isInDynMat1     = isDataTypeMatrix(m_in1.dataType) && m_in1.inputType == INPUTTYPE_DYNAMIC;
++    string              inValue0;
++    string              inValue1;
++    DataType            resultType      = TYPE_LAST;
++    Precision           resultPrec      = m_in0.precision;
++    vector<string>      passVars;
++    int                 numInputs       = (isOperationBinary(m_op)) ? (2) : (1);
 +
-+#endif /* ANGLE_USE_X11 && !MESA_EGL_NO_X11_HEADERS */
++    std::string         operationValue0;
++    std::string         operationValue1;
 +
-+#else
- #error "Platform not recognized"
- #endif
++    DE_ASSERT(!isInDynMat0 || !isInDynMat1); // Only single dynamic matrix input is allowed.
++    DE_UNREF(isInDynMat0 && isInDynMat1);
++
++    // Compute result type.
++    if (isDataTypeMatrix(m_in0.dataType) && isDataTypeMatrix(m_in1.dataType))
++    {
++        DE_ASSERT(m_in0.dataType == m_in1.dataType);
++        resultType = m_in0.dataType;
++    }
++    else if (getOperationType(m_op) == OPERATIONTYPE_UNARY_PREFIX_OPERATOR ||
++             getOperationType(m_op) == OPERATIONTYPE_UNARY_POSTFIX_OPERATOR)
++    {
++        resultType = m_in0.dataType;
++    }
++    else
++    {
++        int         matNdx      = isDataTypeMatrix(m_in0.dataType) ? 0 : 1;
++        DataType    matrixType  = matNdx == 0 ? m_in0.dataType : m_in1.dataType;
++        DataType    otherType   = matNdx == 0 ? m_in1.dataType : m_in0.dataType;
++
++        if (otherType == TYPE_FLOAT)
++            resultType = matrixType;
++        else
++        {
++            DE_ASSERT(isDataTypeVector(otherType));
++            resultType = otherType;
++        }
++    }
++
++    vtx << "attribute highp vec4 a_position;\n";
++    if (m_isVertexCase)
++    {
++        vtx << "varying mediump vec4 v_color;\n";
++        frag << "varying mediump vec4 v_color;\n";
++    }
++
++    // Input declarations.
++    for (int inNdx = 0; inNdx < numInputs; inNdx++)
++    {
++        const ShaderInput&  in          = inNdx > 0 ? m_in1 : m_in0;
++        const char*         precName    = getPrecisionName(in.precision);
++        const char*         typeName    = getDataTypeName(in.dataType);
++        string&             inValue     = inNdx > 0 ? inValue1 : inValue0;
++
++        if (in.inputType == INPUTTYPE_DYNAMIC)
++        {
++            vtx << "attribute " << precName << " " << typeName << " a_";
++
++            if (isDataTypeMatrix(in.dataType))
++            {
++                // a_matN, v_matN
++                vtx << typeName << ";\n";
++                if (!m_isVertexCase)
++                {
++                    vtx << "varying " << precName << " " << typeName << " v_" << typeName << ";\n";
++                    frag << "varying " << precName << " " << typeName << " v_" << typeName << ";\n";
++                    passVars.push_back(typeName);
++                }
++
++                inValue = string(m_isVertexCase ? "a_" : "v_") + getDataTypeName(in.dataType);
++            }
++            else
++            {
++                // a_coords, v_coords
++                vtx << "coords;\n";
++                if (!m_isVertexCase)
++                {
++                    vtx << "varying " << precName << " " << typeName << " v_coords;\n";
++                    frag << "varying " << precName << " " << typeName << " v_coords;\n";
++                    passVars.push_back("coords");
++                }
++
++                inValue = m_isVertexCase ? "a_coords" : "v_coords";
++            }
++        }
++        else if (in.inputType == INPUTTYPE_UNIFORM)
++        {
++            op << "uniform " << precName << " " << typeName << " u_in" << inNdx << ";\n";
++            inValue = string("u_in") + de::toString(inNdx);
++        }
++        else if (in.inputType == INPUTTYPE_CONST)
++        {
++            op << "const " << precName << " " << typeName << " in" << inNdx << " = ";
++
++            // Generate declaration.
++            switch (in.dataType)
++            {
++                case TYPE_FLOAT:        op << de::floatToString(s_constInFloat[inNdx], 1);                  break;
++                case TYPE_FLOAT_VEC2:   writeVectorConstructor<2>(op, s_constInVec2[inNdx]);                break;
++                case TYPE_FLOAT_VEC3:   writeVectorConstructor<3>(op, s_constInVec3[inNdx]);                break;
++                case TYPE_FLOAT_VEC4:   writeVectorConstructor<4>(op, s_constInVec4[inNdx]);                break;
++                case TYPE_FLOAT_MAT2:   writeMatrixConstructor<2, 2>(op, Mat2(s_constInMat2[inNdx]));       break;
++                case TYPE_FLOAT_MAT3:   writeMatrixConstructor<3, 3>(op, Mat3(s_constInMat3[inNdx]));       break;
++                case TYPE_FLOAT_MAT4:   writeMatrixConstructor<4, 4>(op, Mat4(s_constInMat4[inNdx]));       break;
++
++                default:
++                    DE_ASSERT(DE_FALSE);
++            }
++
++            op << ";\n";
++
++            inValue = string("in") + de::toString(inNdx);
++        }
++    }
++
++    vtx << "\n"
++        << "void main (void)\n"
++        << "{\n"
++        << "    gl_Position = a_position;\n";
++    frag << "\n"
++         << "void main (void)\n"
++         << "{\n";
++
++    if (m_isVertexCase)
++    {
++        frag << "   gl_FragColor = v_color;\n";
++    }
++    else
++    {
++        for (vector<string>::const_iterator copyIter = passVars.begin(); copyIter != passVars.end(); copyIter++)
++            vtx << "    v_" << *copyIter << " = " << "a_" << *copyIter << ";\n";
++    }
++
++    // Operation.
++
++    switch (getOperationNature(m_op))
++    {
++        case OPERATIONNATURE_PURE:
++            DE_ASSERT(getOperationType(m_op) != OPERATIONTYPE_ASSIGNMENT);
++
++            operationValue0 = inValue0;
++            operationValue1 = inValue1;
++            break;
++
++        case OPERATIONNATURE_MUTATING:
++            DE_ASSERT(getOperationType(m_op) != OPERATIONTYPE_ASSIGNMENT);
++
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " tmpValue = " << inValue0 << ";\n";
++
++            operationValue0 = "tmpValue";
++            operationValue1 = inValue1;
++            break;
++
++        case OPERATIONNATURE_ASSIGNMENT:
++            DE_ASSERT(getOperationType(m_op) == OPERATIONTYPE_ASSIGNMENT);
++
++            operationValue0 = inValue0;
++            operationValue1 = inValue1;
++            break;
++
++        default:
++            DE_ASSERT(DE_FALSE);
++    }
++
++    switch (getOperationType(m_op))
++    {
++        case OPERATIONTYPE_BINARY_OPERATOR:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << " " << getOperationName(m_op) << " " << operationValue1 << ";\n";
++            break;
++
++        case OPERATIONTYPE_UNARY_PREFIX_OPERATOR:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << getOperationName(m_op) << operationValue0 << ";\n";
++            break;
++
++        case OPERATIONTYPE_UNARY_POSTFIX_OPERATOR:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << getOperationName(m_op) << ";\n";
++            break;
++
++        case OPERATIONTYPE_BINARY_FUNCTION:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << getOperationName(m_op) << "(" << operationValue0 << ", " << operationValue1 << ");\n";
++            break;
++
++        case OPERATIONTYPE_ASSIGNMENT:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << ";\n";
++            op << " res " << getOperationName(m_op) << " " << operationValue1 << ";\n";
++            break;
++
++        default:
++            DE_ASSERT(DE_FALSE);
++    }
++
++    // Reduction to vec3 (rgb). Check the used value too if it was modified.
++    op << " " << (m_isVertexCase ? "v_color" : "gl_FragColor") << " = ";
++
++    if (isOperationValueModifying(m_op))
++        op << "vec4(" << genGLSLMatToVec3Reduction(resultType, "res") << ", 1.0) + vec4(" << genGLSLMatToVec3Reduction(resultType, "tmpValue") << ", 0.0);\n";
++    else
++        op << "vec4(" << genGLSLMatToVec3Reduction(resultType, "res") << ", 1.0);\n";
++
++    vtx << "}\n";
++    frag << "}\n";
++
++    m_vertShaderSource  = vtx.str();
++    m_fragShaderSource  = frag.str();
++
++    // \todo [2012-02-14 pyry] Compute better values for matrix tests.
++    m_userAttribTransforms.resize(4);
++    for (int attribNdx = 0; attribNdx < 4; attribNdx++)
++    {
++        m_userAttribTransforms[attribNdx] = Mat4(0.0f);
++        m_userAttribTransforms[attribNdx]((0 + attribNdx) % 4, 0) = 1.0f;
++        m_userAttribTransforms[attribNdx]((1 + attribNdx) % 4, 1) = 1.0f;
++        m_userAttribTransforms[attribNdx]((2 + attribNdx) % 4, 2) = 1.0f;
++        m_userAttribTransforms[attribNdx]((3 + attribNdx) % 4, 3) = 1.0f;
++    }
++
++    // prevent bad reference cases such as black result images by fine-tuning used matrices
++    if (getOperationTestMatrixType(m_op) != TESTMATRIXTYPE_DEFAULT)
++    {
++        for (int attribNdx = 0; attribNdx < 4; attribNdx++)
++        {
++            for (int row = 0; row < 4; row++)
++            for (int col = 0; col < 4; col++)
++            {
++                switch (getOperationTestMatrixType(m_op))
++                {
++                    case TESTMATRIXTYPE_NEGATED:
++                        m_userAttribTransforms[attribNdx](row, col) = -m_userAttribTransforms[attribNdx](row, col);
++                        break;
++                    case TESTMATRIXTYPE_INCREMENTED:
++                        m_userAttribTransforms[attribNdx](row, col) += 0.3f;
++                        break;
++                    case TESTMATRIXTYPE_DECREMENTED:
++                        m_userAttribTransforms[attribNdx](row, col) -= 0.1f;
++                        break;
++
++                    default:
++                        DE_ASSERT(DE_FALSE);
++                        break;
++                }
++            }
++        }
++    }
++
++    ShaderRenderCase::init();
+ }
+ std::string ShaderMatrixCase::genGLSLMatToVec3Reduction (const glu::DataType& matType, const char* varName)
+ {
+-      std::ostringstream op;
+-
+-      switch (matType)
+-      {
+-              case TYPE_FLOAT:                op << varName << ", "           << varName << ", "                      << varName << "";                                                                               break;
+-              case TYPE_FLOAT_VEC2:   op << varName << ".x, "         << varName << ".y, "            << varName << ".x";                                                                             break;
+-              case TYPE_FLOAT_VEC3:   op << varName << "";                                                                                                                                                                                    break;
+-              case TYPE_FLOAT_VEC4:   op << varName << ".x, "         << varName << ".y, "            << varName << ".z+"                     << varName << ".w";                     break;
+-              case TYPE_FLOAT_MAT2:   op << varName << "[0][0], "     << varName << "[1][0], "        << varName << "[0][1]+"         << varName << "[1][1]";         break;
+-              case TYPE_FLOAT_MAT3:   op << varName << "[0]+"         << varName << "[1]+"            << varName << "[2]";                                                                    break;
+-              case TYPE_FLOAT_MAT4:   op << varName << "[0].xyz+"     << varName << "[1].yzw+"        << varName << "[2].zwx+"        << varName << "[3].wxy";        break;
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-      }
+-
+-      return op.str();
++    std::ostringstream op;
++
++    switch (matType)
++    {
++        case TYPE_FLOAT:        op << varName << ", "       << varName << ", "          << varName << "";                                       break;
++        case TYPE_FLOAT_VEC2:   op << varName << ".x, "     << varName << ".y, "        << varName << ".x";                                     break;
++        case TYPE_FLOAT_VEC3:   op << varName << "";                                                                                            break;
++        case TYPE_FLOAT_VEC4:   op << varName << ".x, "     << varName << ".y, "        << varName << ".z+"         << varName << ".w";         break;
++        case TYPE_FLOAT_MAT2:   op << varName << "[0][0], " << varName << "[1][0], "    << varName << "[0][1]+"     << varName << "[1][1]";     break;
++        case TYPE_FLOAT_MAT3:   op << varName << "[0]+"     << varName << "[1]+"        << varName << "[2]";                                    break;
++        case TYPE_FLOAT_MAT4:   op << varName << "[0].xyz+" << varName << "[1].yzw+"    << varName << "[2].zwx+"    << varName << "[3].wxy";    break;
++
++        default:
++            DE_ASSERT(DE_FALSE);
++    }
++
++    return op.str();
+ }
+ void ShaderMatrixCase::setupUniforms (int programID, const tcu::Vec4& constCoords)
+ {
+-      const glw::Functions& gl = m_renderCtx.getFunctions();
+-
+-      DE_UNREF(constCoords);
+-
+-      for (int inNdx = 0; inNdx < 2; inNdx++)
+-      {
+-              const ShaderInput& in = inNdx > 0 ? m_in1 : m_in0;
+-
+-              if (in.inputType == INPUTTYPE_UNIFORM)
+-              {
+-                      int loc = gl.getUniformLocation(programID, (string("u_in") + de::toString(inNdx)).c_str());
+-
+-                      if (loc < 0)
+-                              continue;
+-
+-                      switch (in.dataType)
+-                      {
+-                              case TYPE_FLOAT:                gl.uniform1f(loc, s_constInFloat[inNdx]);                                                                                                       break;
+-                              case TYPE_FLOAT_VEC2:   gl.uniform2fv(loc, 1, s_constInVec2[inNdx].getPtr());                                                                           break;
+-                              case TYPE_FLOAT_VEC3:   gl.uniform3fv(loc, 1, s_constInVec3[inNdx].getPtr());                                                                           break;
+-                              case TYPE_FLOAT_VEC4:   gl.uniform4fv(loc, 1, s_constInVec4[inNdx].getPtr());                                                                           break;
+-                              case TYPE_FLOAT_MAT2:   gl.uniformMatrix2fv(loc, 1, GL_FALSE, s_constInMat2[inNdx].getColumnMajorData().getPtr());      break;
+-                              case TYPE_FLOAT_MAT3:   gl.uniformMatrix3fv(loc, 1, GL_FALSE, s_constInMat3[inNdx].getColumnMajorData().getPtr());      break;
+-                              case TYPE_FLOAT_MAT4:   gl.uniformMatrix4fv(loc, 1, GL_FALSE, s_constInMat4[inNdx].getColumnMajorData().getPtr());      break;
+-                              default:
+-                                      DE_ASSERT(false);
+-                      }
+-              }
+-      }
++    const glw::Functions& gl = m_renderCtx.getFunctions();
++
++    DE_UNREF(constCoords);
++
++    for (int inNdx = 0; inNdx < 2; inNdx++)
++    {
++        const ShaderInput& in = inNdx > 0 ? m_in1 : m_in0;
++
++        if (in.inputType == INPUTTYPE_UNIFORM)
++        {
++            int loc = gl.getUniformLocation(programID, (string("u_in") + de::toString(inNdx)).c_str());
++
++            if (loc < 0)
++                continue;
++
++            switch (in.dataType)
++            {
++                case TYPE_FLOAT:        gl.uniform1f(loc, s_constInFloat[inNdx]);                                                   break;
++                case TYPE_FLOAT_VEC2:   gl.uniform2fv(loc, 1, s_constInVec2[inNdx].getPtr());                                       break;
++                case TYPE_FLOAT_VEC3:   gl.uniform3fv(loc, 1, s_constInVec3[inNdx].getPtr());                                       break;
++                case TYPE_FLOAT_VEC4:   gl.uniform4fv(loc, 1, s_constInVec4[inNdx].getPtr());                                       break;
++                case TYPE_FLOAT_MAT2:   gl.uniformMatrix2fv(loc, 1, GL_FALSE, s_constInMat2[inNdx].getColumnMajorData().getPtr());  break;
++                case TYPE_FLOAT_MAT3:   gl.uniformMatrix3fv(loc, 1, GL_FALSE, s_constInMat3[inNdx].getColumnMajorData().getPtr());  break;
++                case TYPE_FLOAT_MAT4:   gl.uniformMatrix4fv(loc, 1, GL_FALSE, s_constInMat4[inNdx].getColumnMajorData().getPtr());  break;
++                default:
++                    DE_ASSERT(false);
++            }
++        }
++    }
+ }
+ ShaderMatrixTests::ShaderMatrixTests (Context& context)
+-      : TestCaseGroup(context, "matrix", "Matrix Tests")
++    : TestCaseGroup(context, "matrix", "Matrix Tests")
+ {
+ }
+@@ -1086,136 +1086,136 @@ ShaderMatrixTests::~ShaderMatrixTests (void)
+ void ShaderMatrixTests::init (void)
+ {
+-      static const struct
+-      {
+-              const char*             name;
+-              const char*             desc;
+-              MatrixOp                op;
+-              bool                    extendedInputTypeCases; // !< test with const and uniform types too
+-      } ops[] =
+-      {
+-              { "add",                        "Matrix addition tests",                                                OP_ADD,                         true    },
+-              { "sub",                        "Matrix subtraction tests",                                             OP_SUB,                         true    },
+-              { "mul",                        "Matrix multiplication tests",                                  OP_MUL,                         true    },
+-              { "div",                        "Matrix division tests",                                                OP_DIV,                         true    },
+-              { "matrixcompmult",     "Matrix component-wise multiplication tests",   OP_COMP_MUL,            false   },
+-              { "unary_addition",     "Matrix unary addition tests",                                  OP_UNARY_PLUS,          false   },
+-              { "negation",           "Matrix negation tests",                                                OP_NEGATION,            false   },
+-              { "pre_increment",      "Matrix prefix increment tests",                                OP_PRE_INCREMENT,       false   },
+-              { "pre_decrement",      "Matrix prefix decrement tests",                                OP_PRE_DECREMENT,       false   },
+-              { "post_increment",     "Matrix postfix increment tests",                               OP_POST_INCREMENT,      false   },
+-              { "post_decrement",     "Matrix postfix decrement tests",                               OP_POST_DECREMENT,      false   },
+-              { "add_assign",         "Matrix add into tests",                                                OP_ADD_INTO,            false   },
+-              { "sub_assign",         "Matrix subtract from tests",                                   OP_SUBTRACT_FROM,       false   },
+-              { "mul_assign",         "Matrix multiply into tests",                                   OP_MULTIPLY_INTO,       false   },
+-              { "div_assign",         "Matrix divide into tests",                                             OP_DIVIDE_INTO,         false   },
+-      };
+-
+-      struct InputTypeSpec
+-      {
+-              const char*             name;
+-              const char*             desc;
+-              InputType               type;
+-      };
+-      static const InputTypeSpec extendedInputTypes[] =
+-      {
+-              { "const",              "Constant matrix input",        INPUTTYPE_CONST         },
+-              { "uniform",    "Uniform matrix input",         INPUTTYPE_UNIFORM       },
+-              { "dynamic",    "Dynamic matrix input",         INPUTTYPE_DYNAMIC       }
+-      };
+-      static const InputTypeSpec reducedInputTypes[] =
+-      {
+-              { "dynamic",    "Dynamic matrix input",         INPUTTYPE_DYNAMIC       }
+-      };
+-
+-      static const DataType matrixTypes[] =
+-      {
+-              TYPE_FLOAT_MAT2,
+-              TYPE_FLOAT_MAT3,
+-              TYPE_FLOAT_MAT4
+-      };
+-
+-      static const Precision precisions[] =
+-      {
+-              PRECISION_LOWP,
+-              PRECISION_MEDIUMP,
+-              PRECISION_HIGHP
+-      };
+-
+-      for (int opNdx = 0; opNdx < DE_LENGTH_OF_ARRAY(ops); opNdx++)
+-      {
+-              const InputTypeSpec*    inTypeList              = (ops[opNdx].extendedInputTypeCases) ? (extendedInputTypes) : (reducedInputTypes);
+-              const int                               inTypeListSize  = (ops[opNdx].extendedInputTypeCases) ? (DE_LENGTH_OF_ARRAY(extendedInputTypes)) : (DE_LENGTH_OF_ARRAY(reducedInputTypes));
+-              const MatrixOp                  op                              = ops[opNdx].op;
+-              tcu::TestCaseGroup*             opGroup                 = new tcu::TestCaseGroup(m_testCtx, ops[opNdx].name, ops[opNdx].desc);
+-
+-              addChild(opGroup);
+-
+-              for (int inTypeNdx = 0; inTypeNdx < inTypeListSize; inTypeNdx++)
+-              {
+-                      const InputType         inputType       = inTypeList[inTypeNdx].type;
+-
+-                      for (int matTypeNdx = 0; matTypeNdx < DE_LENGTH_OF_ARRAY(matrixTypes); matTypeNdx++)
+-                      {
+-                              DataType        matType         = matrixTypes[matTypeNdx];
+-                              const char*     matTypeName     = getDataTypeName(matType);
+-
+-                              for (int precNdx = 0; precNdx < DE_LENGTH_OF_ARRAY(precisions); precNdx++)
+-                              {
+-                                      Precision       precision       = precisions[precNdx];
+-                                      const char*     precName        = getPrecisionName(precision);
+-                                      string          baseName        = string(inTypeList[inTypeNdx].name) + "_" + precName + "_" + matTypeName + "_";
+-                                      ShaderInput     matIn           (inputType, matType, precision);
+-
+-                                      if (isOperationMatrixScalar(op))
+-                                      {
+-                                              // Matrix-scalar \note For div cases we use uniform input.
+-                                              ShaderInput scalarIn(op == OP_DIV ? INPUTTYPE_UNIFORM : INPUTTYPE_DYNAMIC, TYPE_FLOAT, precision);
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_vertex").c_str(),          "Matrix-scalar case", matIn, scalarIn, op, true));
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_fragment").c_str(),        "Matrix-scalar case", matIn, scalarIn, op, false));
+-                                      }
+-
+-                                      if (isOperationMatrixVector(op))
+-                                      {
+-                                              // Matrix-vector.
+-                                              DataType        vecType = getDataTypeFloatVec(getDataTypeMatrixNumColumns(matType));
+-                                              ShaderInput vecIn       (op == OP_DIV ? INPUTTYPE_UNIFORM : INPUTTYPE_DYNAMIC, vecType, precision);
+-
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(vecType) + "_vertex").c_str(),    "Matrix-vector case", matIn, vecIn, op, true));
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(vecType) + "_fragment").c_str(),  "Matrix-vector case", matIn, vecIn, op, false));
+-
+-                                              // Vector-matrix.
+-                                              string vecMatName = string(inTypeList[inTypeNdx].name) + "_" + precName + "_" + getDataTypeName(vecType) + "_" + matTypeName;
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (vecMatName + "_vertex").c_str(),             "Vector-matrix case", vecIn, matIn, op, true));
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (vecMatName + "_fragment").c_str(),   "Vector-matrix case", vecIn, matIn, op, false));
+-                                      }
+-
+-                                      if (isOperationMatrixMatrix(op))
+-                                      {
+-                                              // Matrix-matrix.
+-                                              ShaderInput otherMatIn(inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_UNIFORM : inputType, matType, precision);
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + matTypeName + "_vertex").c_str(),         "Matrix-matrix case", matIn, otherMatIn, op, true));
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + matTypeName + "_fragment").c_str(),       "Matrix-matrix case", matIn, otherMatIn, op, false));
+-                                      }
+-
+-                                      if (isOperationUnary(op))
+-                                      {
+-                                              // op matrix
+-                                              ShaderInput voidInput(INPUTTYPE_LAST, TYPE_LAST, PRECISION_LAST);
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "vertex").c_str(),                "Matrix case", matIn, voidInput, op, true));
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "fragment").c_str(),      "Matrix case", matIn, voidInput, op, false));
+-                                      }
+-
+-                                      if (isOperationAssignment(op))
+-                                      {
+-                                              ShaderInput otherMatIn(inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_UNIFORM : inputType, matType, precision);
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "vertex").c_str(),                "Matrix assignment case", matIn, otherMatIn, op, true));
+-                                              opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "fragment").c_str(),      "Matrix assignment case", matIn, otherMatIn, op, false));
+-                                      }
+-                              }
+-                      }
+-              }
+-      }
++    static const struct
++    {
++        const char*     name;
++        const char*     desc;
++        MatrixOp        op;
++        bool            extendedInputTypeCases; // !< test with const and uniform types too
++    } ops[] =
++    {
++        { "add",            "Matrix addition tests",                        OP_ADD,             true    },
++        { "sub",            "Matrix subtraction tests",                     OP_SUB,             true    },
++        { "mul",            "Matrix multiplication tests",                  OP_MUL,             true    },
++        { "div",            "Matrix division tests",                        OP_DIV,             true    },
++        { "matrixcompmult", "Matrix component-wise multiplication tests",   OP_COMP_MUL,        false   },
++        { "unary_addition", "Matrix unary addition tests",                  OP_UNARY_PLUS,      false   },
++        { "negation",       "Matrix negation tests",                        OP_NEGATION,        false   },
++        { "pre_increment",  "Matrix prefix increment tests",                OP_PRE_INCREMENT,   false   },
++        { "pre_decrement",  "Matrix prefix decrement tests",                OP_PRE_DECREMENT,   false   },
++        { "post_increment", "Matrix postfix increment tests",               OP_POST_INCREMENT,  false   },
++        { "post_decrement", "Matrix postfix decrement tests",               OP_POST_DECREMENT,  false   },
++        { "add_assign",     "Matrix add into tests",                        OP_ADD_INTO,        false   },
++        { "sub_assign",     "Matrix subtract from tests",                   OP_SUBTRACT_FROM,   false   },
++        { "mul_assign",     "Matrix multiply into tests",                   OP_MULTIPLY_INTO,   false   },
++        { "div_assign",     "Matrix divide into tests",                     OP_DIVIDE_INTO,     false   },
++    };
++
++    struct InputTypeSpec
++    {
++        const char*     name;
++        const char*     desc;
++        InputType       type;
++    };
++    static const InputTypeSpec extendedInputTypes[] =
++    {
++        { "const",      "Constant matrix input",    INPUTTYPE_CONST     },
++        { "uniform",    "Uniform matrix input",     INPUTTYPE_UNIFORM   },
++        { "dynamic",    "Dynamic matrix input",     INPUTTYPE_DYNAMIC   }
++    };
++    static const InputTypeSpec reducedInputTypes[] =
++    {
++        { "dynamic",    "Dynamic matrix input",     INPUTTYPE_DYNAMIC   }
++    };
++
++    static const DataType matrixTypes[] =
++    {
++        TYPE_FLOAT_MAT2,
++        TYPE_FLOAT_MAT3,
++        TYPE_FLOAT_MAT4
++    };
++
++    static const Precision precisions[] =
++    {
++        PRECISION_LOWP,
++        PRECISION_MEDIUMP,
++        PRECISION_HIGHP
++    };
++
++    for (int opNdx = 0; opNdx < DE_LENGTH_OF_ARRAY(ops); opNdx++)
++    {
++        const InputTypeSpec*    inTypeList      = (ops[opNdx].extendedInputTypeCases) ? (extendedInputTypes) : (reducedInputTypes);
++        const int               inTypeListSize  = (ops[opNdx].extendedInputTypeCases) ? (DE_LENGTH_OF_ARRAY(extendedInputTypes)) : (DE_LENGTH_OF_ARRAY(reducedInputTypes));
++        const MatrixOp          op              = ops[opNdx].op;
++        tcu::TestCaseGroup*     opGroup         = new tcu::TestCaseGroup(m_testCtx, ops[opNdx].name, ops[opNdx].desc);
++
++        addChild(opGroup);
++
++        for (int inTypeNdx = 0; inTypeNdx < inTypeListSize; inTypeNdx++)
++        {
++            const InputType     inputType   = inTypeList[inTypeNdx].type;
++
++            for (int matTypeNdx = 0; matTypeNdx < DE_LENGTH_OF_ARRAY(matrixTypes); matTypeNdx++)
++            {
++                DataType    matType     = matrixTypes[matTypeNdx];
++                const char* matTypeName = getDataTypeName(matType);
++
++                for (int precNdx = 0; precNdx < DE_LENGTH_OF_ARRAY(precisions); precNdx++)
++                {
++                    Precision   precision   = precisions[precNdx];
++                    const char* precName    = getPrecisionName(precision);
++                    string      baseName    = string(inTypeList[inTypeNdx].name) + "_" + precName + "_" + matTypeName + "_";
++                    ShaderInput matIn       (inputType, matType, precision);
++
++                    if (isOperationMatrixScalar(op))
++                    {
++                        // Matrix-scalar \note For div cases we use uniform input.
++                        ShaderInput scalarIn(op == OP_DIV ? INPUTTYPE_UNIFORM : INPUTTYPE_DYNAMIC, TYPE_FLOAT, precision);
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_vertex").c_str(),      "Matrix-scalar case", matIn, scalarIn, op, true));
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_fragment").c_str(),    "Matrix-scalar case", matIn, scalarIn, op, false));
++                    }
++
++                    if (isOperationMatrixVector(op))
++                    {
++                        // Matrix-vector.
++                        DataType    vecType = getDataTypeFloatVec(getDataTypeMatrixNumColumns(matType));
++                        ShaderInput vecIn   (op == OP_DIV ? INPUTTYPE_UNIFORM : INPUTTYPE_DYNAMIC, vecType, precision);
++
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(vecType) + "_vertex").c_str(),    "Matrix-vector case", matIn, vecIn, op, true));
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(vecType) + "_fragment").c_str(),  "Matrix-vector case", matIn, vecIn, op, false));
++
++                        // Vector-matrix.
++                        string vecMatName = string(inTypeList[inTypeNdx].name) + "_" + precName + "_" + getDataTypeName(vecType) + "_" + matTypeName;
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (vecMatName + "_vertex").c_str(),     "Vector-matrix case", vecIn, matIn, op, true));
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (vecMatName + "_fragment").c_str(),   "Vector-matrix case", vecIn, matIn, op, false));
++                    }
++
++                    if (isOperationMatrixMatrix(op))
++                    {
++                        // Matrix-matrix.
++                        ShaderInput otherMatIn(inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_UNIFORM : inputType, matType, precision);
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + matTypeName + "_vertex").c_str(),     "Matrix-matrix case", matIn, otherMatIn, op, true));
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + matTypeName + "_fragment").c_str(),   "Matrix-matrix case", matIn, otherMatIn, op, false));
++                    }
++
++                    if (isOperationUnary(op))
++                    {
++                        // op matrix
++                        ShaderInput voidInput(INPUTTYPE_LAST, TYPE_LAST, PRECISION_LAST);
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "vertex").c_str(),        "Matrix case", matIn, voidInput, op, true));
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "fragment").c_str(),  "Matrix case", matIn, voidInput, op, false));
++                    }
++
++                    if (isOperationAssignment(op))
++                    {
++                        ShaderInput otherMatIn(inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_UNIFORM : inputType, matType, precision);
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "vertex").c_str(),        "Matrix assignment case", matIn, otherMatIn, op, true));
++                        opGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "fragment").c_str(),  "Matrix assignment case", matIn, otherMatIn, op, false));
++                    }
++                }
++            }
++        }
++    }
+ }
+ } // Functional
+diff --git a/src/tests/deqp_support/es3fShaderMatrixTests.cpp b/src/tests/deqp_support/es3fShaderMatrixTests.cpp
+index b18f8ba14..25784982c 100644
+--- a/src/tests/deqp_support/es3fShaderMatrixTests.cpp
++++ b/src/tests/deqp_support/es3fShaderMatrixTests.cpp
+@@ -77,127 +77,127 @@ using tcu::Mat4;
+ // Uniform / constant values for tests.
+ // \note Input1 should not contain 0 components as it is used as divisor in div cases.
+ // \todo [2012-02-14 pyry] Make these dynamic.
+-static const float    s_constInFloat[2]       = { 0.5f, -0.2f };
+-static const Vec2     s_constInVec2[2]        = { Vec2(1.2f, 0.5f), Vec2(0.5f, 1.0f) };
+-static const Vec3     s_constInVec3[2]        = { Vec3(1.1f, 0.1f, 0.5f), Vec3(-0.2f, 0.5f, 0.8f) };
+-static const Vec4     s_constInVec4[2]        = { Vec4(1.4f, 0.2f, -0.5f, 0.7f), Vec4(0.2f, -1.0f, 0.5f, 0.8f) };
++static const float  s_constInFloat[2]   = { 0.5f, -0.2f };
++static const Vec2   s_constInVec2[2]    = { Vec2(1.2f, 0.5f), Vec2(0.5f, 1.0f) };
++static const Vec3   s_constInVec3[2]    = { Vec3(1.1f, 0.1f, 0.5f), Vec3(-0.2f, 0.5f, 0.8f) };
++static const Vec4   s_constInVec4[2]    = { Vec4(1.4f, 0.2f, -0.5f, 0.7f), Vec4(0.2f, -1.0f, 0.5f, 0.8f) };
+ static const float s_constInMat2x2[2][4] =
+ {
+-      {
+-              -0.1f,  1.0f,
+-              -0.2f,  0.0f,
+-      },
+-      {
+-               0.8f,  0.1f,
+-               0.5f, -0.9f,
+-      },
++    {
++        -0.1f,  1.0f,
++        -0.2f,  0.0f,
++    },
++    {
++         0.8f,  0.1f,
++         0.5f, -0.9f,
++    },
+ };
+ static const float s_constInMat3x2[2][6] =
+ {
+-      {
+-               0.8f, -0.3f,  0.3f,
+-               1.0f,  1.2f, -1.2f,
+-      },
+-      {
+-               1.2f, -1.0f,  0.5f,
+-              -0.8f,  1.1f,  0.3f,
+-      },
++    {
++         0.8f, -0.3f,  0.3f,
++         1.0f,  1.2f, -1.2f,
++    },
++    {
++         1.2f, -1.0f,  0.5f,
++        -0.8f,  1.1f,  0.3f,
++    },
+ };
+ static const float s_constInMat4x2[2][8] =
+ {
+-      {
+-              -0.2f,  0.5f, 0.0f, -1.0f,
+-               1.2f, -0.5f, 0.3f, -0.9f,
+-      },
+-      {
+-              1.0f,  0.1f, -1.1f,  0.6f,
+-              0.8f, -1.2f, -1.1f,  0.7f,
+-      },
++    {
++        -0.2f,  0.5f, 0.0f, -1.0f,
++         1.2f, -0.5f, 0.3f, -0.9f,
++    },
++    {
++        1.0f,  0.1f, -1.1f,  0.6f,
++        0.8f, -1.2f, -1.1f,  0.7f,
++    },
+ };
+ static const float s_constInMat2x3[2][6] =
+ {
+-      {
+-              -0.6f, -0.1f,
+-              -0.7f, -1.2f,
+-              -0.2f,  0.0f,
+-      },
+-      {
+-               1.1f,  0.6f,
+-               0.8f,  1.0f,
+-               0.7f,  0.1f,
+-      },
++    {
++        -0.6f, -0.1f,
++        -0.7f, -1.2f,
++        -0.2f,  0.0f,
++    },
++    {
++         1.1f,  0.6f,
++         0.8f,  1.0f,
++         0.7f,  0.1f,
++    },
+ };
+ static const float s_constInMat3x3[2][9] =
+ {
+-      {
+-              -0.2f,  1.1f, 1.2f,
+-              -1.0f,  1.2f, 0.5f,
+-               0.7f, -0.2f, 1.0f,
+-      },
+-      {
+-              -0.1f, -0.1f,  0.1f,
+-              -0.1f, -0.2f,  1.0f,
+-              -0.5f,  0.1f, -0.4f,
+-      },
++    {
++        -0.2f,  1.1f, 1.2f,
++        -1.0f,  1.2f, 0.5f,
++         0.7f, -0.2f, 1.0f,
++    },
++    {
++        -0.1f, -0.1f,  0.1f,
++        -0.1f, -0.2f,  1.0f,
++        -0.5f,  0.1f, -0.4f,
++    },
+ };
+ static const float s_constInMat4x3[2][12] =
+ {
+-      {
+-              -0.9f,  0.0f,  0.6f,  0.2f,
+-               0.9f, -0.1f, -0.3f, -0.7f,
+-              -0.1f,  0.1f,  1.0f,  0.0f,
+-      },
+-      {
+-               0.5f,  0.7f,  0.7f,  1.2f,
+-               1.1f,  0.1f,  1.0f, -1.0f,
+-              -0.2f, -0.2f, -0.3f, -0.5f,
+-      },
++    {
++        -0.9f,  0.0f,  0.6f,  0.2f,
++         0.9f, -0.1f, -0.3f, -0.7f,
++        -0.1f,  0.1f,  1.0f,  0.0f,
++    },
++    {
++         0.5f,  0.7f,  0.7f,  1.2f,
++         1.1f,  0.1f,  1.0f, -1.0f,
++        -0.2f, -0.2f, -0.3f, -0.5f,
++    },
+ };
+ static const float s_constInMat2x4[2][8] =
+ {
+-      {
+-              -0.6f, -1.1f,
+-              -0.6f, -0.6f,
+-              -0.2f, -0.6f,
+-              -0.1f, -0.1f,
+-      },
+-      {
+-              -1.2f, -1.0f,
+-               0.7f, -1.0f,
+-               0.7f,  0.7f,
+-              -0.4f, -0.3f,
+-      },
++    {
++        -0.6f, -1.1f,
++        -0.6f, -0.6f,
++        -0.2f, -0.6f,
++        -0.1f, -0.1f,
++    },
++    {
++        -1.2f, -1.0f,
++         0.7f, -1.0f,
++         0.7f,  0.7f,
++        -0.4f, -0.3f,
++    },
+ };
+ static const float s_constInMat3x4[2][12] =
+ {
+-      {
+-               0.6f, -0.4f,  1.2f,
+-               0.9f,  0.8f,  0.4f,
+-               1.1f,  0.3f,  0.5f,
+-              -0.2f,  0.0f,  1.1f,
+-      },
+-      {
+-              -0.8f,  1.2f, -0.2f,
+-              -1.1f, -0.9f, -0.5f,
+-              -1.2f,  1.0f,  1.2f,
+-               0.1f, -0.7f, -0.5f,
+-      },
++    {
++         0.6f, -0.4f,  1.2f,
++         0.9f,  0.8f,  0.4f,
++         1.1f,  0.3f,  0.5f,
++        -0.2f,  0.0f,  1.1f,
++    },
++    {
++        -0.8f,  1.2f, -0.2f,
++        -1.1f, -0.9f, -0.5f,
++        -1.2f,  1.0f,  1.2f,
++         0.1f, -0.7f, -0.5f,
++    },
+ };
+ static const float s_constInMat4x4[2][16] =
+ {
+-      {
+-               0.3f,  0.9f, -0.2f,  1.0f,
+-              -0.4f, -0.6f,  0.6f, -1.0f,
+-              -0.9f, -0.1f,  0.3f, -0.2f,
+-              -0.3f, -0.9f,  1.0f,  0.1f,
+-      },
+-      {
+-               0.4f, -0.7f, -0.8f,  0.7f,
+-              -0.4f, -0.8f,  0.6f, -0.3f,
+-               0.7f, -1.0f,  0.1f, -0.3f,
+-               0.2f,  0.6f,  0.4f, -1.0f,
+-      },
++    {
++         0.3f,  0.9f, -0.2f,  1.0f,
++        -0.4f, -0.6f,  0.6f, -1.0f,
++        -0.9f, -0.1f,  0.3f, -0.2f,
++        -0.3f, -0.9f,  1.0f,  0.1f,
++    },
++    {
++         0.4f, -0.7f, -0.8f,  0.7f,
++        -0.4f, -0.8f,  0.6f, -0.3f,
++         0.7f, -1.0f,  0.1f, -0.3f,
++         0.2f,  0.6f,  0.4f, -1.0f,
++    },
+ };
+ namespace MatrixCaseUtils
+@@ -205,49 +205,49 @@ namespace MatrixCaseUtils
+ enum InputType
+ {
+-      INPUTTYPE_CONST = 0,
+-      INPUTTYPE_UNIFORM,
+-      INPUTTYPE_DYNAMIC,
++    INPUTTYPE_CONST = 0,
++    INPUTTYPE_UNIFORM,
++    INPUTTYPE_DYNAMIC,
+-      INPUTTYPE_LAST
++    INPUTTYPE_LAST
+ };
+ struct ShaderInput
+ {
+-      ShaderInput (InputType inputType_, DataType dataType_, Precision precision_)
+-              : inputType     (inputType_)
+-              , dataType      (dataType_)
+-              , precision     (precision_)
+-      {
+-      }
++    ShaderInput (InputType inputType_, DataType dataType_, Precision precision_)
++        : inputType (inputType_)
++        , dataType  (dataType_)
++        , precision (precision_)
++    {
++    }
+-      InputType               inputType;
+-      DataType                dataType;
+-      Precision               precision;
++    InputType       inputType;
++    DataType        dataType;
++    Precision       precision;
+ };
+ enum MatrixOp
+ {
+-      OP_ADD = 0,
+-      OP_SUB,
+-      OP_MUL,
+-      OP_DIV,
+-      OP_COMP_MUL,
+-      OP_OUTER_PRODUCT,
+-      OP_TRANSPOSE,
+-      OP_INVERSE,
+-      OP_DETERMINANT,
+-      OP_UNARY_PLUS,
+-      OP_NEGATION,
+-      OP_PRE_INCREMENT,
+-      OP_PRE_DECREMENT,
+-      OP_POST_INCREMENT,
+-      OP_POST_DECREMENT,
+-      OP_ADD_INTO,
+-      OP_SUBTRACT_FROM,
+-      OP_MULTIPLY_INTO,
+-      OP_DIVIDE_INTO,
+-      OP_LAST
++    OP_ADD = 0,
++    OP_SUB,
++    OP_MUL,
++    OP_DIV,
++    OP_COMP_MUL,
++    OP_OUTER_PRODUCT,
++    OP_TRANSPOSE,
++    OP_INVERSE,
++    OP_DETERMINANT,
++    OP_UNARY_PLUS,
++    OP_NEGATION,
++    OP_PRE_INCREMENT,
++    OP_PRE_DECREMENT,
++    OP_POST_INCREMENT,
++    OP_POST_DECREMENT,
++    OP_ADD_INTO,
++    OP_SUBTRACT_FROM,
++    OP_MULTIPLY_INTO,
++    OP_DIVIDE_INTO,
++    OP_LAST
+ };
+ // Type traits.
+@@ -255,237 +255,237 @@ enum MatrixOp
+ template <int DataT>
+ struct TypeTraits;
+-#define DECLARE_TYPE_TRAIT(DATATYPE, TYPE)    \
+-template<>                                                                    \
+-struct TypeTraits<DATATYPE> {                         \
+-      typedef TYPE Type;                                              \
++#define DECLARE_TYPE_TRAIT(DATATYPE, TYPE)  \
++template<>                                  \
++struct TypeTraits<DATATYPE> {               \
++    typedef TYPE Type;                      \
+ }
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT,                        float);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC2,           tcu::Vec2);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC3,           tcu::Vec3);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC4,           tcu::Vec4);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT2,           tcu::Mat2);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT2X3, tcu::Mat2x3);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT2X4, tcu::Mat2x4);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT3X2, tcu::Mat3x2);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT3,           tcu::Mat3);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT3X4, tcu::Mat3x4);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT4X2, tcu::Mat4x2);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT4X3, tcu::Mat4x3);
+-DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT4,           tcu::Mat4);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT,          float);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC2,     tcu::Vec2);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC3,     tcu::Vec3);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_VEC4,     tcu::Vec4);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT2,     tcu::Mat2);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT2X3,   tcu::Mat2x3);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT2X4,   tcu::Mat2x4);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT3X2,   tcu::Mat3x2);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT3,     tcu::Mat3);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT3X4,   tcu::Mat3x4);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT4X2,   tcu::Mat4x2);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT4X3,   tcu::Mat4x3);
++DECLARE_TYPE_TRAIT(TYPE_FLOAT_MAT4,     tcu::Mat4);
+ // Operation info
+ enum OperationType
+ {
+-      OPERATIONTYPE_BINARY_OPERATOR = 0,
+-      OPERATIONTYPE_BINARY_FUNCTION,
+-      OPERATIONTYPE_UNARY_PREFIX_OPERATOR,
+-      OPERATIONTYPE_UNARY_POSTFIX_OPERATOR,
+-      OPERATIONTYPE_UNARY_FUNCTION,
+-      OPERATIONTYPE_ASSIGNMENT,
++    OPERATIONTYPE_BINARY_OPERATOR = 0,
++    OPERATIONTYPE_BINARY_FUNCTION,
++    OPERATIONTYPE_UNARY_PREFIX_OPERATOR,
++    OPERATIONTYPE_UNARY_POSTFIX_OPERATOR,
++    OPERATIONTYPE_UNARY_FUNCTION,
++    OPERATIONTYPE_ASSIGNMENT,
+-      OPERATIONTYPE_LAST
++    OPERATIONTYPE_LAST
+ };
+ static const char* getOperationName (MatrixOp op)
+ {
+-      switch (op)
+-      {
+-              case OP_ADD:                    return "+";
+-              case OP_SUB:                    return "-";
+-              case OP_MUL:                    return "*";
+-              case OP_DIV:                    return "/";
+-              case OP_COMP_MUL:               return "matrixCompMult";
+-              case OP_OUTER_PRODUCT:  return "outerProduct";
+-              case OP_TRANSPOSE:              return "transpose";
+-              case OP_INVERSE:                return "inverse";
+-              case OP_DETERMINANT:    return "determinant";
+-              case OP_UNARY_PLUS:             return "+";
+-              case OP_NEGATION:               return "-";
+-              case OP_PRE_INCREMENT:  return "++";
+-              case OP_PRE_DECREMENT:  return "--";
+-              case OP_POST_INCREMENT: return "++";
+-              case OP_POST_DECREMENT: return "--";
+-              case OP_ADD_INTO:               return "+=";
+-              case OP_SUBTRACT_FROM:  return "-=";
+-              case OP_MULTIPLY_INTO:  return "*=";
+-              case OP_DIVIDE_INTO:    return "/=";
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-                      return "";
+-      }
++    switch (op)
++    {
++        case OP_ADD:            return "+";
++        case OP_SUB:            return "-";
++        case OP_MUL:            return "*";
++        case OP_DIV:            return "/";
++        case OP_COMP_MUL:       return "matrixCompMult";
++        case OP_OUTER_PRODUCT:  return "outerProduct";
++        case OP_TRANSPOSE:      return "transpose";
++        case OP_INVERSE:        return "inverse";
++        case OP_DETERMINANT:    return "determinant";
++        case OP_UNARY_PLUS:     return "+";
++        case OP_NEGATION:       return "-";
++        case OP_PRE_INCREMENT:  return "++";
++        case OP_PRE_DECREMENT:  return "--";
++        case OP_POST_INCREMENT: return "++";
++        case OP_POST_DECREMENT: return "--";
++        case OP_ADD_INTO:       return "+=";
++        case OP_SUBTRACT_FROM:  return "-=";
++        case OP_MULTIPLY_INTO:  return "*=";
++        case OP_DIVIDE_INTO:    return "/=";
++
++        default:
++            DE_ASSERT(DE_FALSE);
++            return "";
++    }
+ }
+ static OperationType getOperationType (MatrixOp op)
+ {
+-      switch (op)
+-      {
+-              case OP_ADD:                    return OPERATIONTYPE_BINARY_OPERATOR;
+-              case OP_SUB:                    return OPERATIONTYPE_BINARY_OPERATOR;
+-              case OP_MUL:                    return OPERATIONTYPE_BINARY_OPERATOR;
+-              case OP_DIV:                    return OPERATIONTYPE_BINARY_OPERATOR;
+-              case OP_COMP_MUL:               return OPERATIONTYPE_BINARY_FUNCTION;
+-              case OP_OUTER_PRODUCT:  return OPERATIONTYPE_BINARY_FUNCTION;
+-              case OP_TRANSPOSE:              return OPERATIONTYPE_UNARY_FUNCTION;
+-              case OP_INVERSE:                return OPERATIONTYPE_UNARY_FUNCTION;
+-              case OP_DETERMINANT:    return OPERATIONTYPE_UNARY_FUNCTION;
+-              case OP_UNARY_PLUS:             return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+-              case OP_NEGATION:               return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+-              case OP_PRE_INCREMENT:  return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+-              case OP_PRE_DECREMENT:  return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+-              case OP_POST_INCREMENT: return OPERATIONTYPE_UNARY_POSTFIX_OPERATOR;
+-              case OP_POST_DECREMENT: return OPERATIONTYPE_UNARY_POSTFIX_OPERATOR;
+-              case OP_ADD_INTO:               return OPERATIONTYPE_ASSIGNMENT;
+-              case OP_SUBTRACT_FROM:  return OPERATIONTYPE_ASSIGNMENT;
+-              case OP_MULTIPLY_INTO:  return OPERATIONTYPE_ASSIGNMENT;
+-              case OP_DIVIDE_INTO:    return OPERATIONTYPE_ASSIGNMENT;
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-                      return OPERATIONTYPE_LAST;
+-      }
++    switch (op)
++    {
++        case OP_ADD:            return OPERATIONTYPE_BINARY_OPERATOR;
++        case OP_SUB:            return OPERATIONTYPE_BINARY_OPERATOR;
++        case OP_MUL:            return OPERATIONTYPE_BINARY_OPERATOR;
++        case OP_DIV:            return OPERATIONTYPE_BINARY_OPERATOR;
++        case OP_COMP_MUL:       return OPERATIONTYPE_BINARY_FUNCTION;
++        case OP_OUTER_PRODUCT:  return OPERATIONTYPE_BINARY_FUNCTION;
++        case OP_TRANSPOSE:      return OPERATIONTYPE_UNARY_FUNCTION;
++        case OP_INVERSE:        return OPERATIONTYPE_UNARY_FUNCTION;
++        case OP_DETERMINANT:    return OPERATIONTYPE_UNARY_FUNCTION;
++        case OP_UNARY_PLUS:     return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
++        case OP_NEGATION:       return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
++        case OP_PRE_INCREMENT:  return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
++        case OP_PRE_DECREMENT:  return OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
++        case OP_POST_INCREMENT: return OPERATIONTYPE_UNARY_POSTFIX_OPERATOR;
++        case OP_POST_DECREMENT: return OPERATIONTYPE_UNARY_POSTFIX_OPERATOR;
++        case OP_ADD_INTO:       return OPERATIONTYPE_ASSIGNMENT;
++        case OP_SUBTRACT_FROM:  return OPERATIONTYPE_ASSIGNMENT;
++        case OP_MULTIPLY_INTO:  return OPERATIONTYPE_ASSIGNMENT;
++        case OP_DIVIDE_INTO:    return OPERATIONTYPE_ASSIGNMENT;
++        default:
++            DE_ASSERT(DE_FALSE);
++            return OPERATIONTYPE_LAST;
++    }
+ }
+ enum TestMatrixType
+ {
+-      TESTMATRIXTYPE_DEFAULT = 0,
+-      TESTMATRIXTYPE_NEGATED,
+-      TESTMATRIXTYPE_INCREMENTED,
+-      TESTMATRIXTYPE_DECREMENTED,
+-      TESTMATRIXTYPE_NEGATED_INCREMENTED,
+-      TESTMATRIXTYPE_INCREMENTED_LESS,
++    TESTMATRIXTYPE_DEFAULT = 0,
++    TESTMATRIXTYPE_NEGATED,
++    TESTMATRIXTYPE_INCREMENTED,
++    TESTMATRIXTYPE_DECREMENTED,
++    TESTMATRIXTYPE_NEGATED_INCREMENTED,
++    TESTMATRIXTYPE_INCREMENTED_LESS,
+-      TESTMATRIXTYPE_LAST
++    TESTMATRIXTYPE_LAST
+ };
+ static TestMatrixType getOperationTestMatrixType (MatrixOp op)
+ {
+-      switch(op)
+-      {
+-              case OP_ADD:                    return TESTMATRIXTYPE_DEFAULT;
+-              case OP_SUB:                    return TESTMATRIXTYPE_DEFAULT;
+-              case OP_MUL:                    return TESTMATRIXTYPE_DEFAULT;
+-              case OP_DIV:                    return TESTMATRIXTYPE_DEFAULT;
+-              case OP_COMP_MUL:               return TESTMATRIXTYPE_DEFAULT;
+-              case OP_OUTER_PRODUCT:  return TESTMATRIXTYPE_DEFAULT;
+-              case OP_TRANSPOSE:              return TESTMATRIXTYPE_DEFAULT;
+-              case OP_INVERSE:                return TESTMATRIXTYPE_DEFAULT;
+-              case OP_DETERMINANT:    return TESTMATRIXTYPE_DEFAULT;
+-              case OP_UNARY_PLUS:             return TESTMATRIXTYPE_DECREMENTED;
+-              case OP_NEGATION:               return TESTMATRIXTYPE_NEGATED_INCREMENTED;
+-              case OP_PRE_INCREMENT:  return TESTMATRIXTYPE_NEGATED;
+-              case OP_PRE_DECREMENT:  return TESTMATRIXTYPE_INCREMENTED;
+-              case OP_POST_INCREMENT: return TESTMATRIXTYPE_NEGATED;
+-              case OP_POST_DECREMENT: return TESTMATRIXTYPE_DEFAULT;
+-              case OP_ADD_INTO:               return TESTMATRIXTYPE_DEFAULT;
+-              case OP_SUBTRACT_FROM:  return TESTMATRIXTYPE_INCREMENTED_LESS;
+-              case OP_MULTIPLY_INTO:  return TESTMATRIXTYPE_NEGATED;
+-              case OP_DIVIDE_INTO:    return TESTMATRIXTYPE_DECREMENTED;
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-                      return TESTMATRIXTYPE_LAST;
+-      }
++    switch(op)
++    {
++        case OP_ADD:            return TESTMATRIXTYPE_DEFAULT;
++        case OP_SUB:            return TESTMATRIXTYPE_DEFAULT;
++        case OP_MUL:            return TESTMATRIXTYPE_DEFAULT;
++        case OP_DIV:            return TESTMATRIXTYPE_DEFAULT;
++        case OP_COMP_MUL:       return TESTMATRIXTYPE_DEFAULT;
++        case OP_OUTER_PRODUCT:  return TESTMATRIXTYPE_DEFAULT;
++        case OP_TRANSPOSE:      return TESTMATRIXTYPE_DEFAULT;
++        case OP_INVERSE:        return TESTMATRIXTYPE_DEFAULT;
++        case OP_DETERMINANT:    return TESTMATRIXTYPE_DEFAULT;
++        case OP_UNARY_PLUS:     return TESTMATRIXTYPE_DECREMENTED;
++        case OP_NEGATION:       return TESTMATRIXTYPE_NEGATED_INCREMENTED;
++        case OP_PRE_INCREMENT:  return TESTMATRIXTYPE_NEGATED;
++        case OP_PRE_DECREMENT:  return TESTMATRIXTYPE_INCREMENTED;
++        case OP_POST_INCREMENT: return TESTMATRIXTYPE_NEGATED;
++        case OP_POST_DECREMENT: return TESTMATRIXTYPE_DEFAULT;
++        case OP_ADD_INTO:       return TESTMATRIXTYPE_DEFAULT;
++        case OP_SUBTRACT_FROM:  return TESTMATRIXTYPE_INCREMENTED_LESS;
++        case OP_MULTIPLY_INTO:  return TESTMATRIXTYPE_NEGATED;
++        case OP_DIVIDE_INTO:    return TESTMATRIXTYPE_DECREMENTED;
++
++        default:
++            DE_ASSERT(DE_FALSE);
++            return TESTMATRIXTYPE_LAST;
++    }
+ }
+ static bool isOperationBinary (MatrixOp op)
+ {
+-      return getOperationType(op) == OPERATIONTYPE_BINARY_OPERATOR ||
+-             getOperationType(op) == OPERATIONTYPE_BINARY_FUNCTION ||
+-             getOperationType(op) == OPERATIONTYPE_ASSIGNMENT;
++    return getOperationType(op) == OPERATIONTYPE_BINARY_OPERATOR ||
++           getOperationType(op) == OPERATIONTYPE_BINARY_FUNCTION ||
++           getOperationType(op) == OPERATIONTYPE_ASSIGNMENT;
+ }
+ static bool isOperationMatrixScalar (MatrixOp op)
+ {
+-      return op == OP_ADD || op == OP_SUB || op == OP_MUL || op == OP_DIV;
++    return op == OP_ADD || op == OP_SUB || op == OP_MUL || op == OP_DIV;
+ }
+ static bool isOperationMatrixVector (MatrixOp op)
+ {
+-      return op == OP_MUL;
++    return op == OP_MUL;
+ }
+ static bool isOperationArithmeticMatrixMatrix (MatrixOp op)
+ {
+-      return op == OP_MUL;
++    return op == OP_MUL;
+ }
+ static bool isOperationComponentwiseMatrixMatrix (MatrixOp op)
+ {
+-      return op == OP_ADD || op == OP_SUB || op == OP_MUL || op == OP_DIV || op == OP_COMP_MUL;
++    return op == OP_ADD || op == OP_SUB || op == OP_MUL || op == OP_DIV || op == OP_COMP_MUL;
+ }
+ static bool isOperationVectorVector (MatrixOp op)
+ {
+-      return op == OP_OUTER_PRODUCT;
++    return op == OP_OUTER_PRODUCT;
+ }
+ static bool isOperationUnaryAnyMatrix (MatrixOp op)
+ {
+-      return  op == OP_TRANSPOSE                       ||
+-                      op == OP_UNARY_PLUS                      ||
+-                      op == OP_NEGATION                        ||
+-                      op == OP_PRE_INCREMENT           ||
+-                      op == OP_PRE_DECREMENT           ||
+-                      op == OP_POST_INCREMENT          ||
+-                      op == OP_POST_DECREMENT;
++    return  op == OP_TRANSPOSE           ||
++            op == OP_UNARY_PLUS          ||
++            op == OP_NEGATION            ||
++            op == OP_PRE_INCREMENT       ||
++            op == OP_PRE_DECREMENT       ||
++            op == OP_POST_INCREMENT      ||
++            op == OP_POST_DECREMENT;
+ }
+ static bool isOperationUnarySymmetricMatrix (MatrixOp op)
+ {
+-      return op == OP_INVERSE || op == OP_DETERMINANT;
++    return op == OP_INVERSE || op == OP_DETERMINANT;
+ }
+ static bool isOperationValueModifying (MatrixOp op)
+ {
+-      return  op == OP_PRE_INCREMENT           ||
+-                      op == OP_PRE_DECREMENT           ||
+-                      op == OP_POST_INCREMENT          ||
+-                      op == OP_POST_DECREMENT;
++    return  op == OP_PRE_INCREMENT       ||
++            op == OP_PRE_DECREMENT       ||
++            op == OP_POST_INCREMENT      ||
++            op == OP_POST_DECREMENT;
+ }
+ static bool isOperationAssignment (MatrixOp op)
+ {
+-      return  op == OP_ADD_INTO                ||
+-                      op == OP_SUBTRACT_FROM   ||
+-                      op == OP_MULTIPLY_INTO   ||
+-                      op == OP_DIVIDE_INTO;
++    return  op == OP_ADD_INTO        ||
++            op == OP_SUBTRACT_FROM   ||
++            op == OP_MULTIPLY_INTO   ||
++            op == OP_DIVIDE_INTO;
+ }
+ static bool isOperationAssignmentAnyMatrix (MatrixOp op)
+ {
+-      return  op == OP_ADD_INTO                ||
+-                      op == OP_SUBTRACT_FROM   ||
+-                      op == OP_DIVIDE_INTO;
++    return  op == OP_ADD_INTO        ||
++            op == OP_SUBTRACT_FROM   ||
++            op == OP_DIVIDE_INTO;
+ }
+ static bool isOperationAssignmentSymmetricMatrix (MatrixOp op)
+ {
+-      return op == OP_MULTIPLY_INTO;
++    return op == OP_MULTIPLY_INTO;
+ }
+ // Operation nature
+ enum OperationNature
+ {
+-      OPERATIONNATURE_PURE = 0,
+-      OPERATIONNATURE_MUTATING,
+-      OPERATIONNATURE_ASSIGNMENT,
++    OPERATIONNATURE_PURE = 0,
++    OPERATIONNATURE_MUTATING,
++    OPERATIONNATURE_ASSIGNMENT,
+-      OPERATIONNATURE_LAST
++    OPERATIONNATURE_LAST
+ };
+ static OperationNature getOperationNature (MatrixOp op)
+ {
+-      if (isOperationAssignment(op))
+-              return OPERATIONNATURE_ASSIGNMENT;
++    if (isOperationAssignment(op))
++        return OPERATIONNATURE_ASSIGNMENT;
+-      if (isOperationValueModifying(op))
+-              return OPERATIONNATURE_MUTATING;
++    if (isOperationValueModifying(op))
++        return OPERATIONNATURE_MUTATING;
+-      return OPERATIONNATURE_PURE;
++    return OPERATIONNATURE_PURE;
+ }
+ // Input value loader.
+@@ -493,143 +493,143 @@ static OperationNature getOperationNature (MatrixOp op)
+ template <int InputT, int DataT>
+ typename TypeTraits<DataT>::Type getInputValue (const ShaderEvalContext& evalCtx, int inputNdx);
+-template <> inline float              getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT>                     (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInFloat[inputNdx];  }
+-template <> inline tcu::Vec2  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_VEC2>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec2[inputNdx];   }
+-template <> inline tcu::Vec3  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_VEC3>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec3[inputNdx];   }
+-template <> inline tcu::Vec4  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_VEC4>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec4[inputNdx];   }
+-
+-template <> inline tcu::Mat2  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT2>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat2(s_constInMat2x2[inputNdx]);              }
+-template <> inline tcu::Mat2x3        getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT2X3>      (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat2x3(s_constInMat2x3[inputNdx]);    }
+-template <> inline tcu::Mat2x4        getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT2X4>      (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat2x4(s_constInMat2x4[inputNdx]);    }
+-template <> inline tcu::Mat3x2        getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT3X2>      (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat3x2(s_constInMat3x2[inputNdx]);    }
+-template <> inline tcu::Mat3  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT3>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat3(s_constInMat3x3[inputNdx]);              }
+-template <> inline tcu::Mat3x4        getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT3X4>      (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat3x4(s_constInMat3x4[inputNdx]);    }
+-template <> inline tcu::Mat4x2        getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT4X2>      (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat4x2(s_constInMat4x2[inputNdx]);    }
+-template <> inline tcu::Mat4x3        getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT4X3>      (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat4x3(s_constInMat4x3[inputNdx]);    }
+-template <> inline tcu::Mat4  getInputValue<INPUTTYPE_CONST,          TYPE_FLOAT_MAT4>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat4(s_constInMat4x4[inputNdx]);              }
+-
+-template <> inline float              getInputValue<INPUTTYPE_DYNAMIC,        TYPE_FLOAT>                     (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.x();                                       }
+-template <> inline tcu::Vec2  getInputValue<INPUTTYPE_DYNAMIC,        TYPE_FLOAT_VEC2>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1);                     }
+-template <> inline tcu::Vec3  getInputValue<INPUTTYPE_DYNAMIC,        TYPE_FLOAT_VEC3>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1, 2);          }
+-template <> inline tcu::Vec4  getInputValue<INPUTTYPE_DYNAMIC,        TYPE_FLOAT_VEC4>        (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1, 2, 3);       }
++template <> inline float        getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT>         (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInFloat[inputNdx];  }
++template <> inline tcu::Vec2    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_VEC2>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec2[inputNdx];   }
++template <> inline tcu::Vec3    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_VEC3>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec3[inputNdx];   }
++template <> inline tcu::Vec4    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_VEC4>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return s_constInVec4[inputNdx];   }
++
++template <> inline tcu::Mat2    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT2>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat2(s_constInMat2x2[inputNdx]);      }
++template <> inline tcu::Mat2x3  getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT2X3>  (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat2x3(s_constInMat2x3[inputNdx]);    }
++template <> inline tcu::Mat2x4  getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT2X4>  (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat2x4(s_constInMat2x4[inputNdx]);    }
++template <> inline tcu::Mat3x2  getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT3X2>  (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat3x2(s_constInMat3x2[inputNdx]);    }
++template <> inline tcu::Mat3    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT3>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat3(s_constInMat3x3[inputNdx]);      }
++template <> inline tcu::Mat3x4  getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT3X4>  (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat3x4(s_constInMat3x4[inputNdx]);    }
++template <> inline tcu::Mat4x2  getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT4X2>  (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat4x2(s_constInMat4x2[inputNdx]);    }
++template <> inline tcu::Mat4x3  getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT4X3>  (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat4x3(s_constInMat4x3[inputNdx]);    }
++template <> inline tcu::Mat4    getInputValue<INPUTTYPE_CONST,      TYPE_FLOAT_MAT4>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(evalCtx); return tcu::Mat4(s_constInMat4x4[inputNdx]);      }
++
++template <> inline float        getInputValue<INPUTTYPE_DYNAMIC,    TYPE_FLOAT>         (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.x();                   }
++template <> inline tcu::Vec2    getInputValue<INPUTTYPE_DYNAMIC,    TYPE_FLOAT_VEC2>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1);         }
++template <> inline tcu::Vec3    getInputValue<INPUTTYPE_DYNAMIC,    TYPE_FLOAT_VEC3>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1, 2);      }
++template <> inline tcu::Vec4    getInputValue<INPUTTYPE_DYNAMIC,    TYPE_FLOAT_VEC4>    (const ShaderEvalContext& evalCtx, int inputNdx) { DE_UNREF(inputNdx); return evalCtx.coords.swizzle(0, 1, 2, 3);   }
+ template <> inline tcu::Mat2 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT2> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat2 m;
+-      m.setColumn(0, evalCtx.in[0].swizzle(0,1));
+-      m.setColumn(1, evalCtx.in[1].swizzle(0,1));
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat2 m;
++    m.setColumn(0, evalCtx.in[0].swizzle(0,1));
++    m.setColumn(1, evalCtx.in[1].swizzle(0,1));
++    return m;
+ }
+ template <> inline tcu::Mat2x3 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT2X3> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat2x3 m;
+-      m.setColumn(0, evalCtx.in[0].swizzle(0,1,2));
+-      m.setColumn(1, evalCtx.in[1].swizzle(0,1,2));
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat2x3 m;
++    m.setColumn(0, evalCtx.in[0].swizzle(0,1,2));
++    m.setColumn(1, evalCtx.in[1].swizzle(0,1,2));
++    return m;
+ }
+ template <> inline tcu::Mat2x4 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT2X4> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat2x4 m;
+-      m.setColumn(0, evalCtx.in[0]);
+-      m.setColumn(1, evalCtx.in[1]);
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat2x4 m;
++    m.setColumn(0, evalCtx.in[0]);
++    m.setColumn(1, evalCtx.in[1]);
++    return m;
+ }
+ template <> inline tcu::Mat3x2 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT3X2> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat3x2 m;
+-      m.setColumn(0, evalCtx.in[0].swizzle(0,1));
+-      m.setColumn(1, evalCtx.in[1].swizzle(0,1));
+-      m.setColumn(2, evalCtx.in[2].swizzle(0,1));
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat3x2 m;
++    m.setColumn(0, evalCtx.in[0].swizzle(0,1));
++    m.setColumn(1, evalCtx.in[1].swizzle(0,1));
++    m.setColumn(2, evalCtx.in[2].swizzle(0,1));
++    return m;
+ }
+ template <> inline tcu::Mat3 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT3> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat3 m;
+-      m.setColumn(0, evalCtx.in[0].swizzle(0,1,2));
+-      m.setColumn(1, evalCtx.in[1].swizzle(0,1,2));
+-      m.setColumn(2, evalCtx.in[2].swizzle(0,1,2));
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat3 m;
++    m.setColumn(0, evalCtx.in[0].swizzle(0,1,2));
++    m.setColumn(1, evalCtx.in[1].swizzle(0,1,2));
++    m.setColumn(2, evalCtx.in[2].swizzle(0,1,2));
++    return m;
+ }
+ template <> inline tcu::Mat3x4 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT3X4> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat3x4 m;
+-      m.setColumn(0, evalCtx.in[0]);
+-      m.setColumn(1, evalCtx.in[1]);
+-      m.setColumn(2, evalCtx.in[2]);
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat3x4 m;
++    m.setColumn(0, evalCtx.in[0]);
++    m.setColumn(1, evalCtx.in[1]);
++    m.setColumn(2, evalCtx.in[2]);
++    return m;
+ }
+ template <> inline tcu::Mat4x2 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT4X2> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat4x2 m;
+-      m.setColumn(0, evalCtx.in[0].swizzle(0,1));
+-      m.setColumn(1, evalCtx.in[1].swizzle(0,1));
+-      m.setColumn(2, evalCtx.in[2].swizzle(0,1));
+-      m.setColumn(3, evalCtx.in[3].swizzle(0,1));
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat4x2 m;
++    m.setColumn(0, evalCtx.in[0].swizzle(0,1));
++    m.setColumn(1, evalCtx.in[1].swizzle(0,1));
++    m.setColumn(2, evalCtx.in[2].swizzle(0,1));
++    m.setColumn(3, evalCtx.in[3].swizzle(0,1));
++    return m;
+ }
+ template <> inline tcu::Mat4x3 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT4X3> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat4x3 m;
+-      m.setColumn(0, evalCtx.in[0].swizzle(0,1,2));
+-      m.setColumn(1, evalCtx.in[1].swizzle(0,1,2));
+-      m.setColumn(2, evalCtx.in[2].swizzle(0,1,2));
+-      m.setColumn(3, evalCtx.in[3].swizzle(0,1,2));
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat4x3 m;
++    m.setColumn(0, evalCtx.in[0].swizzle(0,1,2));
++    m.setColumn(1, evalCtx.in[1].swizzle(0,1,2));
++    m.setColumn(2, evalCtx.in[2].swizzle(0,1,2));
++    m.setColumn(3, evalCtx.in[3].swizzle(0,1,2));
++    return m;
+ }
+ template <> inline tcu::Mat4 getInputValue<INPUTTYPE_DYNAMIC, TYPE_FLOAT_MAT4> (const ShaderEvalContext& evalCtx, int inputNdx)
+ {
+-      DE_UNREF(inputNdx); // Not used.
+-      tcu::Mat4 m;
+-      m.setColumn(0, evalCtx.in[0]);
+-      m.setColumn(1, evalCtx.in[1]);
+-      m.setColumn(2, evalCtx.in[2]);
+-      m.setColumn(3, evalCtx.in[3]);
+-      return m;
++    DE_UNREF(inputNdx); // Not used.
++    tcu::Mat4 m;
++    m.setColumn(0, evalCtx.in[0]);
++    m.setColumn(1, evalCtx.in[1]);
++    m.setColumn(2, evalCtx.in[2]);
++    m.setColumn(3, evalCtx.in[3]);
++    return m;
+ }
+ // Reduction from expression result to vec3.
+-inline tcu::Vec3 reduceToVec3 (const tcu::Vec2& value)                { return value.swizzle(0,1,0); }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Vec3& value)                { return value; }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Vec4& value)                { return tcu::Vec3(value.x(), value.y(), value.z()+value.w()); }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Mat2& value)                { return tcu::Vec3(value(0, 0), value(0, 1), value(1, 0)+value(1, 1)); }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Mat2x3& value)      { return value.getColumn(0) + value.getColumn(1); }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Mat2x4& value)      { return value.getColumn(0).swizzle(0,1,2) + value.getColumn(1).swizzle(1,2,3); }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Mat3x2& value)      { return tcu::Vec3(value(0,0)+value(1,0), value(0,1)+value(1,1), value(0,2)+value(1,2)); }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Mat3& value)                { return value.getColumn(0) + value.getColumn(1) + value.getColumn(2); }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Mat3x4& value)      { return value.getColumn(0).swizzle(0,1,2) + value.getColumn(1).swizzle(1,2,3) + value.getColumn(2).swizzle(2,3,0); }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Mat4x2& value)      { return tcu::Vec3(value(0,0)+value(1,0)+value(0,3), value(0,1)+value(1,1)+value(1,3), value(0,2)+value(1,2)); }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Mat4x3& value)      { return value.getColumn(0) + value.getColumn(1) + value.getColumn(2) + value.getColumn(3); }
+-inline tcu::Vec3 reduceToVec3 (const tcu::Mat4& value)                { return value.getColumn(0).swizzle(0,1,2) + value.getColumn(1).swizzle(1,2,3) + value.getColumn(2).swizzle(2,3,0) + value.getColumn(3).swizzle(3,0,1); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Vec2& value)      { return value.swizzle(0,1,0); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Vec3& value)      { return value; }
++inline tcu::Vec3 reduceToVec3 (const tcu::Vec4& value)      { return tcu::Vec3(value.x(), value.y(), value.z()+value.w()); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Mat2& value)      { return tcu::Vec3(value(0, 0), value(0, 1), value(1, 0)+value(1, 1)); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Mat2x3& value)    { return value.getColumn(0) + value.getColumn(1); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Mat2x4& value)    { return value.getColumn(0).swizzle(0,1,2) + value.getColumn(1).swizzle(1,2,3); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Mat3x2& value)    { return tcu::Vec3(value(0,0)+value(1,0), value(0,1)+value(1,1), value(0,2)+value(1,2)); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Mat3& value)      { return value.getColumn(0) + value.getColumn(1) + value.getColumn(2); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Mat3x4& value)    { return value.getColumn(0).swizzle(0,1,2) + value.getColumn(1).swizzle(1,2,3) + value.getColumn(2).swizzle(2,3,0); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Mat4x2& value)    { return tcu::Vec3(value(0,0)+value(1,0)+value(0,3), value(0,1)+value(1,1)+value(1,3), value(0,2)+value(1,2)); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Mat4x3& value)    { return value.getColumn(0) + value.getColumn(1) + value.getColumn(2) + value.getColumn(3); }
++inline tcu::Vec3 reduceToVec3 (const tcu::Mat4& value)      { return value.getColumn(0).swizzle(0,1,2) + value.getColumn(1).swizzle(1,2,3) + value.getColumn(2).swizzle(2,3,0) + value.getColumn(3).swizzle(3,0,1); }
+ // matrixCompMult
+ template <typename T, int Rows, int Cols>
+ tcu::Matrix<T, Rows, Cols> matrixCompMult (const tcu::Matrix<T, Rows, Cols>& a, const tcu::Matrix<T, Rows, Cols>& b)
+ {
+-      tcu::Matrix<T, Rows, Cols> retVal;
++    tcu::Matrix<T, Rows, Cols> retVal;
+-      for (int r = 0; r < Rows; ++r)
+-              for (int c = 0; c < Cols; ++c)
+-                      retVal(r,c) = a(r,c) * b(r, c);
++    for (int r = 0; r < Rows; ++r)
++        for (int c = 0; c < Cols; ++c)
++            retVal(r,c) = a(r,c) * b(r, c);
+-      return retVal;
++    return retVal;
+ }
+ // transpose
+@@ -637,13 +637,13 @@ tcu::Matrix<T, Rows, Cols> matrixCompMult (const tcu::Matrix<T, Rows, Cols>& a,
+ template <typename T, int Rows, int Cols>
+ tcu::Matrix<T, Cols, Rows> transpose (const tcu::Matrix<T, Rows, Cols>& mat)
+ {
+-      tcu::Matrix<T, Cols, Rows> retVal;
++    tcu::Matrix<T, Cols, Rows> retVal;
+-      for (int r = 0; r < Rows; ++r)
+-              for (int c = 0; c < Cols; ++c)
+-                      retVal(c, r) = mat(r, c);
++    for (int r = 0; r < Rows; ++r)
++        for (int c = 0; c < Cols; ++c)
++            retVal(c, r) = mat(r, c);
+-      return retVal;
++    return retVal;
+ }
+ // outerProduct
+@@ -651,13 +651,13 @@ tcu::Matrix<T, Cols, Rows> transpose (const tcu::Matrix<T, Rows, Cols>& mat)
+ template <typename T, int Rows, int Cols>
+ tcu::Matrix<T, Cols, Rows> outerProduct (const tcu::Vector<T, Cols>& a, const tcu::Vector<T, Rows>& b)
+ {
+-      tcu::Matrix<T, Rows, Cols> retVal;
++    tcu::Matrix<T, Rows, Cols> retVal;
+-      for (int r = 0; r < Rows; ++r)
+-              for (int c = 0; c < Cols; ++c)
+-                      retVal(r,c) = a[c] * b[r];
++    for (int r = 0; r < Rows; ++r)
++        for (int c = 0; c < Cols; ++c)
++            retVal(r,c) = a[c] * b[r];
+-      return transpose(retVal); // to gl-form (column-major)
++    return transpose(retVal); // to gl-form (column-major)
+ }
+ // Determinant
+@@ -668,51 +668,51 @@ float determinant (const tcu::Matrix<float, Size, Size>& mat);
+ template <>
+ float determinant<2> (const tcu::Matrix<float, 2, 2>& mat)
+ {
+-      return mat(0,0) * mat(1,1) - mat(1,0) * mat(0,1);
++    return mat(0,0) * mat(1,1) - mat(1,0) * mat(0,1);
+ }
+ template <>
+ float determinant<3> (const tcu::Matrix<float, 3, 3>& mat)
+ {
+-      return  + mat(0,0) * mat(1,1) * mat(2,2)
+-                      + mat(0,1) * mat(1,2) * mat(2,0)
+-                      + mat(0,2) * mat(1,0) * mat(2,1)
+-                      - mat(0,0) * mat(1,2) * mat(2,1)
+-                      - mat(0,1) * mat(1,0) * mat(2,2)
+-                      - mat(0,2) * mat(1,1) * mat(2,0);
++    return  + mat(0,0) * mat(1,1) * mat(2,2)
++            + mat(0,1) * mat(1,2) * mat(2,0)
++            + mat(0,2) * mat(1,0) * mat(2,1)
++            - mat(0,0) * mat(1,2) * mat(2,1)
++            - mat(0,1) * mat(1,0) * mat(2,2)
++            - mat(0,2) * mat(1,1) * mat(2,0);
+ }
+ template <>
+ float determinant<4> (const tcu::Matrix<float, 4, 4>& mat)
+ {
+-      const float minorMatrices[4][3*3] =
+-      {
+-              {
+-                      mat(1,1),       mat(2,1),       mat(3,1),
+-                      mat(1,2),       mat(2,2),       mat(3,2),
+-                      mat(1,3),       mat(2,3),       mat(3,3),
+-              },
+-              {
+-                      mat(1,0),       mat(2,0),       mat(3,0),
+-                      mat(1,2),       mat(2,2),       mat(3,2),
+-                      mat(1,3),       mat(2,3),       mat(3,3),
+-              },
+-              {
+-                      mat(1,0),       mat(2,0),       mat(3,0),
+-                      mat(1,1),       mat(2,1),       mat(3,1),
+-                      mat(1,3),       mat(2,3),       mat(3,3),
+-              },
+-              {
+-                      mat(1,0),       mat(2,0),       mat(3,0),
+-                      mat(1,1),       mat(2,1),       mat(3,1),
+-                      mat(1,2),       mat(2,2),       mat(3,2),
+-              }
+-      };
+-
+-      return  + mat(0,0) * determinant(tcu::Mat3(minorMatrices[0]))
+-                      - mat(0,1) * determinant(tcu::Mat3(minorMatrices[1]))
+-                      + mat(0,2) * determinant(tcu::Mat3(minorMatrices[2]))
+-                      - mat(0,3) * determinant(tcu::Mat3(minorMatrices[3]));
++    const float minorMatrices[4][3*3] =
++    {
++        {
++            mat(1,1),   mat(2,1),   mat(3,1),
++            mat(1,2),   mat(2,2),   mat(3,2),
++            mat(1,3),   mat(2,3),   mat(3,3),
++        },
++        {
++            mat(1,0),   mat(2,0),   mat(3,0),
++            mat(1,2),   mat(2,2),   mat(3,2),
++            mat(1,3),   mat(2,3),   mat(3,3),
++        },
++        {
++            mat(1,0),   mat(2,0),   mat(3,0),
++            mat(1,1),   mat(2,1),   mat(3,1),
++            mat(1,3),   mat(2,3),   mat(3,3),
++        },
++        {
++            mat(1,0),   mat(2,0),   mat(3,0),
++            mat(1,1),   mat(2,1),   mat(3,1),
++            mat(1,2),   mat(2,2),   mat(3,2),
++        }
++    };
++
++    return  + mat(0,0) * determinant(tcu::Mat3(minorMatrices[0]))
++            - mat(0,1) * determinant(tcu::Mat3(minorMatrices[1]))
++            + mat(0,2) * determinant(tcu::Mat3(minorMatrices[2]))
++            - mat(0,3) * determinant(tcu::Mat3(minorMatrices[3]));
+ }
+ // Inverse
+@@ -723,120 +723,120 @@ tcu::Matrix<float, Size, Size> inverse (const tcu::Matrix<float, Size, Size>& ma
+ template <>
+ tcu::Matrix<float, 2, 2> inverse<2> (const tcu::Matrix<float, 2, 2>& mat)
+ {
+-      const float                                     det             = determinant(mat);
+-      tcu::Matrix<float, 2, 2>        retVal;
++    const float                 det     = determinant(mat);
++    tcu::Matrix<float, 2, 2>    retVal;
+-      DE_ASSERT(det != 0.0f);
++    DE_ASSERT(det != 0.0f);
+-      retVal(0, 0) =  mat(1, 1) / det;
+-      retVal(0, 1) = -mat(0, 1) / det;
+-      retVal(1, 0) = -mat(1, 0) / det;
+-      retVal(1, 1) =  mat(0, 0) / det;
++    retVal(0, 0) =  mat(1, 1) / det;
++    retVal(0, 1) = -mat(0, 1) / det;
++    retVal(1, 0) = -mat(1, 0) / det;
++    retVal(1, 1) =  mat(0, 0) / det;
+-      return retVal;
++    return retVal;
+ }
+ template <>
+ tcu::Matrix<float, 3, 3> inverse<3> (const tcu::Matrix<float, 3, 3>& mat)
+ {
+-      // Blockwise inversion
+-
+-      DE_ASSERT(determinant(mat) != 0.0f);
+-
+-      const float areaA[2*2] =
+-      {
+-              mat(0,0),       mat(0,1),
+-              mat(1,0),       mat(1,1)
+-      };
+-      const float areaB[2] =
+-      {
+-              mat(0,2),
+-              mat(1,2),
+-      };
+-      const float areaC[2] =
+-      {
+-              mat(2,0),       mat(2,1),
+-      };
+-      const float areaD[1] =
+-      {
+-              mat(2,2)
+-      };
+-      const float nullField[4] = { 0.0f };
+-
+-      const tcu::Matrix<float, 2, 2>  invA = inverse(tcu::Matrix<float, 2, 2>(areaA));
+-      const tcu::Matrix<float, 2, 1>  matB =         tcu::Matrix<float, 2, 1>(areaB);
+-      const tcu::Matrix<float, 1, 2>  matC =         tcu::Matrix<float, 1, 2>(areaC);
+-      const tcu::Matrix<float, 1, 1>  matD =         tcu::Matrix<float, 1, 1>(areaD);
+-
+-      const float                                             schurComplement = 1.0f / (matD - matC*invA*matB)(0,0);
+-      const tcu::Matrix<float, 2, 2>  zeroMat         = Mat2(nullField);
+-
+-      const tcu::Matrix<float, 2, 2>  blockA = invA + invA*matB*schurComplement*matC*invA;
+-      const tcu::Matrix<float, 2, 1>  blockB = (zeroMat-invA)*matB*schurComplement;
+-      const tcu::Matrix<float, 1, 2>  blockC = matC*invA*(-schurComplement);
+-      const float                                             blockD = schurComplement;
+-
+-      const float result[3*3] =
+-      {
+-              blockA(0,0),    blockA(0,1),    blockB(0,0),
+-              blockA(1,0),    blockA(1,1),    blockB(1,0),
+-              blockC(0,0),    blockC(0,1),    blockD,
+-      };
+-
+-      return Mat3(result);
++    // Blockwise inversion
++
++    DE_ASSERT(determinant(mat) != 0.0f);
++
++    const float areaA[2*2] =
++    {
++        mat(0,0),   mat(0,1),
++        mat(1,0),   mat(1,1)
++    };
++    const float areaB[2] =
++    {
++        mat(0,2),
++        mat(1,2),
++    };
++    const float areaC[2] =
++    {
++        mat(2,0),   mat(2,1),
++    };
++    const float areaD[1] =
++    {
++        mat(2,2)
++    };
++    const float nullField[4] = { 0.0f };
++
++    const tcu::Matrix<float, 2, 2>  invA = inverse(tcu::Matrix<float, 2, 2>(areaA));
++    const tcu::Matrix<float, 2, 1>  matB =         tcu::Matrix<float, 2, 1>(areaB);
++    const tcu::Matrix<float, 1, 2>  matC =         tcu::Matrix<float, 1, 2>(areaC);
++    const tcu::Matrix<float, 1, 1>  matD =         tcu::Matrix<float, 1, 1>(areaD);
++
++    const float                     schurComplement = 1.0f / (matD - matC*invA*matB)(0,0);
++    const tcu::Matrix<float, 2, 2>  zeroMat         = Mat2(nullField);
++
++    const tcu::Matrix<float, 2, 2>  blockA = invA + invA*matB*schurComplement*matC*invA;
++    const tcu::Matrix<float, 2, 1>  blockB = (zeroMat-invA)*matB*schurComplement;
++    const tcu::Matrix<float, 1, 2>  blockC = matC*invA*(-schurComplement);
++    const float                     blockD = schurComplement;
++
++    const float result[3*3] =
++    {
++        blockA(0,0),    blockA(0,1),    blockB(0,0),
++        blockA(1,0),    blockA(1,1),    blockB(1,0),
++        blockC(0,0),    blockC(0,1),    blockD,
++    };
++
++    return Mat3(result);
+ }
+ template <>
+ tcu::Matrix<float, 4, 4> inverse<4> (const tcu::Matrix<float, 4, 4>& mat)
+ {
+-      // Blockwise inversion
+-
+-      DE_ASSERT(determinant(mat) != 0.0f);
+-
+-      const float areaA[2*2] =
+-      {
+-              mat(0,0),       mat(0,1),
+-              mat(1,0),       mat(1,1)
+-      };
+-      const float areaB[2*2] =
+-      {
+-              mat(0,2),       mat(0,3),
+-              mat(1,2),       mat(1,3)
+-      };
+-      const float areaC[2*2] =
+-      {
+-              mat(2,0),       mat(2,1),
+-              mat(3,0),       mat(3,1)
+-      };
+-      const float areaD[2*2] =
+-      {
+-              mat(2,2),       mat(2,3),
+-              mat(3,2),       mat(3,3)
+-      };
+-      const float nullField[4] = { 0.0f };
+-
+-      const tcu::Matrix<float, 2, 2> invA = inverse(Mat2(areaA));
+-      const tcu::Matrix<float, 2, 2> matB =         Mat2(areaB);
+-      const tcu::Matrix<float, 2, 2> matC =         Mat2(areaC);
+-      const tcu::Matrix<float, 2, 2> matD =         Mat2(areaD);
+-
+-      const tcu::Matrix<float, 2, 2> schurComplement = inverse(matD - matC*invA*matB);
+-      const tcu::Matrix<float, 2, 2> zeroMat         = Mat2(nullField);
+-
+-      const tcu::Matrix<float, 2, 2> blockA = invA + invA*matB*schurComplement*matC*invA;
+-      const tcu::Matrix<float, 2, 2> blockB = (zeroMat-invA)*matB*schurComplement;
+-      const tcu::Matrix<float, 2, 2> blockC = (zeroMat-schurComplement)*matC*invA;
+-      const tcu::Matrix<float, 2, 2> blockD = schurComplement;
+-
+-      const float result[4*4] =
+-      {
+-              blockA(0,0),    blockA(0,1),    blockB(0,0),    blockB(0,1),
+-              blockA(1,0),    blockA(1,1),    blockB(1,0),    blockB(1,1),
+-              blockC(0,0),    blockC(0,1),    blockD(0,0),    blockD(0,1),
+-              blockC(1,0),    blockC(1,1),    blockD(1,0),    blockD(1,1),
+-      };
+-
+-      return Mat4(result);
++    // Blockwise inversion
++
++    DE_ASSERT(determinant(mat) != 0.0f);
++
++    const float areaA[2*2] =
++    {
++        mat(0,0),   mat(0,1),
++        mat(1,0),   mat(1,1)
++    };
++    const float areaB[2*2] =
++    {
++        mat(0,2),   mat(0,3),
++        mat(1,2),   mat(1,3)
++    };
++    const float areaC[2*2] =
++    {
++        mat(2,0),   mat(2,1),
++        mat(3,0),   mat(3,1)
++    };
++    const float areaD[2*2] =
++    {
++        mat(2,2),   mat(2,3),
++        mat(3,2),   mat(3,3)
++    };
++    const float nullField[4] = { 0.0f };
++
++    const tcu::Matrix<float, 2, 2> invA = inverse(Mat2(areaA));
++    const tcu::Matrix<float, 2, 2> matB =         Mat2(areaB);
++    const tcu::Matrix<float, 2, 2> matC =         Mat2(areaC);
++    const tcu::Matrix<float, 2, 2> matD =         Mat2(areaD);
++
++    const tcu::Matrix<float, 2, 2> schurComplement = inverse(matD - matC*invA*matB);
++    const tcu::Matrix<float, 2, 2> zeroMat         = Mat2(nullField);
++
++    const tcu::Matrix<float, 2, 2> blockA = invA + invA*matB*schurComplement*matC*invA;
++    const tcu::Matrix<float, 2, 2> blockB = (zeroMat-invA)*matB*schurComplement;
++    const tcu::Matrix<float, 2, 2> blockC = (zeroMat-schurComplement)*matC*invA;
++    const tcu::Matrix<float, 2, 2> blockD = schurComplement;
++
++    const float result[4*4] =
++    {
++        blockA(0,0),    blockA(0,1),    blockB(0,0),    blockB(0,1),
++        blockA(1,0),    blockA(1,1),    blockB(1,0),    blockB(1,1),
++        blockC(0,0),    blockC(0,1),    blockD(0,0),    blockD(0,1),
++        blockC(1,0),    blockC(1,1),    blockD(1,0),    blockD(1,1),
++    };
++
++    return Mat4(result);
+ }
+ // negate
+@@ -844,13 +844,13 @@ tcu::Matrix<float, 4, 4> inverse<4> (const tcu::Matrix<float, 4, 4>& mat)
+ template <typename T, int Rows, int Cols>
+ tcu::Matrix<T, Rows, Cols> negate (const tcu::Matrix<T, Rows, Cols>& mat)
+ {
+-      tcu::Matrix<T, Rows, Cols> retVal;
++    tcu::Matrix<T, Rows, Cols> retVal;
+-      for (int r = 0; r < Rows; ++r)
+-              for (int c = 0; c < Cols; ++c)
+-                      retVal(r,c) = -mat(r, c);
++    for (int r = 0; r < Rows; ++r)
++        for (int c = 0; c < Cols; ++c)
++            retVal(r,c) = -mat(r, c);
+-      return retVal;
++    return retVal;
+ }
+ // increment/decrement
+@@ -858,25 +858,25 @@ tcu::Matrix<T, Rows, Cols> negate (const tcu::Matrix<T, Rows, Cols>& mat)
+ template <typename T, int Rows, int Cols>
+ tcu::Matrix<T, Rows, Cols> increment (const tcu::Matrix<T, Rows, Cols>& mat)
+ {
+-      tcu::Matrix<T, Rows, Cols> retVal;
++    tcu::Matrix<T, Rows, Cols> retVal;
+-      for (int r = 0; r < Rows; ++r)
+-              for (int c = 0; c < Cols; ++c)
+-                      retVal(r,c) = mat(r, c) + 1.0f;
++    for (int r = 0; r < Rows; ++r)
++        for (int c = 0; c < Cols; ++c)
++            retVal(r,c) = mat(r, c) + 1.0f;
+-      return retVal;
++    return retVal;
+ }
+ template <typename T, int Rows, int Cols>
+ tcu::Matrix<T, Rows, Cols> decrement (const tcu::Matrix<T, Rows, Cols>& mat)
+ {
+-      tcu::Matrix<T, Rows, Cols> retVal;
++    tcu::Matrix<T, Rows, Cols> retVal;
+-      for (int r = 0; r < Rows; ++r)
+-              for (int c = 0; c < Cols; ++c)
+-                      retVal(r,c) = mat(r, c) - 1.0f;
++    for (int r = 0; r < Rows; ++r)
++        for (int c = 0; c < Cols; ++c)
++            retVal(r,c) = mat(r, c) - 1.0f;
+-      return retVal;
++    return retVal;
+ }
+ // Evaluator template.
+@@ -889,423 +889,423 @@ struct Evaluator;
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_ADD, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              typename TypeTraits<In1DataType>::Type  in1     = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
+-              evalCtx.color.xyz() = reduceToVec3(in0 + in1);
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        typename TypeTraits<In1DataType>::Type  in1 = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
++        evalCtx.color.xyz() = reduceToVec3(in0 + in1);
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_SUB, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              typename TypeTraits<In1DataType>::Type  in1     = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
+-              evalCtx.color.xyz() = reduceToVec3(in0 - in1);
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        typename TypeTraits<In1DataType>::Type  in1 = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
++        evalCtx.color.xyz() = reduceToVec3(in0 - in1);
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_MUL, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              typename TypeTraits<In1DataType>::Type  in1     = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
+-              evalCtx.color.xyz() = reduceToVec3(in0 * in1);
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        typename TypeTraits<In1DataType>::Type  in1 = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
++        evalCtx.color.xyz() = reduceToVec3(in0 * in1);
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_DIV, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              typename TypeTraits<In1DataType>::Type  in1     = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
+-              evalCtx.color.xyz() = reduceToVec3(in0 / in1);
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        typename TypeTraits<In1DataType>::Type  in1 = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
++        evalCtx.color.xyz() = reduceToVec3(in0 / in1);
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_COMP_MUL, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              typename TypeTraits<In1DataType>::Type  in1     = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
+-              evalCtx.color.xyz() = reduceToVec3(matrixCompMult(in0, in1));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        typename TypeTraits<In1DataType>::Type  in1 = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
++        evalCtx.color.xyz() = reduceToVec3(matrixCompMult(in0, in1));
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_OUTER_PRODUCT, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              typename TypeTraits<In1DataType>::Type  in1     = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
+-              evalCtx.color.xyz() = reduceToVec3(outerProduct(in0, in1));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        typename TypeTraits<In1DataType>::Type  in1 = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
++        evalCtx.color.xyz() = reduceToVec3(outerProduct(in0, in1));
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_TRANSPOSE, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              DE_UNREF(in1Type);
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              evalCtx.color.xyz() = reduceToVec3(transpose(in0));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        DE_UNREF(in1Type);
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        evalCtx.color.xyz() = reduceToVec3(transpose(in0));
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_INVERSE, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              DE_UNREF(in1Type);
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              evalCtx.color.xyz() = reduceToVec3(inverse(in0));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        DE_UNREF(in1Type);
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        evalCtx.color.xyz() = reduceToVec3(inverse(in0));
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_DETERMINANT, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              DE_UNREF(in1Type);
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              evalCtx.color.xyz() = Vec3(determinant(in0));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        DE_UNREF(in1Type);
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        evalCtx.color.xyz() = Vec3(determinant(in0));
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_UNARY_PLUS, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              DE_UNREF(in1Type);
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              evalCtx.color.xyz() = reduceToVec3(in0);
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        DE_UNREF(in1Type);
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        evalCtx.color.xyz() = reduceToVec3(in0);
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_NEGATION, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              DE_UNREF(in1Type);
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              evalCtx.color.xyz() = reduceToVec3(negate(in0));
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        DE_UNREF(in1Type);
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        evalCtx.color.xyz() = reduceToVec3(negate(in0));
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_PRE_INCREMENT, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              DE_UNREF(in1Type);
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        DE_UNREF(in1Type);
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              // modifying reduction: sum modified value too
+-              evalCtx.color.xyz() = reduceToVec3(increment(in0)) + reduceToVec3(increment(in0));
+-      }
++        // modifying reduction: sum modified value too
++        evalCtx.color.xyz() = reduceToVec3(increment(in0)) + reduceToVec3(increment(in0));
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_PRE_DECREMENT, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              DE_UNREF(in1Type);
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        DE_UNREF(in1Type);
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              // modifying reduction: sum modified value too
+-              evalCtx.color.xyz() = reduceToVec3(decrement(in0)) + reduceToVec3(decrement(in0));
+-      }
++        // modifying reduction: sum modified value too
++        evalCtx.color.xyz() = reduceToVec3(decrement(in0)) + reduceToVec3(decrement(in0));
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_POST_INCREMENT, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              DE_UNREF(in1Type);
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        DE_UNREF(in1Type);
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              // modifying reduction: sum modified value too
+-              evalCtx.color.xyz() = reduceToVec3(in0) + reduceToVec3(increment(in0));
+-      }
++        // modifying reduction: sum modified value too
++        evalCtx.color.xyz() = reduceToVec3(in0) + reduceToVec3(increment(in0));
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_POST_DECREMENT, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              DE_UNREF(in1Type);
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        DE_UNREF(in1Type);
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              // modifying reduction: sum modified value too
+-              evalCtx.color.xyz() = reduceToVec3(in0) + reduceToVec3(decrement(in0));
+-      }
++        // modifying reduction: sum modified value too
++        evalCtx.color.xyz() = reduceToVec3(in0) + reduceToVec3(decrement(in0));
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_ADD_INTO, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              typename TypeTraits<In1DataType>::Type  in1     = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
+-              evalCtx.color.xyz() = reduceToVec3(in0 + in1);
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        typename TypeTraits<In1DataType>::Type  in1 = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
++        evalCtx.color.xyz() = reduceToVec3(in0 + in1);
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_SUBTRACT_FROM, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              typename TypeTraits<In1DataType>::Type  in1     = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
+-              evalCtx.color.xyz() = reduceToVec3(in0 - in1);
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        typename TypeTraits<In1DataType>::Type  in1 = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
++        evalCtx.color.xyz() = reduceToVec3(in0 - in1);
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_MULTIPLY_INTO, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              typename TypeTraits<In1DataType>::Type  in1     = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
+-              evalCtx.color.xyz() = reduceToVec3(in0 * in1);
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        typename TypeTraits<In1DataType>::Type  in1 = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
++        evalCtx.color.xyz() = reduceToVec3(in0 * in1);
++    }
+ };
+ template <int In0DataType, int In1DataType>
+ struct Evaluator<OP_DIVIDE_INTO, In0DataType, In1DataType>
+ {
+-      static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
+-      {
+-              typename TypeTraits<In0DataType>::Type  in0     = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
+-              typename TypeTraits<In1DataType>::Type  in1     = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
+-                                                                                                                                                                   : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
+-              evalCtx.color.xyz() = reduceToVec3(in0 / in1);
+-      }
++    static void evaluate (ShaderEvalContext& evalCtx, InputType in0Type, InputType in1Type)
++    {
++        typename TypeTraits<In0DataType>::Type  in0 = (in0Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In0DataType>(evalCtx, 0)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In0DataType>(evalCtx, 0);
++        typename TypeTraits<In1DataType>::Type  in1 = (in1Type == INPUTTYPE_DYNAMIC) ? getInputValue<INPUTTYPE_DYNAMIC, In1DataType>(evalCtx, 1)
++                                                                                     : getInputValue<INPUTTYPE_CONST,   In1DataType>(evalCtx, 1);
++        evalCtx.color.xyz() = reduceToVec3(in0 / in1);
++    }
+ };
+ MatrixShaderEvalFunc getEvalFunc (const ShaderInput& in0, const ShaderInput& in1, MatrixOp op)
+ {
+-      // Evaluator is selected based on op and input data types.
+-      // For efficient lookup the types and op enums are packed together to form a 19-bit key:
+-      // [18..14 OP] [13..7 TYPE0] [6..0 TYPE1]
+-
+-      DE_STATIC_ASSERT(TYPE_LAST      <= (1<<7));
+-      DE_STATIC_ASSERT(OP_LAST        <= (1<<5));
+-
+-#define PACK_EVAL_CASE(OP, IN0DATATYPE, IN1DATATYPE)  (((OP) << 14) | ((IN0DATATYPE) << 7) | (IN1DATATYPE))
+-
+-#define MAKE_EVAL_CASE(OP, IN0DATATYPE, IN1DATATYPE)  \
+-      case PACK_EVAL_CASE(OP, IN0DATATYPE, IN1DATATYPE):      \
+-              return Evaluator<OP, IN0DATATYPE, IN1DATATYPE>::evaluate
+-
+-#define MAKE_SCALAR_OPS(IN0DATATYPE, IN1DATATYPE)             \
+-      MAKE_EVAL_CASE(OP_ADD, IN0DATATYPE, IN1DATATYPE);       \
+-      MAKE_EVAL_CASE(OP_SUB, IN0DATATYPE, IN1DATATYPE);       \
+-      MAKE_EVAL_CASE(OP_MUL, IN0DATATYPE, IN1DATATYPE);       \
+-      MAKE_EVAL_CASE(OP_DIV, IN0DATATYPE, IN1DATATYPE)
+-
+-#define MAKE_CWISE_OPS(IN0DATATYPE, IN1DATATYPE)                      \
+-      MAKE_EVAL_CASE(OP_ADD,          IN0DATATYPE, IN1DATATYPE);      \
+-      MAKE_EVAL_CASE(OP_SUB,          IN0DATATYPE, IN1DATATYPE);      \
+-      MAKE_EVAL_CASE(OP_DIV,          IN0DATATYPE, IN1DATATYPE);      \
+-      MAKE_EVAL_CASE(OP_COMP_MUL,     IN0DATATYPE, IN1DATATYPE)
+-
+-#define MAKE_MUL_OP(IN0DATATYPE, IN1DATATYPE)                 \
+-      MAKE_EVAL_CASE(OP_MUL, IN0DATATYPE, IN1DATATYPE)
+-
+-#define MAKE_VECVEC_OP(IN0DATATYPE, IN1DATATYPE)                      \
+-      MAKE_EVAL_CASE(OP_OUTER_PRODUCT, IN0DATATYPE, IN1DATATYPE)
+-
+-#define MAKE_UNARY_OP(IN0DATATYPE)                                                            \
+-      MAKE_EVAL_CASE(OP_TRANSPOSE,            IN0DATATYPE, TYPE_LAST);        \
+-      MAKE_EVAL_CASE(OP_UNARY_PLUS,           IN0DATATYPE, TYPE_LAST);        \
+-      MAKE_EVAL_CASE(OP_NEGATION,                     IN0DATATYPE, TYPE_LAST);        \
+-      MAKE_EVAL_CASE(OP_PRE_INCREMENT,        IN0DATATYPE, TYPE_LAST);        \
+-      MAKE_EVAL_CASE(OP_PRE_DECREMENT,        IN0DATATYPE, TYPE_LAST);        \
+-      MAKE_EVAL_CASE(OP_POST_INCREMENT,       IN0DATATYPE, TYPE_LAST);        \
+-      MAKE_EVAL_CASE(OP_POST_DECREMENT,       IN0DATATYPE, TYPE_LAST)
+-
+-#define MAKE_UNARY_SYMMETRIC_OP(IN0DATATYPE)                                  \
+-      MAKE_UNARY_OP(IN0DATATYPE);                                                                     \
+-      MAKE_EVAL_CASE(OP_DETERMINANT,  IN0DATATYPE, TYPE_LAST);        \
+-      MAKE_EVAL_CASE(OP_INVERSE,              IN0DATATYPE, TYPE_LAST)
+-
+-#define MAKE_ASSIGNMENT_OP(IN0DATATYPE)                                                               \
+-      MAKE_EVAL_CASE(OP_ADD_INTO,                     IN0DATATYPE, IN0DATATYPE);      \
+-      MAKE_EVAL_CASE(OP_SUBTRACT_FROM,        IN0DATATYPE, IN0DATATYPE);      \
+-      MAKE_EVAL_CASE(OP_DIVIDE_INTO,          IN0DATATYPE, IN0DATATYPE)
+-
+-#define MAKE_ASSIGNMENT_SYMMETRIC_OP(IN0DATATYPE)                                     \
+-      MAKE_ASSIGNMENT_OP(IN0DATATYPE);                                                                \
+-      MAKE_EVAL_CASE(OP_MULTIPLY_INTO,        IN0DATATYPE, IN0DATATYPE)
+-
+-      switch (PACK_EVAL_CASE(op, in0.dataType, in1.dataType))
+-      {
+-              // Matrix-scalar.
+-              MAKE_SCALAR_OPS(TYPE_FLOAT_MAT2,        TYPE_FLOAT);
+-              MAKE_SCALAR_OPS(TYPE_FLOAT_MAT2X3,      TYPE_FLOAT);
+-              MAKE_SCALAR_OPS(TYPE_FLOAT_MAT2X4,      TYPE_FLOAT);
+-              MAKE_SCALAR_OPS(TYPE_FLOAT_MAT3X2,      TYPE_FLOAT);
+-              MAKE_SCALAR_OPS(TYPE_FLOAT_MAT3,        TYPE_FLOAT);
+-              MAKE_SCALAR_OPS(TYPE_FLOAT_MAT3X4,      TYPE_FLOAT);
+-              MAKE_SCALAR_OPS(TYPE_FLOAT_MAT4X2,      TYPE_FLOAT);
+-              MAKE_SCALAR_OPS(TYPE_FLOAT_MAT4X3,      TYPE_FLOAT);
+-              MAKE_SCALAR_OPS(TYPE_FLOAT_MAT4,        TYPE_FLOAT);
+-
+-              // Matrix-vector.
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2,    TYPE_FLOAT_VEC2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2X3,  TYPE_FLOAT_VEC2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2X4,  TYPE_FLOAT_VEC2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3X2,  TYPE_FLOAT_VEC3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3,    TYPE_FLOAT_VEC3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3X4,  TYPE_FLOAT_VEC3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4X2,  TYPE_FLOAT_VEC4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4X3,  TYPE_FLOAT_VEC4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4,    TYPE_FLOAT_VEC4);
+-
+-              // Vector-matrix.
+-              MAKE_MUL_OP(TYPE_FLOAT_VEC2, TYPE_FLOAT_MAT2);
+-              MAKE_MUL_OP(TYPE_FLOAT_VEC3, TYPE_FLOAT_MAT2X3);
+-              MAKE_MUL_OP(TYPE_FLOAT_VEC4, TYPE_FLOAT_MAT2X4);
+-              MAKE_MUL_OP(TYPE_FLOAT_VEC2, TYPE_FLOAT_MAT3X2);
+-              MAKE_MUL_OP(TYPE_FLOAT_VEC3, TYPE_FLOAT_MAT3);
+-              MAKE_MUL_OP(TYPE_FLOAT_VEC4, TYPE_FLOAT_MAT3X4);
+-              MAKE_MUL_OP(TYPE_FLOAT_VEC2, TYPE_FLOAT_MAT4X2);
+-              MAKE_MUL_OP(TYPE_FLOAT_VEC3, TYPE_FLOAT_MAT4X3);
+-              MAKE_MUL_OP(TYPE_FLOAT_VEC4, TYPE_FLOAT_MAT4);
+-
+-              // Matrix-matrix.
+-              MAKE_CWISE_OPS(TYPE_FLOAT_MAT2,         TYPE_FLOAT_MAT2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2,            TYPE_FLOAT_MAT2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2,            TYPE_FLOAT_MAT3X2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2,            TYPE_FLOAT_MAT4X2);
+-
+-              MAKE_CWISE_OPS(TYPE_FLOAT_MAT2X3,       TYPE_FLOAT_MAT2X3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2X3,          TYPE_FLOAT_MAT2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2X3,          TYPE_FLOAT_MAT3X2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2X3,          TYPE_FLOAT_MAT4X2);
+-
+-              MAKE_CWISE_OPS(TYPE_FLOAT_MAT2X4,       TYPE_FLOAT_MAT2X4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2X4,          TYPE_FLOAT_MAT2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2X4,          TYPE_FLOAT_MAT3X2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT2X4,          TYPE_FLOAT_MAT4X2);
+-
+-              MAKE_CWISE_OPS(TYPE_FLOAT_MAT3X2,       TYPE_FLOAT_MAT3X2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3X2,          TYPE_FLOAT_MAT2X3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3X2,          TYPE_FLOAT_MAT3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3X2,          TYPE_FLOAT_MAT4X3);
+-
+-              MAKE_CWISE_OPS(TYPE_FLOAT_MAT3,         TYPE_FLOAT_MAT3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3,            TYPE_FLOAT_MAT2X3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3,            TYPE_FLOAT_MAT3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3,            TYPE_FLOAT_MAT4X3);
+-
+-              MAKE_CWISE_OPS(TYPE_FLOAT_MAT3X4,       TYPE_FLOAT_MAT3X4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3X4,          TYPE_FLOAT_MAT2X3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3X4,          TYPE_FLOAT_MAT3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT3X4,          TYPE_FLOAT_MAT4X3);
+-
+-              MAKE_CWISE_OPS(TYPE_FLOAT_MAT4X2,       TYPE_FLOAT_MAT4X2);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4X2,          TYPE_FLOAT_MAT2X4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4X2,          TYPE_FLOAT_MAT3X4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4X2,          TYPE_FLOAT_MAT4);
+-
+-              MAKE_CWISE_OPS(TYPE_FLOAT_MAT4X3,       TYPE_FLOAT_MAT4X3);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4X3,          TYPE_FLOAT_MAT2X4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4X3,          TYPE_FLOAT_MAT3X4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4X3,          TYPE_FLOAT_MAT4);
+-
+-              MAKE_CWISE_OPS(TYPE_FLOAT_MAT4,         TYPE_FLOAT_MAT4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4,            TYPE_FLOAT_MAT2X4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4,            TYPE_FLOAT_MAT3X4);
+-              MAKE_MUL_OP(TYPE_FLOAT_MAT4,            TYPE_FLOAT_MAT4);
+-
+-              // Vector-vector.
+-              MAKE_VECVEC_OP(TYPE_FLOAT_VEC2,         TYPE_FLOAT_VEC2);
+-              MAKE_VECVEC_OP(TYPE_FLOAT_VEC2,         TYPE_FLOAT_VEC3);
+-              MAKE_VECVEC_OP(TYPE_FLOAT_VEC2,         TYPE_FLOAT_VEC4);
+-              MAKE_VECVEC_OP(TYPE_FLOAT_VEC3,         TYPE_FLOAT_VEC2);
+-              MAKE_VECVEC_OP(TYPE_FLOAT_VEC3,         TYPE_FLOAT_VEC3);
+-              MAKE_VECVEC_OP(TYPE_FLOAT_VEC3,         TYPE_FLOAT_VEC4);
+-              MAKE_VECVEC_OP(TYPE_FLOAT_VEC4,         TYPE_FLOAT_VEC2);
+-              MAKE_VECVEC_OP(TYPE_FLOAT_VEC4,         TYPE_FLOAT_VEC3);
+-              MAKE_VECVEC_OP(TYPE_FLOAT_VEC4,         TYPE_FLOAT_VEC4);
+-
+-              // Unary Matrix.
+-              MAKE_UNARY_SYMMETRIC_OP(TYPE_FLOAT_MAT2);
+-              MAKE_UNARY_OP(TYPE_FLOAT_MAT2X3);
+-              MAKE_UNARY_OP(TYPE_FLOAT_MAT2X4);
+-              MAKE_UNARY_OP(TYPE_FLOAT_MAT3X2);
+-              MAKE_UNARY_SYMMETRIC_OP(TYPE_FLOAT_MAT3);
+-              MAKE_UNARY_OP(TYPE_FLOAT_MAT3X4);
+-              MAKE_UNARY_OP(TYPE_FLOAT_MAT4X2);
+-              MAKE_UNARY_OP(TYPE_FLOAT_MAT4X3);
+-              MAKE_UNARY_SYMMETRIC_OP(TYPE_FLOAT_MAT4);
+-
+-              // Assignments
+-              MAKE_ASSIGNMENT_SYMMETRIC_OP(TYPE_FLOAT_MAT2);
+-              MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT2X3);
+-              MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT2X4);
+-              MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT3X2);
+-              MAKE_ASSIGNMENT_SYMMETRIC_OP(TYPE_FLOAT_MAT3);
+-              MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT3X4);
+-              MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT4X2);
+-              MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT4X3);
+-              MAKE_ASSIGNMENT_SYMMETRIC_OP(TYPE_FLOAT_MAT4);
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-                      return DE_NULL;
+-      }
++    // Evaluator is selected based on op and input data types.
++    // For efficient lookup the types and op enums are packed together to form a 19-bit key:
++    // [18..14 OP] [13..7 TYPE0] [6..0 TYPE1]
++
++    DE_STATIC_ASSERT(TYPE_LAST  <= (1<<7));
++    DE_STATIC_ASSERT(OP_LAST    <= (1<<5));
++
++#define PACK_EVAL_CASE(OP, IN0DATATYPE, IN1DATATYPE)    (((OP) << 14) | ((IN0DATATYPE) << 7) | (IN1DATATYPE))
++
++#define MAKE_EVAL_CASE(OP, IN0DATATYPE, IN1DATATYPE)    \
++    case PACK_EVAL_CASE(OP, IN0DATATYPE, IN1DATATYPE):  \
++        return Evaluator<OP, IN0DATATYPE, IN1DATATYPE>::evaluate
++
++#define MAKE_SCALAR_OPS(IN0DATATYPE, IN1DATATYPE)       \
++    MAKE_EVAL_CASE(OP_ADD, IN0DATATYPE, IN1DATATYPE);   \
++    MAKE_EVAL_CASE(OP_SUB, IN0DATATYPE, IN1DATATYPE);   \
++    MAKE_EVAL_CASE(OP_MUL, IN0DATATYPE, IN1DATATYPE);   \
++    MAKE_EVAL_CASE(OP_DIV, IN0DATATYPE, IN1DATATYPE)
++
++#define MAKE_CWISE_OPS(IN0DATATYPE, IN1DATATYPE)            \
++    MAKE_EVAL_CASE(OP_ADD,      IN0DATATYPE, IN1DATATYPE);  \
++    MAKE_EVAL_CASE(OP_SUB,      IN0DATATYPE, IN1DATATYPE);  \
++    MAKE_EVAL_CASE(OP_DIV,      IN0DATATYPE, IN1DATATYPE);  \
++    MAKE_EVAL_CASE(OP_COMP_MUL, IN0DATATYPE, IN1DATATYPE)
++
++#define MAKE_MUL_OP(IN0DATATYPE, IN1DATATYPE)           \
++    MAKE_EVAL_CASE(OP_MUL, IN0DATATYPE, IN1DATATYPE)
++
++#define MAKE_VECVEC_OP(IN0DATATYPE, IN1DATATYPE)            \
++    MAKE_EVAL_CASE(OP_OUTER_PRODUCT, IN0DATATYPE, IN1DATATYPE)
++
++#define MAKE_UNARY_OP(IN0DATATYPE)                              \
++    MAKE_EVAL_CASE(OP_TRANSPOSE,        IN0DATATYPE, TYPE_LAST);    \
++    MAKE_EVAL_CASE(OP_UNARY_PLUS,       IN0DATATYPE, TYPE_LAST);    \
++    MAKE_EVAL_CASE(OP_NEGATION,         IN0DATATYPE, TYPE_LAST);    \
++    MAKE_EVAL_CASE(OP_PRE_INCREMENT,    IN0DATATYPE, TYPE_LAST);    \
++    MAKE_EVAL_CASE(OP_PRE_DECREMENT,    IN0DATATYPE, TYPE_LAST);    \
++    MAKE_EVAL_CASE(OP_POST_INCREMENT,   IN0DATATYPE, TYPE_LAST);    \
++    MAKE_EVAL_CASE(OP_POST_DECREMENT,   IN0DATATYPE, TYPE_LAST)
++
++#define MAKE_UNARY_SYMMETRIC_OP(IN0DATATYPE)                    \
++    MAKE_UNARY_OP(IN0DATATYPE);                                 \
++    MAKE_EVAL_CASE(OP_DETERMINANT,  IN0DATATYPE, TYPE_LAST);    \
++    MAKE_EVAL_CASE(OP_INVERSE,      IN0DATATYPE, TYPE_LAST)
++
++#define MAKE_ASSIGNMENT_OP(IN0DATATYPE)                             \
++    MAKE_EVAL_CASE(OP_ADD_INTO,         IN0DATATYPE, IN0DATATYPE);  \
++    MAKE_EVAL_CASE(OP_SUBTRACT_FROM,    IN0DATATYPE, IN0DATATYPE);  \
++    MAKE_EVAL_CASE(OP_DIVIDE_INTO,      IN0DATATYPE, IN0DATATYPE)
++
++#define MAKE_ASSIGNMENT_SYMMETRIC_OP(IN0DATATYPE)                   \
++    MAKE_ASSIGNMENT_OP(IN0DATATYPE);                                \
++    MAKE_EVAL_CASE(OP_MULTIPLY_INTO,    IN0DATATYPE, IN0DATATYPE)
++
++    switch (PACK_EVAL_CASE(op, in0.dataType, in1.dataType))
++    {
++        // Matrix-scalar.
++        MAKE_SCALAR_OPS(TYPE_FLOAT_MAT2,    TYPE_FLOAT);
++        MAKE_SCALAR_OPS(TYPE_FLOAT_MAT2X3,  TYPE_FLOAT);
++        MAKE_SCALAR_OPS(TYPE_FLOAT_MAT2X4,  TYPE_FLOAT);
++        MAKE_SCALAR_OPS(TYPE_FLOAT_MAT3X2,  TYPE_FLOAT);
++        MAKE_SCALAR_OPS(TYPE_FLOAT_MAT3,    TYPE_FLOAT);
++        MAKE_SCALAR_OPS(TYPE_FLOAT_MAT3X4,  TYPE_FLOAT);
++        MAKE_SCALAR_OPS(TYPE_FLOAT_MAT4X2,  TYPE_FLOAT);
++        MAKE_SCALAR_OPS(TYPE_FLOAT_MAT4X3,  TYPE_FLOAT);
++        MAKE_SCALAR_OPS(TYPE_FLOAT_MAT4,    TYPE_FLOAT);
++
++        // Matrix-vector.
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2,    TYPE_FLOAT_VEC2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2X3,  TYPE_FLOAT_VEC2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2X4,  TYPE_FLOAT_VEC2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3X2,  TYPE_FLOAT_VEC3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3,    TYPE_FLOAT_VEC3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3X4,  TYPE_FLOAT_VEC3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4X2,  TYPE_FLOAT_VEC4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4X3,  TYPE_FLOAT_VEC4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4,    TYPE_FLOAT_VEC4);
++
++        // Vector-matrix.
++        MAKE_MUL_OP(TYPE_FLOAT_VEC2, TYPE_FLOAT_MAT2);
++        MAKE_MUL_OP(TYPE_FLOAT_VEC3, TYPE_FLOAT_MAT2X3);
++        MAKE_MUL_OP(TYPE_FLOAT_VEC4, TYPE_FLOAT_MAT2X4);
++        MAKE_MUL_OP(TYPE_FLOAT_VEC2, TYPE_FLOAT_MAT3X2);
++        MAKE_MUL_OP(TYPE_FLOAT_VEC3, TYPE_FLOAT_MAT3);
++        MAKE_MUL_OP(TYPE_FLOAT_VEC4, TYPE_FLOAT_MAT3X4);
++        MAKE_MUL_OP(TYPE_FLOAT_VEC2, TYPE_FLOAT_MAT4X2);
++        MAKE_MUL_OP(TYPE_FLOAT_VEC3, TYPE_FLOAT_MAT4X3);
++        MAKE_MUL_OP(TYPE_FLOAT_VEC4, TYPE_FLOAT_MAT4);
++
++        // Matrix-matrix.
++        MAKE_CWISE_OPS(TYPE_FLOAT_MAT2,     TYPE_FLOAT_MAT2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2,        TYPE_FLOAT_MAT2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2,        TYPE_FLOAT_MAT3X2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2,        TYPE_FLOAT_MAT4X2);
++
++        MAKE_CWISE_OPS(TYPE_FLOAT_MAT2X3,   TYPE_FLOAT_MAT2X3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2X3,      TYPE_FLOAT_MAT2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2X3,      TYPE_FLOAT_MAT3X2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2X3,      TYPE_FLOAT_MAT4X2);
++
++        MAKE_CWISE_OPS(TYPE_FLOAT_MAT2X4,   TYPE_FLOAT_MAT2X4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2X4,      TYPE_FLOAT_MAT2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2X4,      TYPE_FLOAT_MAT3X2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT2X4,      TYPE_FLOAT_MAT4X2);
++
++        MAKE_CWISE_OPS(TYPE_FLOAT_MAT3X2,   TYPE_FLOAT_MAT3X2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3X2,      TYPE_FLOAT_MAT2X3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3X2,      TYPE_FLOAT_MAT3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3X2,      TYPE_FLOAT_MAT4X3);
++
++        MAKE_CWISE_OPS(TYPE_FLOAT_MAT3,     TYPE_FLOAT_MAT3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3,        TYPE_FLOAT_MAT2X3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3,        TYPE_FLOAT_MAT3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3,        TYPE_FLOAT_MAT4X3);
++
++        MAKE_CWISE_OPS(TYPE_FLOAT_MAT3X4,   TYPE_FLOAT_MAT3X4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3X4,      TYPE_FLOAT_MAT2X3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3X4,      TYPE_FLOAT_MAT3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT3X4,      TYPE_FLOAT_MAT4X3);
++
++        MAKE_CWISE_OPS(TYPE_FLOAT_MAT4X2,   TYPE_FLOAT_MAT4X2);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4X2,      TYPE_FLOAT_MAT2X4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4X2,      TYPE_FLOAT_MAT3X4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4X2,      TYPE_FLOAT_MAT4);
++
++        MAKE_CWISE_OPS(TYPE_FLOAT_MAT4X3,   TYPE_FLOAT_MAT4X3);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4X3,      TYPE_FLOAT_MAT2X4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4X3,      TYPE_FLOAT_MAT3X4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4X3,      TYPE_FLOAT_MAT4);
++
++        MAKE_CWISE_OPS(TYPE_FLOAT_MAT4,     TYPE_FLOAT_MAT4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4,        TYPE_FLOAT_MAT2X4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4,        TYPE_FLOAT_MAT3X4);
++        MAKE_MUL_OP(TYPE_FLOAT_MAT4,        TYPE_FLOAT_MAT4);
++
++        // Vector-vector.
++        MAKE_VECVEC_OP(TYPE_FLOAT_VEC2,     TYPE_FLOAT_VEC2);
++        MAKE_VECVEC_OP(TYPE_FLOAT_VEC2,     TYPE_FLOAT_VEC3);
++        MAKE_VECVEC_OP(TYPE_FLOAT_VEC2,     TYPE_FLOAT_VEC4);
++        MAKE_VECVEC_OP(TYPE_FLOAT_VEC3,     TYPE_FLOAT_VEC2);
++        MAKE_VECVEC_OP(TYPE_FLOAT_VEC3,     TYPE_FLOAT_VEC3);
++        MAKE_VECVEC_OP(TYPE_FLOAT_VEC3,     TYPE_FLOAT_VEC4);
++        MAKE_VECVEC_OP(TYPE_FLOAT_VEC4,     TYPE_FLOAT_VEC2);
++        MAKE_VECVEC_OP(TYPE_FLOAT_VEC4,     TYPE_FLOAT_VEC3);
++        MAKE_VECVEC_OP(TYPE_FLOAT_VEC4,     TYPE_FLOAT_VEC4);
++
++        // Unary Matrix.
++        MAKE_UNARY_SYMMETRIC_OP(TYPE_FLOAT_MAT2);
++        MAKE_UNARY_OP(TYPE_FLOAT_MAT2X3);
++        MAKE_UNARY_OP(TYPE_FLOAT_MAT2X4);
++        MAKE_UNARY_OP(TYPE_FLOAT_MAT3X2);
++        MAKE_UNARY_SYMMETRIC_OP(TYPE_FLOAT_MAT3);
++        MAKE_UNARY_OP(TYPE_FLOAT_MAT3X4);
++        MAKE_UNARY_OP(TYPE_FLOAT_MAT4X2);
++        MAKE_UNARY_OP(TYPE_FLOAT_MAT4X3);
++        MAKE_UNARY_SYMMETRIC_OP(TYPE_FLOAT_MAT4);
++
++        // Assignments
++        MAKE_ASSIGNMENT_SYMMETRIC_OP(TYPE_FLOAT_MAT2);
++        MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT2X3);
++        MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT2X4);
++        MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT3X2);
++        MAKE_ASSIGNMENT_SYMMETRIC_OP(TYPE_FLOAT_MAT3);
++        MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT3X4);
++        MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT4X2);
++        MAKE_ASSIGNMENT_OP(TYPE_FLOAT_MAT4X3);
++        MAKE_ASSIGNMENT_SYMMETRIC_OP(TYPE_FLOAT_MAT4);
++
++        default:
++            DE_ASSERT(DE_FALSE);
++            return DE_NULL;
++    }
+ #undef PACK_EVAL_CASE
+ #undef MAKE_EVAL_CASE
+@@ -1320,35 +1320,35 @@ MatrixShaderEvalFunc getEvalFunc (const ShaderInput& in0, const ShaderInput& in1
+ template <int Size>
+ void writeVectorConstructor (std::ostream& str, const tcu::Vector<float, Size>& v)
+ {
+-      str << "vec" << Size << "(";
+-      for (int ndx = 0; ndx < Size; ndx++)
+-      {
+-              if (ndx != 0)
+-                      str << ", ";
+-              str << de::floatToString(v[ndx], 1);
+-      }
+-      str << ")";
++    str << "vec" << Size << "(";
++    for (int ndx = 0; ndx < Size; ndx++)
++    {
++        if (ndx != 0)
++            str << ", ";
++        str << de::floatToString(v[ndx], 1);
++    }
++    str << ")";
+ }
+ template <int Cols, int Rows>
+ void writeMatrixConstructor (std::ostream& str, const tcu::Matrix<float, Rows, Cols>& m)
+ {
+-      if (Rows == Cols)
+-              str << "mat" << Cols;
+-      else
+-              str << "mat" << Cols << "x" << Rows;
+-
+-      str << "(";
+-      for (int colNdx = 0; colNdx < Cols; colNdx++)
+-      {
+-              for (int rowNdx = 0; rowNdx < Rows; rowNdx++)
+-              {
+-                      if (rowNdx > 0 || colNdx > 0)
+-                              str << ", ";
+-                      str << de::floatToString(m(rowNdx, colNdx), 1);
+-              }
+-      }
+-      str << ")";
++    if (Rows == Cols)
++        str << "mat" << Cols;
++    else
++        str << "mat" << Cols << "x" << Rows;
++
++    str << "(";
++    for (int colNdx = 0; colNdx < Cols; colNdx++)
++    {
++        for (int rowNdx = 0; rowNdx < Rows; rowNdx++)
++        {
++            if (rowNdx > 0 || colNdx > 0)
++                str << ", ";
++            str << de::floatToString(m(rowNdx, colNdx), 1);
++        }
++    }
++    str << ")";
+ }
+ } // MatrixCaseUtils
+@@ -1358,53 +1358,53 @@ using namespace MatrixCaseUtils;
+ class MatrixShaderEvaluator : public ShaderEvaluator
+ {
+ public:
+-                                                      MatrixShaderEvaluator   (MatrixShaderEvalFunc evalFunc, InputType inType0, InputType inType1);
++                            MatrixShaderEvaluator   (MatrixShaderEvalFunc evalFunc, InputType inType0, InputType inType1);
+-      virtual void                    evaluate                                (ShaderEvalContext& evalCtx);
++    virtual void            evaluate                (ShaderEvalContext& evalCtx);
+ private:
+-      MatrixShaderEvalFunc    m_matEvalFunc;
+-      InputType                               m_inType0;
+-      InputType                               m_inType1;
++    MatrixShaderEvalFunc    m_matEvalFunc;
++    InputType               m_inType0;
++    InputType               m_inType1;
+ };
+ MatrixShaderEvaluator::MatrixShaderEvaluator (MatrixShaderEvalFunc evalFunc, InputType inType0, InputType inType1)
+-      : m_matEvalFunc (evalFunc)
+-      , m_inType0             (inType0)
+-      , m_inType1             (inType1)
++    : m_matEvalFunc (evalFunc)
++    , m_inType0     (inType0)
++    , m_inType1     (inType1)
+ {
+ }
+ void MatrixShaderEvaluator::evaluate (ShaderEvalContext& evalCtx)
+ {
+-      m_matEvalFunc(evalCtx, m_inType0, m_inType1);
++    m_matEvalFunc(evalCtx, m_inType0, m_inType1);
+ }
+ class ShaderMatrixCase : public ShaderRenderCase
+ {
+ public:
+-                                                      ShaderMatrixCase                        (Context& context, const char* name, const char* desc, const ShaderInput& in0, const ShaderInput& in1, MatrixOp op, bool isVertexCase);
+-                                                      ~ShaderMatrixCase                       (void);
++                            ShaderMatrixCase            (Context& context, const char* name, const char* desc, const ShaderInput& in0, const ShaderInput& in1, MatrixOp op, bool isVertexCase);
++                            ~ShaderMatrixCase           (void);
+-      void                                    init                                            (void);
++    void                    init                        (void);
+ protected:
+-      std::string                             genGLSLMatToVec3Reduction       (const glu::DataType& matType, const char* varName);
+-      void                                    setupUniforms                           (int programID, const tcu::Vec4& constCoords);
++    std::string             genGLSLMatToVec3Reduction   (const glu::DataType& matType, const char* varName);
++    void                    setupUniforms               (int programID, const tcu::Vec4& constCoords);
+ private:
+-      ShaderInput                             m_in0;
+-      ShaderInput                             m_in1;
+-      MatrixOp                                m_op;
+-      MatrixShaderEvaluator   m_matEvaluator;
++    ShaderInput             m_in0;
++    ShaderInput             m_in1;
++    MatrixOp                m_op;
++    MatrixShaderEvaluator   m_matEvaluator;
+ };
+ ShaderMatrixCase::ShaderMatrixCase (Context& context, const char* name, const char* desc, const ShaderInput& in0, const ShaderInput& in1, MatrixOp op, bool isVertexCase)
+-      : ShaderRenderCase      (context.getTestContext(), context.getRenderContext(), context.getContextInfo(), name, desc, isVertexCase, m_matEvaluator)
+-      , m_in0                         (in0)
+-      , m_in1                         (in1)
+-      , m_op                          (op)
+-      , m_matEvaluator        (getEvalFunc(in0, in1, op), in0.inputType, in1.inputType)
++    : ShaderRenderCase  (context.getTestContext(), context.getRenderContext(), context.getContextInfo(), name, desc, isVertexCase, m_matEvaluator)
++    , m_in0             (in0)
++    , m_in1             (in1)
++    , m_op              (op)
++    , m_matEvaluator    (getEvalFunc(in0, in1, op), in0.inputType, in1.inputType)
+ {
+ }
+@@ -1414,374 +1414,374 @@ ShaderMatrixCase::~ShaderMatrixCase (void)
+ void ShaderMatrixCase::init (void)
+ {
+-      std::ostringstream      vtx;
+-      std::ostringstream      frag;
+-      std::ostringstream&     op                              = m_isVertexCase ? vtx : frag;
+-
+-      bool                            isInDynMat0             = isDataTypeMatrix(m_in0.dataType) && m_in0.inputType == INPUTTYPE_DYNAMIC;
+-      bool                            isInDynMat1             = isDataTypeMatrix(m_in1.dataType) && m_in1.inputType == INPUTTYPE_DYNAMIC;
+-      string                          inValue0;
+-      string                          inValue1;
+-      DataType                        resultType              = TYPE_LAST;
+-      Precision                       resultPrec              = m_in0.precision;
+-      vector<string>          passVars;
+-      int                                     numInputs               = (isOperationBinary(m_op)) ? (2) : (1);
+-
+-      std::string                     operationValue0;
+-      std::string                     operationValue1;
+-
+-      DE_ASSERT(!isInDynMat0 || !isInDynMat1); // Only single dynamic matrix input is allowed.
+-      DE_UNREF(isInDynMat0 && isInDynMat1);
+-
+-      // Compute result type.
+-      if (m_op == OP_MUL && isDataTypeMatrix(m_in0.dataType) && isDataTypeMatrix(m_in1.dataType))
+-      {
+-              resultType = getDataTypeMatrix(getDataTypeMatrixNumColumns(m_in1.dataType), getDataTypeMatrixNumRows(m_in0.dataType));
+-      }
+-      else if (m_op == OP_OUTER_PRODUCT)
+-      {
+-              resultType = getDataTypeMatrix(getDataTypeScalarSize(m_in1.dataType), getDataTypeScalarSize(m_in0.dataType));
+-      }
+-      else if (m_op == OP_TRANSPOSE)
+-      {
+-              resultType = getDataTypeMatrix(getDataTypeMatrixNumRows(m_in0.dataType), getDataTypeMatrixNumColumns(m_in0.dataType));
+-      }
+-      else if (m_op == OP_INVERSE)
+-      {
+-              resultType = m_in0.dataType;
+-      }
+-      else if (m_op == OP_DETERMINANT)
+-      {
+-              resultType = TYPE_FLOAT;
+-      }
+-      else if (getOperationType(m_op) == OPERATIONTYPE_UNARY_PREFIX_OPERATOR ||
+-                       getOperationType(m_op) == OPERATIONTYPE_UNARY_POSTFIX_OPERATOR)
+-      {
+-              resultType = m_in0.dataType;
+-      }
+-      else if (isDataTypeMatrix(m_in0.dataType) && isDataTypeMatrix(m_in1.dataType))
+-      {
+-              DE_ASSERT(m_in0.dataType == m_in1.dataType);
+-              resultType = m_in0.dataType;
+-      }
+-      else if (isDataTypeMatrix(m_in0.dataType) || isDataTypeMatrix(m_in1.dataType))
+-      {
+-              int                     matNdx          = isDataTypeMatrix(m_in0.dataType) ? 0 : 1;
+-              DataType        matrixType      = matNdx == 0 ? m_in0.dataType : m_in1.dataType;
+-              DataType        otherType       = matNdx == 0 ? m_in1.dataType : m_in0.dataType;
+-
+-              if (otherType == TYPE_FLOAT)
+-                      resultType = matrixType;
+-              else
+-              {
+-                      DE_ASSERT(isDataTypeVector(otherType));
+-                      resultType = getDataTypeFloatVec(matNdx == 0 ? getDataTypeMatrixNumRows(matrixType) : getDataTypeMatrixNumColumns(matrixType));
+-              }
+-      }
+-      else
+-      {
+-              DE_ASSERT(DE_FALSE);
+-      }
+-
+-      vtx << "#version 300 es\n";
+-      frag << "#version 300 es\n";
+-
+-      vtx << "in highp vec4 a_position;\n";
+-      frag << "layout(location = 0) out mediump vec4 dEQP_FragColor;\n";
+-      if (m_isVertexCase)
+-      {
+-              vtx << "out mediump vec4 v_color;\n";
+-              frag << "in mediump vec4 v_color;\n";
+-      }
+-
+-      // Input declarations.
+-      for (int inNdx = 0; inNdx < numInputs; inNdx++)
+-      {
+-              const ShaderInput&      in                      = inNdx > 0 ? m_in1 : m_in0;
+-              const char*                     precName        = getPrecisionName(in.precision);
+-              const char*                     typeName        = getDataTypeName(in.dataType);
+-              string&                         inValue         = inNdx > 0 ? inValue1 : inValue0;
+-
+-              if (in.inputType == INPUTTYPE_DYNAMIC)
+-              {
+-                      vtx << "in " << precName << " " << typeName << " a_";
+-
+-                      if (isDataTypeMatrix(in.dataType))
+-                      {
+-                              // a_matN, v_matN
+-                              vtx << typeName << ";\n";
+-                              if (!m_isVertexCase)
+-                              {
+-                                      vtx << "out " << precName << " " << typeName << " v_" << typeName << ";\n";
+-                                      frag << "in " << precName << " " << typeName << " v_" << typeName << ";\n";
+-                                      passVars.push_back(typeName);
+-                              }
+-
+-                              inValue = string(m_isVertexCase ? "a_" : "v_") + getDataTypeName(in.dataType);
+-                      }
+-                      else
+-                      {
+-                              // a_coords, v_coords
+-                              vtx << "coords;\n";
+-                              if (!m_isVertexCase)
+-                              {
+-                                      vtx << "out " << precName << " " << typeName << " v_coords;\n";
+-                                      frag << "in " << precName << " " << typeName << " v_coords;\n";
+-                                      passVars.push_back("coords");
+-                              }
+-
+-                              inValue = m_isVertexCase ? "a_coords" : "v_coords";
+-                      }
+-              }
+-              else if (in.inputType == INPUTTYPE_UNIFORM)
+-              {
+-                      op << "uniform " << precName << " " << typeName << " u_in" << inNdx << ";\n";
+-                      inValue = string("u_in") + de::toString(inNdx);
+-              }
+-              else if (in.inputType == INPUTTYPE_CONST)
+-              {
+-                      op << "const " << precName << " " << typeName << " in" << inNdx << " = ";
+-
+-                      // Generate declaration.
+-                      switch (in.dataType)
+-                      {
+-                              case TYPE_FLOAT:                op << de::floatToString(s_constInFloat[inNdx], 1);                                      break;
+-                              case TYPE_FLOAT_VEC2:   writeVectorConstructor<2>(op, s_constInVec2[inNdx]);                            break;
+-                              case TYPE_FLOAT_VEC3:   writeVectorConstructor<3>(op, s_constInVec3[inNdx]);                            break;
+-                              case TYPE_FLOAT_VEC4:   writeVectorConstructor<4>(op, s_constInVec4[inNdx]);                            break;
+-                              case TYPE_FLOAT_MAT2:   writeMatrixConstructor<2, 2>(op, Mat2(s_constInMat2x2[inNdx]));         break;
+-                              case TYPE_FLOAT_MAT2X3: writeMatrixConstructor<2, 3>(op, Mat2x3(s_constInMat2x3[inNdx]));       break;
+-                              case TYPE_FLOAT_MAT2X4: writeMatrixConstructor<2, 4>(op, Mat2x4(s_constInMat2x4[inNdx]));       break;
+-                              case TYPE_FLOAT_MAT3X2: writeMatrixConstructor<3, 2>(op, Mat3x2(s_constInMat3x2[inNdx]));       break;
+-                              case TYPE_FLOAT_MAT3:   writeMatrixConstructor<3, 3>(op, Mat3(s_constInMat3x3[inNdx]));         break;
+-                              case TYPE_FLOAT_MAT3X4: writeMatrixConstructor<3, 4>(op, Mat3x4(s_constInMat3x4[inNdx]));       break;
+-                              case TYPE_FLOAT_MAT4X2: writeMatrixConstructor<4, 2>(op, Mat4x2(s_constInMat4x2[inNdx]));       break;
+-                              case TYPE_FLOAT_MAT4X3: writeMatrixConstructor<4, 3>(op, Mat4x3(s_constInMat4x3[inNdx]));       break;
+-                              case TYPE_FLOAT_MAT4:   writeMatrixConstructor<4, 4>(op, Mat4(s_constInMat4x4[inNdx]));         break;
+-
+-                              default:
+-                                      DE_ASSERT(DE_FALSE);
+-                      }
+-
+-                      op << ";\n";
+-
+-                      inValue = string("in") + de::toString(inNdx);
+-              }
+-      }
+-
+-      vtx << "\n"
+-              << "void main (void)\n"
+-              << "{\n"
+-              << "    gl_Position = a_position;\n";
+-      frag << "\n"
+-               << "void main (void)\n"
+-               << "{\n";
+-
+-      if (m_isVertexCase)
+-              frag << "       dEQP_FragColor = v_color;\n";
+-      else
+-      {
+-              for (vector<string>::const_iterator copyIter = passVars.begin(); copyIter != passVars.end(); copyIter++)
+-                      vtx << "        v_" << *copyIter << " = " << "a_" << *copyIter << ";\n";
+-      }
+-
+-      // Operation.
+-
+-      switch (getOperationNature(m_op))
+-      {
+-              case OPERATIONNATURE_PURE:
+-                      DE_ASSERT(getOperationType(m_op) != OPERATIONTYPE_ASSIGNMENT);
+-
+-                      operationValue0 = inValue0;
+-                      operationValue1 = inValue1;
+-                      break;
+-
+-              case OPERATIONNATURE_MUTATING:
+-                      DE_ASSERT(getOperationType(m_op) != OPERATIONTYPE_ASSIGNMENT);
+-
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " tmpValue = " << inValue0 << ";\n";
+-
+-                      operationValue0 = "tmpValue";
+-                      operationValue1 = inValue1;
+-                      break;
+-
+-              case OPERATIONNATURE_ASSIGNMENT:
+-                      DE_ASSERT(getOperationType(m_op) == OPERATIONTYPE_ASSIGNMENT);
+-
+-                      operationValue0 = inValue0;
+-                      operationValue1 = inValue1;
+-                      break;
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-      }
+-
+-      switch (getOperationType(m_op))
+-      {
+-              case OPERATIONTYPE_BINARY_OPERATOR:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << " " << getOperationName(m_op) << " " << operationValue1 << ";\n";
+-                      break;
+-
+-              case OPERATIONTYPE_UNARY_PREFIX_OPERATOR:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << getOperationName(m_op) << operationValue0 << ";\n";
+-                      break;
+-
+-              case OPERATIONTYPE_UNARY_POSTFIX_OPERATOR:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << getOperationName(m_op) << ";\n";
+-                      break;
+-
+-              case OPERATIONTYPE_BINARY_FUNCTION:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << getOperationName(m_op) << "(" << operationValue0 << ", " << operationValue1 << ");\n";
+-                      break;
+-
+-              case OPERATIONTYPE_UNARY_FUNCTION:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << getOperationName(m_op) << "(" << operationValue0 << ");\n";
+-                      break;
+-
+-              case OPERATIONTYPE_ASSIGNMENT:
+-                      op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << ";\n";
+-                      op << " res " << getOperationName(m_op) << " " << operationValue1 << ";\n";
+-                      break;
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-      }
+-
+-      // Reduction to vec3 (rgb). Check the used value too if it was modified
+-      op << " " << (m_isVertexCase ? "v_color" : "dEQP_FragColor") << " = ";
+-
+-      if (isOperationValueModifying(m_op))
+-              op << "vec4(" << genGLSLMatToVec3Reduction(resultType, "res") << ", 1.0) + vec4(" << genGLSLMatToVec3Reduction(resultType, "tmpValue") << ", 0.0);\n";
+-      else
+-              op << "vec4(" << genGLSLMatToVec3Reduction(resultType, "res") << ", 1.0);\n";
+-
+-      vtx << "}\n";
+-      frag << "}\n";
+-
+-      m_vertShaderSource      = vtx.str();
+-      m_fragShaderSource      = frag.str();
+-
+-      // \todo [2012-02-14 pyry] Compute better values for matrix tests.
+-      m_userAttribTransforms.resize(4);
+-      for (int attribNdx = 0; attribNdx < 4; attribNdx++)
+-      {
+-              m_userAttribTransforms[attribNdx] = Mat4(0.0f);
+-              m_userAttribTransforms[attribNdx](                  0, 3) = 0.2f;                                                               // !< prevent matrix*vec from going into zero (assuming vec.w != 0)
+-              m_userAttribTransforms[attribNdx](                  1, 3) = 0.1f;                                                               // !<
+-              m_userAttribTransforms[attribNdx](                  2, 3) = 0.4f + 0.15f * float(attribNdx);    // !<
+-              m_userAttribTransforms[attribNdx](                  3, 3) = 0.7f;                                                               // !<
+-              m_userAttribTransforms[attribNdx]((0 + attribNdx) % 4, 0) = 1.0f;
+-              m_userAttribTransforms[attribNdx]((1 + attribNdx) % 4, 1) = 1.0f;
+-              m_userAttribTransforms[attribNdx]((2 + attribNdx) % 4, 2) = 1.0f;
+-              m_userAttribTransforms[attribNdx]((3 + attribNdx) % 4, 3) = 1.0f;
+-      }
+-
+-      // prevent bad reference cases such as black result images by fine-tuning used matrices
+-      if (getOperationTestMatrixType(m_op) != TESTMATRIXTYPE_DEFAULT)
+-      {
+-              for (int attribNdx = 0; attribNdx < 4; attribNdx++)
+-              {
+-                      for (int row = 0; row < 4; row++)
+-                      for (int col = 0; col < 4; col++)
+-                      {
+-                              switch (getOperationTestMatrixType(m_op))
+-                              {
+-                                      case TESTMATRIXTYPE_NEGATED:
+-                                              m_userAttribTransforms[attribNdx](row, col) = -m_userAttribTransforms[attribNdx](row, col);
+-                                              break;
+-                                      case TESTMATRIXTYPE_INCREMENTED:
+-                                              m_userAttribTransforms[attribNdx](row, col) += 0.3f;
+-                                              break;
+-                                      case TESTMATRIXTYPE_DECREMENTED:
+-                                              m_userAttribTransforms[attribNdx](row, col) -= 0.3f;
+-                                              break;
+-                                      case TESTMATRIXTYPE_NEGATED_INCREMENTED:
+-                                              m_userAttribTransforms[attribNdx](row, col) = -m_userAttribTransforms[attribNdx](row, col) + 0.3f;
+-                                              break;
+-                                      case TESTMATRIXTYPE_INCREMENTED_LESS:
+-                                              m_userAttribTransforms[attribNdx](row, col) -= 0.1f;
+-                                              break;
+-
+-                                      default:
+-                                              DE_ASSERT(DE_FALSE);
+-                                              break;
+-                              }
+-                      }
+-              }
+-      }
+-
+-      ShaderRenderCase::init();
++    std::ostringstream  vtx;
++    std::ostringstream  frag;
++    std::ostringstream& op              = m_isVertexCase ? vtx : frag;
++
++    bool                isInDynMat0     = isDataTypeMatrix(m_in0.dataType) && m_in0.inputType == INPUTTYPE_DYNAMIC;
++    bool                isInDynMat1     = isDataTypeMatrix(m_in1.dataType) && m_in1.inputType == INPUTTYPE_DYNAMIC;
++    string              inValue0;
++    string              inValue1;
++    DataType            resultType      = TYPE_LAST;
++    Precision           resultPrec      = m_in0.precision;
++    vector<string>      passVars;
++    int                 numInputs       = (isOperationBinary(m_op)) ? (2) : (1);
++
++    std::string         operationValue0;
++    std::string         operationValue1;
++
++    DE_ASSERT(!isInDynMat0 || !isInDynMat1); // Only single dynamic matrix input is allowed.
++    DE_UNREF(isInDynMat0 && isInDynMat1);
++
++    // Compute result type.
++    if (m_op == OP_MUL && isDataTypeMatrix(m_in0.dataType) && isDataTypeMatrix(m_in1.dataType))
++    {
++        resultType = getDataTypeMatrix(getDataTypeMatrixNumColumns(m_in1.dataType), getDataTypeMatrixNumRows(m_in0.dataType));
++    }
++    else if (m_op == OP_OUTER_PRODUCT)
++    {
++        resultType = getDataTypeMatrix(getDataTypeScalarSize(m_in1.dataType), getDataTypeScalarSize(m_in0.dataType));
++    }
++    else if (m_op == OP_TRANSPOSE)
++    {
++        resultType = getDataTypeMatrix(getDataTypeMatrixNumRows(m_in0.dataType), getDataTypeMatrixNumColumns(m_in0.dataType));
++    }
++    else if (m_op == OP_INVERSE)
++    {
++        resultType = m_in0.dataType;
++    }
++    else if (m_op == OP_DETERMINANT)
++    {
++        resultType = TYPE_FLOAT;
++    }
++    else if (getOperationType(m_op) == OPERATIONTYPE_UNARY_PREFIX_OPERATOR ||
++             getOperationType(m_op) == OPERATIONTYPE_UNARY_POSTFIX_OPERATOR)
++    {
++        resultType = m_in0.dataType;
++    }
++    else if (isDataTypeMatrix(m_in0.dataType) && isDataTypeMatrix(m_in1.dataType))
++    {
++        DE_ASSERT(m_in0.dataType == m_in1.dataType);
++        resultType = m_in0.dataType;
++    }
++    else if (isDataTypeMatrix(m_in0.dataType) || isDataTypeMatrix(m_in1.dataType))
++    {
++        int         matNdx      = isDataTypeMatrix(m_in0.dataType) ? 0 : 1;
++        DataType    matrixType  = matNdx == 0 ? m_in0.dataType : m_in1.dataType;
++        DataType    otherType   = matNdx == 0 ? m_in1.dataType : m_in0.dataType;
++
++        if (otherType == TYPE_FLOAT)
++            resultType = matrixType;
++        else
++        {
++            DE_ASSERT(isDataTypeVector(otherType));
++            resultType = getDataTypeFloatVec(matNdx == 0 ? getDataTypeMatrixNumRows(matrixType) : getDataTypeMatrixNumColumns(matrixType));
++        }
++    }
++    else
++    {
++        DE_ASSERT(DE_FALSE);
++    }
++
++    vtx << "#version 300 es\n";
++    frag << "#version 300 es\n";
++
++    vtx << "in highp vec4 a_position;\n";
++    frag << "layout(location = 0) out mediump vec4 dEQP_FragColor;\n";
++    if (m_isVertexCase)
++    {
++        vtx << "out mediump vec4 v_color;\n";
++        frag << "in mediump vec4 v_color;\n";
++    }
++
++    // Input declarations.
++    for (int inNdx = 0; inNdx < numInputs; inNdx++)
++    {
++        const ShaderInput&  in          = inNdx > 0 ? m_in1 : m_in0;
++        const char*         precName    = getPrecisionName(in.precision);
++        const char*         typeName    = getDataTypeName(in.dataType);
++        string&             inValue     = inNdx > 0 ? inValue1 : inValue0;
++
++        if (in.inputType == INPUTTYPE_DYNAMIC)
++        {
++            vtx << "in " << precName << " " << typeName << " a_";
++
++            if (isDataTypeMatrix(in.dataType))
++            {
++                // a_matN, v_matN
++                vtx << typeName << ";\n";
++                if (!m_isVertexCase)
++                {
++                    vtx << "out " << precName << " " << typeName << " v_" << typeName << ";\n";
++                    frag << "in " << precName << " " << typeName << " v_" << typeName << ";\n";
++                    passVars.push_back(typeName);
++                }
++
++                inValue = string(m_isVertexCase ? "a_" : "v_") + getDataTypeName(in.dataType);
++            }
++            else
++            {
++                // a_coords, v_coords
++                vtx << "coords;\n";
++                if (!m_isVertexCase)
++                {
++                    vtx << "out " << precName << " " << typeName << " v_coords;\n";
++                    frag << "in " << precName << " " << typeName << " v_coords;\n";
++                    passVars.push_back("coords");
++                }
++
++                inValue = m_isVertexCase ? "a_coords" : "v_coords";
++            }
++        }
++        else if (in.inputType == INPUTTYPE_UNIFORM)
++        {
++            op << "uniform " << precName << " " << typeName << " u_in" << inNdx << ";\n";
++            inValue = string("u_in") + de::toString(inNdx);
++        }
++        else if (in.inputType == INPUTTYPE_CONST)
++        {
++            op << "const " << precName << " " << typeName << " in" << inNdx << " = ";
++
++            // Generate declaration.
++            switch (in.dataType)
++            {
++                case TYPE_FLOAT:        op << de::floatToString(s_constInFloat[inNdx], 1);                  break;
++                case TYPE_FLOAT_VEC2:   writeVectorConstructor<2>(op, s_constInVec2[inNdx]);                break;
++                case TYPE_FLOAT_VEC3:   writeVectorConstructor<3>(op, s_constInVec3[inNdx]);                break;
++                case TYPE_FLOAT_VEC4:   writeVectorConstructor<4>(op, s_constInVec4[inNdx]);                break;
++                case TYPE_FLOAT_MAT2:   writeMatrixConstructor<2, 2>(op, Mat2(s_constInMat2x2[inNdx]));     break;
++                case TYPE_FLOAT_MAT2X3: writeMatrixConstructor<2, 3>(op, Mat2x3(s_constInMat2x3[inNdx]));   break;
++                case TYPE_FLOAT_MAT2X4: writeMatrixConstructor<2, 4>(op, Mat2x4(s_constInMat2x4[inNdx]));   break;
++                case TYPE_FLOAT_MAT3X2: writeMatrixConstructor<3, 2>(op, Mat3x2(s_constInMat3x2[inNdx]));   break;
++                case TYPE_FLOAT_MAT3:   writeMatrixConstructor<3, 3>(op, Mat3(s_constInMat3x3[inNdx]));     break;
++                case TYPE_FLOAT_MAT3X4: writeMatrixConstructor<3, 4>(op, Mat3x4(s_constInMat3x4[inNdx]));   break;
++                case TYPE_FLOAT_MAT4X2: writeMatrixConstructor<4, 2>(op, Mat4x2(s_constInMat4x2[inNdx]));   break;
++                case TYPE_FLOAT_MAT4X3: writeMatrixConstructor<4, 3>(op, Mat4x3(s_constInMat4x3[inNdx]));   break;
++                case TYPE_FLOAT_MAT4:   writeMatrixConstructor<4, 4>(op, Mat4(s_constInMat4x4[inNdx]));     break;
++
++                default:
++                    DE_ASSERT(DE_FALSE);
++            }
++
++            op << ";\n";
++
++            inValue = string("in") + de::toString(inNdx);
++        }
++    }
++
++    vtx << "\n"
++        << "void main (void)\n"
++        << "{\n"
++        << "    gl_Position = a_position;\n";
++    frag << "\n"
++         << "void main (void)\n"
++         << "{\n";
++
++    if (m_isVertexCase)
++        frag << "   dEQP_FragColor = v_color;\n";
++    else
++    {
++        for (vector<string>::const_iterator copyIter = passVars.begin(); copyIter != passVars.end(); copyIter++)
++            vtx << "    v_" << *copyIter << " = " << "a_" << *copyIter << ";\n";
++    }
++
++    // Operation.
++
++    switch (getOperationNature(m_op))
++    {
++        case OPERATIONNATURE_PURE:
++            DE_ASSERT(getOperationType(m_op) != OPERATIONTYPE_ASSIGNMENT);
++
++            operationValue0 = inValue0;
++            operationValue1 = inValue1;
++            break;
++
++        case OPERATIONNATURE_MUTATING:
++            DE_ASSERT(getOperationType(m_op) != OPERATIONTYPE_ASSIGNMENT);
++
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " tmpValue = " << inValue0 << ";\n";
++
++            operationValue0 = "tmpValue";
++            operationValue1 = inValue1;
++            break;
++
++        case OPERATIONNATURE_ASSIGNMENT:
++            DE_ASSERT(getOperationType(m_op) == OPERATIONTYPE_ASSIGNMENT);
++
++            operationValue0 = inValue0;
++            operationValue1 = inValue1;
++            break;
++
++        default:
++            DE_ASSERT(DE_FALSE);
++    }
++
++    switch (getOperationType(m_op))
++    {
++        case OPERATIONTYPE_BINARY_OPERATOR:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << " " << getOperationName(m_op) << " " << operationValue1 << ";\n";
++            break;
++
++        case OPERATIONTYPE_UNARY_PREFIX_OPERATOR:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << getOperationName(m_op) << operationValue0 << ";\n";
++            break;
++
++        case OPERATIONTYPE_UNARY_POSTFIX_OPERATOR:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << getOperationName(m_op) << ";\n";
++            break;
++
++        case OPERATIONTYPE_BINARY_FUNCTION:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << getOperationName(m_op) << "(" << operationValue0 << ", " << operationValue1 << ");\n";
++            break;
++
++        case OPERATIONTYPE_UNARY_FUNCTION:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << getOperationName(m_op) << "(" << operationValue0 << ");\n";
++            break;
++
++        case OPERATIONTYPE_ASSIGNMENT:
++            op << " " << getPrecisionName(resultPrec) << " " << getDataTypeName(resultType) << " res = " << operationValue0 << ";\n";
++            op << " res " << getOperationName(m_op) << " " << operationValue1 << ";\n";
++            break;
++
++        default:
++            DE_ASSERT(DE_FALSE);
++    }
++
++    // Reduction to vec3 (rgb). Check the used value too if it was modified
++    op << " " << (m_isVertexCase ? "v_color" : "dEQP_FragColor") << " = ";
++
++    if (isOperationValueModifying(m_op))
++        op << "vec4(" << genGLSLMatToVec3Reduction(resultType, "res") << ", 1.0) + vec4(" << genGLSLMatToVec3Reduction(resultType, "tmpValue") << ", 0.0);\n";
++    else
++        op << "vec4(" << genGLSLMatToVec3Reduction(resultType, "res") << ", 1.0);\n";
++
++    vtx << "}\n";
++    frag << "}\n";
++
++    m_vertShaderSource  = vtx.str();
++    m_fragShaderSource  = frag.str();
++
++    // \todo [2012-02-14 pyry] Compute better values for matrix tests.
++    m_userAttribTransforms.resize(4);
++    for (int attribNdx = 0; attribNdx < 4; attribNdx++)
++    {
++        m_userAttribTransforms[attribNdx] = Mat4(0.0f);
++        m_userAttribTransforms[attribNdx](                  0, 3) = 0.2f;                               // !< prevent matrix*vec from going into zero (assuming vec.w != 0)
++        m_userAttribTransforms[attribNdx](                  1, 3) = 0.1f;                               // !<
++        m_userAttribTransforms[attribNdx](                  2, 3) = 0.4f + 0.15f * float(attribNdx);    // !<
++        m_userAttribTransforms[attribNdx](                  3, 3) = 0.7f;                               // !<
++        m_userAttribTransforms[attribNdx]((0 + attribNdx) % 4, 0) = 1.0f;
++        m_userAttribTransforms[attribNdx]((1 + attribNdx) % 4, 1) = 1.0f;
++        m_userAttribTransforms[attribNdx]((2 + attribNdx) % 4, 2) = 1.0f;
++        m_userAttribTransforms[attribNdx]((3 + attribNdx) % 4, 3) = 1.0f;
++    }
++
++    // prevent bad reference cases such as black result images by fine-tuning used matrices
++    if (getOperationTestMatrixType(m_op) != TESTMATRIXTYPE_DEFAULT)
++    {
++        for (int attribNdx = 0; attribNdx < 4; attribNdx++)
++        {
++            for (int row = 0; row < 4; row++)
++            for (int col = 0; col < 4; col++)
++            {
++                switch (getOperationTestMatrixType(m_op))
++                {
++                    case TESTMATRIXTYPE_NEGATED:
++                        m_userAttribTransforms[attribNdx](row, col) = -m_userAttribTransforms[attribNdx](row, col);
++                        break;
++                    case TESTMATRIXTYPE_INCREMENTED:
++                        m_userAttribTransforms[attribNdx](row, col) += 0.3f;
++                        break;
++                    case TESTMATRIXTYPE_DECREMENTED:
++                        m_userAttribTransforms[attribNdx](row, col) -= 0.3f;
++                        break;
++                    case TESTMATRIXTYPE_NEGATED_INCREMENTED:
++                        m_userAttribTransforms[attribNdx](row, col) = -m_userAttribTransforms[attribNdx](row, col) + 0.3f;
++                        break;
++                    case TESTMATRIXTYPE_INCREMENTED_LESS:
++                        m_userAttribTransforms[attribNdx](row, col) -= 0.1f;
++                        break;
++
++                    default:
++                        DE_ASSERT(DE_FALSE);
++                        break;
++                }
++            }
++        }
++    }
++
++    ShaderRenderCase::init();
+ }
+ std::string ShaderMatrixCase::genGLSLMatToVec3Reduction (const glu::DataType& matType, const char* varName)
+ {
+-      std::ostringstream op;
+-
+-      switch (matType)
+-      {
+-              case TYPE_FLOAT:                op << varName << ", "                   << varName << ", "                      << varName << "";                                                                                                                                                                                                                                                                                       break;
+-              case TYPE_FLOAT_VEC2:   op << varName << ".x, "                 << varName << ".y, "            << varName << ".x";                                                                                                                                                                                                                                                                                     break;
+-              case TYPE_FLOAT_VEC3:   op << varName << "";                                                                                                                                                                                                                                                                                                                                                                                                    break;
+-              case TYPE_FLOAT_VEC4:   op << varName << ".x, "                 << varName << ".y, "            << varName << ".z+"                     << varName << ".w";                                                                                                                                                                                                                             break;
+-              case TYPE_FLOAT_MAT2:   op << varName << "[0][0], "             << varName << "[1][0], "        << varName << "[0][1]+"         << varName << "[1][1]";                                                                                                                                                                                                                 break;
+-              case TYPE_FLOAT_MAT2X3: op << varName << "[0] + "               << varName << "[1]";                                                                                                                                                                                                                                                                                                                                    break;
+-              case TYPE_FLOAT_MAT2X4: op << varName << "[0].xyz + "   << varName << "[1].yzw";                                                                                                                                                                                                                                                                                                                                break;
+-              case TYPE_FLOAT_MAT3X2: op << varName << "[0][0]+"              << varName << "[0][1], "        << varName << "[1][0]+"         << varName << "[1][1], "        << varName << "[2][0]+" << varName << "[2][1]";                                                                                                         break;
+-              case TYPE_FLOAT_MAT3:   op << varName << "[0] + "               << varName << "[1] + "          << varName << "[2]";                                                                                                                                                                                                                                                                            break;
+-              case TYPE_FLOAT_MAT3X4: op << varName << "[0].xyz + "   << varName << "[1].yzw + "      << varName << "[2].zwx";                                                                                                                                                                                                                                                                        break;
+-              case TYPE_FLOAT_MAT4X2: op << varName << "[0][0]+"              << varName << "[0][1]+"         << varName << "[3][0], "        << varName << "[1][0]+"         << varName << "[1][1]+" << varName << "[3][1], " << varName << "[2][0]+" << varName << "[2][1]";        break;
+-              case TYPE_FLOAT_MAT4X3: op << varName << "[0] + "               << varName << "[1] + "          << varName << "[2] + "          << varName << "[3]";                                                                                                                                                                                                                    break;
+-              case TYPE_FLOAT_MAT4:   op << varName << "[0].xyz+"             << varName << "[1].yzw+"        << varName << "[2].zwx+"        << varName << "[3].wxy";                                                                                                                                                                                                                break;
+-
+-              default:
+-                      DE_ASSERT(DE_FALSE);
+-      }
+-
+-      return op.str();
++    std::ostringstream op;
++
++    switch (matType)
++    {
++        case TYPE_FLOAT:        op << varName << ", "           << varName << ", "          << varName << "";                                                                                                                                           break;
++        case TYPE_FLOAT_VEC2:   op << varName << ".x, "         << varName << ".y, "        << varName << ".x";                                                                                                                                         break;
++        case TYPE_FLOAT_VEC3:   op << varName << "";                                                                                                                                                                                                    break;
++        case TYPE_FLOAT_VEC4:   op << varName << ".x, "         << varName << ".y, "        << varName << ".z+"         << varName << ".w";                                                                                                             break;
++        case TYPE_FLOAT_MAT2:   op << varName << "[0][0], "     << varName << "[1][0], "    << varName << "[0][1]+"     << varName << "[1][1]";                                                                                                         break;
++        case TYPE_FLOAT_MAT2X3: op << varName << "[0] + "       << varName << "[1]";                                                                                                                                                                    break;
++        case TYPE_FLOAT_MAT2X4: op << varName << "[0].xyz + "   << varName << "[1].yzw";                                                                                                                                                                break;
++        case TYPE_FLOAT_MAT3X2: op << varName << "[0][0]+"      << varName << "[0][1], "    << varName << "[1][0]+"     << varName << "[1][1], "    << varName << "[2][0]+" << varName << "[2][1]";                                                     break;
++        case TYPE_FLOAT_MAT3:   op << varName << "[0] + "       << varName << "[1] + "      << varName << "[2]";                                                                                                                                        break;
++        case TYPE_FLOAT_MAT3X4: op << varName << "[0].xyz + "   << varName << "[1].yzw + "  << varName << "[2].zwx";                                                                                                                                    break;
++        case TYPE_FLOAT_MAT4X2: op << varName << "[0][0]+"      << varName << "[0][1]+"     << varName << "[3][0], "    << varName << "[1][0]+"     << varName << "[1][1]+" << varName << "[3][1], " << varName << "[2][0]+" << varName << "[2][1]";    break;
++        case TYPE_FLOAT_MAT4X3: op << varName << "[0] + "       << varName << "[1] + "      << varName << "[2] + "      << varName << "[3]";                                                                                                            break;
++        case TYPE_FLOAT_MAT4:   op << varName << "[0].xyz+"     << varName << "[1].yzw+"    << varName << "[2].zwx+"    << varName << "[3].wxy";                                                                                                        break;
++
++        default:
++            DE_ASSERT(DE_FALSE);
++    }
++
++    return op.str();
+ }
+ void ShaderMatrixCase::setupUniforms (int programID, const tcu::Vec4& constCoords)
+ {
+-      const glw::Functions& gl = m_renderCtx.getFunctions();
+-
+-      DE_UNREF(constCoords);
+-
+-      for (int inNdx = 0; inNdx < 2; inNdx++)
+-      {
+-              const ShaderInput& in = inNdx > 0 ? m_in1 : m_in0;
+-
+-              if (in.inputType == INPUTTYPE_UNIFORM)
+-              {
+-                      int loc = gl.getUniformLocation(programID, (string("u_in") + de::toString(inNdx)).c_str());
+-
+-                      if (loc < 0)
+-                              continue;
+-
+-                      switch (in.dataType)
+-                      {
+-                              case TYPE_FLOAT:                gl.uniform1f(loc, s_constInFloat[inNdx]);                                               break;
+-                              case TYPE_FLOAT_VEC2:   gl.uniform2fv(loc, 1, s_constInVec2[inNdx].getPtr());                   break;
+-                              case TYPE_FLOAT_VEC3:   gl.uniform3fv(loc, 1, s_constInVec3[inNdx].getPtr());                   break;
+-                              case TYPE_FLOAT_VEC4:   gl.uniform4fv(loc, 1, s_constInVec4[inNdx].getPtr());                   break;
+-                              // \note GLES3 supports transpose in matrix upload.
+-                              case TYPE_FLOAT_MAT2:   gl.uniformMatrix2fv     (loc, 1, GL_TRUE, s_constInMat2x2[inNdx]);      break;
+-                              case TYPE_FLOAT_MAT2X3: gl.uniformMatrix2x3fv(loc, 1, GL_TRUE, s_constInMat2x3[inNdx]); break;
+-                              case TYPE_FLOAT_MAT2X4: gl.uniformMatrix2x4fv(loc, 1, GL_TRUE, s_constInMat2x4[inNdx]); break;
+-                              case TYPE_FLOAT_MAT3X2: gl.uniformMatrix3x2fv(loc, 1, GL_TRUE, s_constInMat3x2[inNdx]); break;
+-                              case TYPE_FLOAT_MAT3:   gl.uniformMatrix3fv     (loc, 1, GL_TRUE, s_constInMat3x3[inNdx]);      break;
+-                              case TYPE_FLOAT_MAT3X4: gl.uniformMatrix3x4fv(loc, 1, GL_TRUE, s_constInMat3x4[inNdx]); break;
+-                              case TYPE_FLOAT_MAT4X2: gl.uniformMatrix4x2fv(loc, 1, GL_TRUE, s_constInMat4x2[inNdx]); break;
+-                              case TYPE_FLOAT_MAT4X3: gl.uniformMatrix4x3fv(loc, 1, GL_TRUE, s_constInMat4x3[inNdx]); break;
+-                              case TYPE_FLOAT_MAT4:   gl.uniformMatrix4fv     (loc, 1, GL_TRUE, s_constInMat4x4[inNdx]);      break;
+-                              default:
+-                                      DE_ASSERT(false);
+-                      }
+-              }
+-      }
++    const glw::Functions& gl = m_renderCtx.getFunctions();
++
++    DE_UNREF(constCoords);
++
++    for (int inNdx = 0; inNdx < 2; inNdx++)
++    {
++        const ShaderInput& in = inNdx > 0 ? m_in1 : m_in0;
++
++        if (in.inputType == INPUTTYPE_UNIFORM)
++        {
++            int loc = gl.getUniformLocation(programID, (string("u_in") + de::toString(inNdx)).c_str());
++
++            if (loc < 0)
++                continue;
++
++            switch (in.dataType)
++            {
++                case TYPE_FLOAT:        gl.uniform1f(loc, s_constInFloat[inNdx]);                       break;
++                case TYPE_FLOAT_VEC2:   gl.uniform2fv(loc, 1, s_constInVec2[inNdx].getPtr());           break;
++                case TYPE_FLOAT_VEC3:   gl.uniform3fv(loc, 1, s_constInVec3[inNdx].getPtr());           break;
++                case TYPE_FLOAT_VEC4:   gl.uniform4fv(loc, 1, s_constInVec4[inNdx].getPtr());           break;
++                // \note GLES3 supports transpose in matrix upload.
++                case TYPE_FLOAT_MAT2:   gl.uniformMatrix2fv (loc, 1, GL_TRUE, s_constInMat2x2[inNdx]);  break;
++                case TYPE_FLOAT_MAT2X3: gl.uniformMatrix2x3fv(loc, 1, GL_TRUE, s_constInMat2x3[inNdx]); break;
++                case TYPE_FLOAT_MAT2X4: gl.uniformMatrix2x4fv(loc, 1, GL_TRUE, s_constInMat2x4[inNdx]); break;
++                case TYPE_FLOAT_MAT3X2: gl.uniformMatrix3x2fv(loc, 1, GL_TRUE, s_constInMat3x2[inNdx]); break;
++                case TYPE_FLOAT_MAT3:   gl.uniformMatrix3fv (loc, 1, GL_TRUE, s_constInMat3x3[inNdx]);  break;
++                case TYPE_FLOAT_MAT3X4: gl.uniformMatrix3x4fv(loc, 1, GL_TRUE, s_constInMat3x4[inNdx]); break;
++                case TYPE_FLOAT_MAT4X2: gl.uniformMatrix4x2fv(loc, 1, GL_TRUE, s_constInMat4x2[inNdx]); break;
++                case TYPE_FLOAT_MAT4X3: gl.uniformMatrix4x3fv(loc, 1, GL_TRUE, s_constInMat4x3[inNdx]); break;
++                case TYPE_FLOAT_MAT4:   gl.uniformMatrix4fv (loc, 1, GL_TRUE, s_constInMat4x4[inNdx]);  break;
++                default:
++                    DE_ASSERT(false);
++            }
++        }
++    }
+ }
+ ShaderMatrixTests::ShaderMatrixTests (Context& context)
+-      : TestCaseGroup(context, "matrix", "Matrix Tests")
++    : TestCaseGroup(context, "matrix", "Matrix Tests")
+ {
+ }
+@@ -1791,181 +1791,181 @@ ShaderMatrixTests::~ShaderMatrixTests (void)
+ void ShaderMatrixTests::init (void)
+ {
+-      static const struct
+-      {
+-              const char*             name;
+-              const char*             desc;
+-              MatrixOp                op;
+-              bool                    extendedInputTypeCases; // !< test with const and uniform types too
+-              bool                    createInputTypeGroup;   // !< create group for input types
+-      } ops[] =
+-      {
+-              { "add",                        "Matrix addition tests",                                                OP_ADD,                         true,   true    },
+-              { "sub",                        "Matrix subtraction tests",                                             OP_SUB,                         true,   true    },
+-              { "mul",                        "Matrix multiplication tests",                                  OP_MUL,                         true,   true    },
+-              { "div",                        "Matrix division tests",                                                OP_DIV,                         true,   true    },
+-              { "matrixcompmult",     "Matrix component-wise multiplication tests",   OP_COMP_MUL,            false,  true    },
+-              { "outerproduct",       "Matrix outerProduct() tests",                                  OP_OUTER_PRODUCT,       false,  true    },
+-              { "transpose",          "Matrix transpose() tests",                                             OP_TRANSPOSE,           false,  true    },
+-              { "determinant",        "Matrix determinant() tests",                                   OP_DETERMINANT,         false,  true    },
+-              { "inverse",            "Matrix inverse() tests",                                               OP_INVERSE,                     false,  true    },
+-              { "unary_addition",     "Matrix unary addition tests",                                  OP_UNARY_PLUS,          false,  false   },
+-              { "negation",           "Matrix negation tests",                                                OP_NEGATION,            false,  false   },
+-              { "pre_increment",      "Matrix prefix increment tests",                                OP_PRE_INCREMENT,       false,  false   },
+-              { "pre_decrement",      "Matrix prefix decrement tests",                                OP_PRE_DECREMENT,       false,  false   },
+-              { "post_increment",     "Matrix postfix increment tests",                               OP_POST_INCREMENT,      false,  false   },
+-              { "post_decrement",     "Matrix postfix decrement tests",                               OP_POST_DECREMENT,      false,  false   },
+-              { "add_assign",         "Matrix add into tests",                                                OP_ADD_INTO,            false,  false   },
+-              { "sub_assign",         "Matrix subtract from tests",                                   OP_SUBTRACT_FROM,       false,  false   },
+-              { "mul_assign",         "Matrix multiply into tests",                                   OP_MULTIPLY_INTO,       false,  false   },
+-              { "div_assign",         "Matrix divide into tests",                                             OP_DIVIDE_INTO,         false,  false   },
+-      };
+-
+-      struct InputTypeSpec
+-      {
+-              const char*             name;
+-              const char*             desc;
+-              InputType               type;
+-      };
+-      static const InputTypeSpec extendedInputTypes[] =
+-      {
+-              { "const",              "Constant matrix input",        INPUTTYPE_CONST         },
+-              { "uniform",    "Uniform matrix input",         INPUTTYPE_UNIFORM       },
+-              { "dynamic",    "Dynamic matrix input",         INPUTTYPE_DYNAMIC       }
+-      };
+-      static const InputTypeSpec reducedInputTypes[] =
+-      {
+-              { "dynamic",    "Dynamic matrix input",         INPUTTYPE_DYNAMIC       }
+-      };
+-
+-      static const DataType matrixTypes[] =
+-      {
+-              TYPE_FLOAT_MAT2,
+-              TYPE_FLOAT_MAT2X3,
+-              TYPE_FLOAT_MAT2X4,
+-              TYPE_FLOAT_MAT3X2,
+-              TYPE_FLOAT_MAT3,
+-              TYPE_FLOAT_MAT3X4,
+-              TYPE_FLOAT_MAT4X2,
+-              TYPE_FLOAT_MAT4X3,
+-              TYPE_FLOAT_MAT4
+-      };
+-
+-      static const Precision precisions[] =
+-      {
+-              PRECISION_LOWP,
+-              PRECISION_MEDIUMP,
+-              PRECISION_HIGHP
+-      };
+-
+-      for (int opNdx = 0; opNdx < DE_LENGTH_OF_ARRAY(ops); opNdx++)
+-      {
+-              const InputTypeSpec*    inTypeList              = (ops[opNdx].extendedInputTypeCases) ? (extendedInputTypes) : (reducedInputTypes);
+-              const int                               inTypeListSize  = (ops[opNdx].extendedInputTypeCases) ? (DE_LENGTH_OF_ARRAY(extendedInputTypes)) : (DE_LENGTH_OF_ARRAY(reducedInputTypes));
+-              const MatrixOp                  op                              = ops[opNdx].op;
+-              tcu::TestCaseGroup*             opGroup                 = new tcu::TestCaseGroup(m_testCtx, ops[opNdx].name, ops[opNdx].desc);
+-
+-              addChild(opGroup);
+-
+-              for (int inTypeNdx = 0; inTypeNdx < inTypeListSize; inTypeNdx++)
+-              {
+-                      const InputType         inputType       = inTypeList[inTypeNdx].type;
+-                      tcu::TestCaseGroup* inGroup;
+-
+-                      if (ops[opNdx].createInputTypeGroup)
+-                      {
+-                              inGroup = new tcu::TestCaseGroup(m_testCtx, inTypeList[inTypeNdx].name, inTypeList[inTypeNdx].desc);
+-                              opGroup->addChild(inGroup);
+-                      }
+-                      else
+-                              inGroup = opGroup;
+-
+-                      for (int matTypeNdx = 0; matTypeNdx < DE_LENGTH_OF_ARRAY(matrixTypes); matTypeNdx++)
+-                      {
+-                              DataType        matType         = matrixTypes[matTypeNdx];
+-                              int                     numCols         = getDataTypeMatrixNumColumns(matType);
+-                              int                     numRows         = getDataTypeMatrixNumRows(matType);
+-                              const char*     matTypeName     = getDataTypeName(matType);
+-
+-                              for (int precNdx = 0; precNdx < DE_LENGTH_OF_ARRAY(precisions); precNdx++)
+-                              {
+-                                      Precision       precision       = precisions[precNdx];
+-                                      const char*     precName        = getPrecisionName(precision);
+-                                      string          baseName        = string(precName) + "_" + matTypeName + "_";
+-                                      ShaderInput     matIn           (inputType, matType, precision);
+-
+-                                      if (isOperationMatrixScalar(op))
+-                                      {
+-                                              // Matrix-scalar \note For div cases we use uniform input.
+-                                              ShaderInput scalarIn(op == OP_DIV ? INPUTTYPE_UNIFORM : INPUTTYPE_DYNAMIC, TYPE_FLOAT, precision);
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_vertex").c_str(),          "Matrix-scalar case", matIn, scalarIn, op, true));
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_fragment").c_str(),        "Matrix-scalar case", matIn, scalarIn, op, false));
+-                                      }
+-
+-                                      if (isOperationMatrixVector(op))
+-                                      {
+-                                              // Matrix-vector.
+-                                              DataType        colVecType      = getDataTypeFloatVec(numCols);
+-                                              ShaderInput colVecIn    (op == OP_DIV ? INPUTTYPE_UNIFORM : INPUTTYPE_DYNAMIC, colVecType, precision);
+-
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(colVecType) + "_vertex").c_str(),         "Matrix-vector case", matIn, colVecIn, op, true));
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(colVecType) + "_fragment").c_str(),       "Matrix-vector case", matIn, colVecIn, op, false));
+-
+-                                              // Vector-matrix.
+-                                              DataType        rowVecType      = getDataTypeFloatVec(numRows);
+-                                              ShaderInput     rowVecIn        (op == OP_DIV ? INPUTTYPE_UNIFORM : INPUTTYPE_DYNAMIC, rowVecType, precision);
+-                                              string          vecMatName      = string(precName) + "_" + getDataTypeName(rowVecType) + "_" + matTypeName;
+-
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (vecMatName + "_vertex").c_str(),             "Vector-matrix case", rowVecIn, matIn, op, true));
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (vecMatName + "_fragment").c_str(),   "Vector-matrix case", rowVecIn, matIn, op, false));
+-                                      }
+-
+-                                      if (isOperationArithmeticMatrixMatrix(op))
+-                                      {
+-                                              // Arithmetic matrix-matrix multiplication.
+-                                              for (int otherCols = 2; otherCols <= 4; otherCols++)
+-                                              {
+-                                                      ShaderInput otherMatIn(inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_UNIFORM : inputType, getDataTypeMatrix(otherCols, numCols /* rows */), precision);
+-                                                      inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(otherMatIn.dataType) + "_vertex").c_str(),        "Matrix-matrix case", matIn, otherMatIn, op, true));
+-                                                      inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(otherMatIn.dataType) + "_fragment").c_str(),      "Matrix-matrix case", matIn, otherMatIn, op, false));
+-                                              }
+-                                      }
+-                                      else if (isOperationComponentwiseMatrixMatrix(op))
+-                                      {
+-                                              // Component-wise.
+-                                              ShaderInput otherMatIn(inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_UNIFORM : inputType, matType, precision);
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + matTypeName + "_vertex").c_str(),         "Matrix-matrix case", matIn, otherMatIn, op, true));
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + matTypeName + "_fragment").c_str(),       "Matrix-matrix case", matIn, otherMatIn, op, false));
+-                                      }
+-
+-                                      if (isOperationVectorVector(op))
+-                                      {
+-                                              ShaderInput vec1In(inputType,                                                                                                                           getDataTypeFloatVec(numRows), precision);
+-                                              ShaderInput vec2In((inputType == INPUTTYPE_DYNAMIC) ? (INPUTTYPE_UNIFORM) : (inputType),        getDataTypeFloatVec(numCols), precision);
+-
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_vertex").c_str(),          "Vector-vector case", vec1In, vec2In, op, true));
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_fragment").c_str(),        "Vector-vector case", vec1In, vec2In, op, false));
+-                                      }
+-
+-                                      if ((isOperationUnaryAnyMatrix(op)) ||
+-                                              (isOperationUnarySymmetricMatrix(op) && numCols == numRows))
+-                                      {
+-                                              ShaderInput voidInput(INPUTTYPE_LAST, TYPE_LAST, PRECISION_LAST);
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_vertex").c_str(),          "Matrix case", matIn, voidInput, op, true));
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_fragment").c_str(),        "Matrix case", matIn, voidInput, op, false));
+-                                      }
+-
+-                                      if ((isOperationAssignmentAnyMatrix(op)) ||
+-                                              (isOperationAssignmentSymmetricMatrix(op) && numCols == numRows))
+-                                      {
+-                                              ShaderInput otherMatIn(inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_UNIFORM : inputType, matType, precision);
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_vertex").c_str(),          "Matrix assignment case", matIn, otherMatIn, op, true));
+-                                              inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_fragment").c_str(),        "Matrix assignment case", matIn, otherMatIn, op, false));
+-                                      }
+-                              }
+-                      }
+-              }
+-      }
++    static const struct
++    {
++        const char*     name;
++        const char*     desc;
++        MatrixOp        op;
++        bool            extendedInputTypeCases; // !< test with const and uniform types too
++        bool            createInputTypeGroup;   // !< create group for input types
++    } ops[] =
++    {
++        { "add",            "Matrix addition tests",                        OP_ADD,             true,   true    },
++        { "sub",            "Matrix subtraction tests",                     OP_SUB,             true,   true    },
++        { "mul",            "Matrix multiplication tests",                  OP_MUL,             true,   true    },
++        { "div",            "Matrix division tests",                        OP_DIV,             true,   true    },
++        { "matrixcompmult", "Matrix component-wise multiplication tests",   OP_COMP_MUL,        false,  true    },
++        { "outerproduct",   "Matrix outerProduct() tests",                  OP_OUTER_PRODUCT,   false,  true    },
++        { "transpose",      "Matrix transpose() tests",                     OP_TRANSPOSE,       false,  true    },
++        { "determinant",    "Matrix determinant() tests",                   OP_DETERMINANT,     false,  true    },
++        { "inverse",        "Matrix inverse() tests",                       OP_INVERSE,         false,  true    },
++        { "unary_addition", "Matrix unary addition tests",                  OP_UNARY_PLUS,      false,  false   },
++        { "negation",       "Matrix negation tests",                        OP_NEGATION,        false,  false   },
++        { "pre_increment",  "Matrix prefix increment tests",                OP_PRE_INCREMENT,   false,  false   },
++        { "pre_decrement",  "Matrix prefix decrement tests",                OP_PRE_DECREMENT,   false,  false   },
++        { "post_increment", "Matrix postfix increment tests",               OP_POST_INCREMENT,  false,  false   },
++        { "post_decrement", "Matrix postfix decrement tests",               OP_POST_DECREMENT,  false,  false   },
++        { "add_assign",     "Matrix add into tests",                        OP_ADD_INTO,        false,  false   },
++        { "sub_assign",     "Matrix subtract from tests",                   OP_SUBTRACT_FROM,   false,  false   },
++        { "mul_assign",     "Matrix multiply into tests",                   OP_MULTIPLY_INTO,   false,  false   },
++        { "div_assign",     "Matrix divide into tests",                     OP_DIVIDE_INTO,     false,  false   },
++    };
++
++    struct InputTypeSpec
++    {
++        const char*     name;
++        const char*     desc;
++        InputType       type;
++    };
++    static const InputTypeSpec extendedInputTypes[] =
++    {
++        { "const",      "Constant matrix input",    INPUTTYPE_CONST     },
++        { "uniform",    "Uniform matrix input",     INPUTTYPE_UNIFORM   },
++        { "dynamic",    "Dynamic matrix input",     INPUTTYPE_DYNAMIC   }
++    };
++    static const InputTypeSpec reducedInputTypes[] =
++    {
++        { "dynamic",    "Dynamic matrix input",     INPUTTYPE_DYNAMIC   }
++    };
++
++    static const DataType matrixTypes[] =
++    {
++        TYPE_FLOAT_MAT2,
++        TYPE_FLOAT_MAT2X3,
++        TYPE_FLOAT_MAT2X4,
++        TYPE_FLOAT_MAT3X2,
++        TYPE_FLOAT_MAT3,
++        TYPE_FLOAT_MAT3X4,
++        TYPE_FLOAT_MAT4X2,
++        TYPE_FLOAT_MAT4X3,
++        TYPE_FLOAT_MAT4
++    };
++
++    static const Precision precisions[] =
++    {
++        PRECISION_LOWP,
++        PRECISION_MEDIUMP,
++        PRECISION_HIGHP
++    };
++
++    for (int opNdx = 0; opNdx < DE_LENGTH_OF_ARRAY(ops); opNdx++)
++    {
++        const InputTypeSpec*    inTypeList      = (ops[opNdx].extendedInputTypeCases) ? (extendedInputTypes) : (reducedInputTypes);
++        const int               inTypeListSize  = (ops[opNdx].extendedInputTypeCases) ? (DE_LENGTH_OF_ARRAY(extendedInputTypes)) : (DE_LENGTH_OF_ARRAY(reducedInputTypes));
++        const MatrixOp          op              = ops[opNdx].op;
++        tcu::TestCaseGroup*     opGroup         = new tcu::TestCaseGroup(m_testCtx, ops[opNdx].name, ops[opNdx].desc);
++
++        addChild(opGroup);
++
++        for (int inTypeNdx = 0; inTypeNdx < inTypeListSize; inTypeNdx++)
++        {
++            const InputType     inputType   = inTypeList[inTypeNdx].type;
++            tcu::TestCaseGroup* inGroup;
++
++            if (ops[opNdx].createInputTypeGroup)
++            {
++                inGroup = new tcu::TestCaseGroup(m_testCtx, inTypeList[inTypeNdx].name, inTypeList[inTypeNdx].desc);
++                opGroup->addChild(inGroup);
++            }
++            else
++                inGroup = opGroup;
++
++            for (int matTypeNdx = 0; matTypeNdx < DE_LENGTH_OF_ARRAY(matrixTypes); matTypeNdx++)
++            {
++                DataType    matType     = matrixTypes[matTypeNdx];
++                int         numCols     = getDataTypeMatrixNumColumns(matType);
++                int         numRows     = getDataTypeMatrixNumRows(matType);
++                const char* matTypeName = getDataTypeName(matType);
++
++                for (int precNdx = 0; precNdx < DE_LENGTH_OF_ARRAY(precisions); precNdx++)
++                {
++                    Precision   precision   = precisions[precNdx];
++                    const char* precName    = getPrecisionName(precision);
++                    string      baseName    = string(precName) + "_" + matTypeName + "_";
++                    ShaderInput matIn       (inputType, matType, precision);
++
++                    if (isOperationMatrixScalar(op))
++                    {
++                        // Matrix-scalar \note For div cases we use uniform input.
++                        ShaderInput scalarIn(op == OP_DIV ? INPUTTYPE_UNIFORM : INPUTTYPE_DYNAMIC, TYPE_FLOAT, precision);
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_vertex").c_str(),      "Matrix-scalar case", matIn, scalarIn, op, true));
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_fragment").c_str(),    "Matrix-scalar case", matIn, scalarIn, op, false));
++                    }
++
++                    if (isOperationMatrixVector(op))
++                    {
++                        // Matrix-vector.
++                        DataType    colVecType  = getDataTypeFloatVec(numCols);
++                        ShaderInput colVecIn    (op == OP_DIV ? INPUTTYPE_UNIFORM : INPUTTYPE_DYNAMIC, colVecType, precision);
++
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(colVecType) + "_vertex").c_str(),     "Matrix-vector case", matIn, colVecIn, op, true));
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(colVecType) + "_fragment").c_str(),   "Matrix-vector case", matIn, colVecIn, op, false));
++
++                        // Vector-matrix.
++                        DataType    rowVecType  = getDataTypeFloatVec(numRows);
++                        ShaderInput rowVecIn    (op == OP_DIV ? INPUTTYPE_UNIFORM : INPUTTYPE_DYNAMIC, rowVecType, precision);
++                        string      vecMatName  = string(precName) + "_" + getDataTypeName(rowVecType) + "_" + matTypeName;
++
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (vecMatName + "_vertex").c_str(),     "Vector-matrix case", rowVecIn, matIn, op, true));
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (vecMatName + "_fragment").c_str(),   "Vector-matrix case", rowVecIn, matIn, op, false));
++                    }
++
++                    if (isOperationArithmeticMatrixMatrix(op))
++                    {
++                        // Arithmetic matrix-matrix multiplication.
++                        for (int otherCols = 2; otherCols <= 4; otherCols++)
++                        {
++                            ShaderInput otherMatIn(inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_UNIFORM : inputType, getDataTypeMatrix(otherCols, numCols /* rows */), precision);
++                            inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(otherMatIn.dataType) + "_vertex").c_str(),    "Matrix-matrix case", matIn, otherMatIn, op, true));
++                            inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + getDataTypeName(otherMatIn.dataType) + "_fragment").c_str(),  "Matrix-matrix case", matIn, otherMatIn, op, false));
++                        }
++                    }
++                    else if (isOperationComponentwiseMatrixMatrix(op))
++                    {
++                        // Component-wise.
++                        ShaderInput otherMatIn(inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_UNIFORM : inputType, matType, precision);
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + matTypeName + "_vertex").c_str(),     "Matrix-matrix case", matIn, otherMatIn, op, true));
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + matTypeName + "_fragment").c_str(),   "Matrix-matrix case", matIn, otherMatIn, op, false));
++                    }
++
++                    if (isOperationVectorVector(op))
++                    {
++                        ShaderInput vec1In(inputType,                                                               getDataTypeFloatVec(numRows), precision);
++                        ShaderInput vec2In((inputType == INPUTTYPE_DYNAMIC) ? (INPUTTYPE_UNIFORM) : (inputType),    getDataTypeFloatVec(numCols), precision);
++
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_vertex").c_str(),      "Vector-vector case", vec1In, vec2In, op, true));
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_fragment").c_str(),    "Vector-vector case", vec1In, vec2In, op, false));
++                    }
++
++                    if ((isOperationUnaryAnyMatrix(op)) ||
++                        (isOperationUnarySymmetricMatrix(op) && numCols == numRows))
++                    {
++                        ShaderInput voidInput(INPUTTYPE_LAST, TYPE_LAST, PRECISION_LAST);
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_vertex").c_str(),      "Matrix case", matIn, voidInput, op, true));
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_fragment").c_str(),    "Matrix case", matIn, voidInput, op, false));
++                    }
++
++                    if ((isOperationAssignmentAnyMatrix(op)) ||
++                        (isOperationAssignmentSymmetricMatrix(op) && numCols == numRows))
++                    {
++                        ShaderInput otherMatIn(inputType == INPUTTYPE_DYNAMIC ? INPUTTYPE_UNIFORM : inputType, matType, precision);
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_vertex").c_str(),      "Matrix assignment case", matIn, otherMatIn, op, true));
++                        inGroup->addChild(new ShaderMatrixCase(m_context, (baseName + "float_fragment").c_str(),    "Matrix assignment case", matIn, otherMatIn, op, false));
++                    }
++                }
++            }
++        }
++    }
+ }
+ } // Functional
+diff --git a/src/tests/deqp_support/qpTestLog.c b/src/tests/deqp_support/qpTestLog.c
+index 7252ae049..e3eaa9b14 100644
+--- a/src/tests/deqp_support/qpTestLog.c
++++ b/src/tests/deqp_support/qpTestLog.c
+@@ -33,7 +33,7 @@
+ #include "deMutex.h"
+ #if defined(QP_SUPPORT_PNG)
+-#     include <png.h>
++#   include <png.h>
+ #endif
+ #include <stdio.h>
+@@ -41,8 +41,8 @@
+ #include <stdarg.h>
+ #if (DE_OS == DE_OS_WIN32)
+-#     include <windows.h>
+-#     include <io.h>
++#   include <windows.h>
++#   include <io.h>
+ #endif
+ #if defined(DE_DEBUG)
+@@ -51,70 +51,70 @@
+ typedef enum ContainerType_e
+ {
+-      CONTAINERTYPE_SECTION = 0,
+-      CONTAINERTYPE_IMAGESET,
+-      CONTAINERTYPE_EGLCONFIGSET,
+-      CONTAINERTYPE_SHADERPROGRAM,
+-      CONTAINERTYPE_SAMPLELIST,
+-      CONTAINERTYPE_SAMPLEINFO,
+-      CONTAINERTYPE_SAMPLE,
++    CONTAINERTYPE_SECTION = 0,
++    CONTAINERTYPE_IMAGESET,
++    CONTAINERTYPE_EGLCONFIGSET,
++    CONTAINERTYPE_SHADERPROGRAM,
++    CONTAINERTYPE_SAMPLELIST,
++    CONTAINERTYPE_SAMPLEINFO,
++    CONTAINERTYPE_SAMPLE,
+-      CONTAINERTYPE_LAST
++    CONTAINERTYPE_LAST
+ } ContainerType;
+ DE_INLINE deBool childContainersOk (ContainerType type)
+ {
+-      return type == CONTAINERTYPE_SECTION || type == CONTAINERTYPE_SAMPLELIST;
++    return type == CONTAINERTYPE_SECTION || type == CONTAINERTYPE_SAMPLELIST;
+ }
+ enum
+ {
+-      MAX_CONTAINER_STACK_DEPTH               = 32
++    MAX_CONTAINER_STACK_DEPTH       = 32
+ };
+ typedef struct ContainerStack_s
+ {
+-      int                             numElements;
+-      ContainerType   elements[MAX_CONTAINER_STACK_DEPTH];
++    int             numElements;
++    ContainerType   elements[MAX_CONTAINER_STACK_DEPTH];
+ } ContainerStack;
+ DE_INLINE void ContainerStack_reset (ContainerStack* stack)
+ {
+-      deMemset(stack, 0, sizeof(ContainerStack));
++    deMemset(stack, 0, sizeof(ContainerStack));
+ }
+ DE_INLINE deBool ContainerStack_isEmpty (const ContainerStack* stack)
+ {
+-      return stack->numElements == 0;
++    return stack->numElements == 0;
+ }
+ DE_INLINE deBool ContainerStack_push (ContainerStack* stack, ContainerType type)
+ {
+-      if (stack->numElements == MAX_CONTAINER_STACK_DEPTH)
+-              return DE_FALSE;
++    if (stack->numElements == MAX_CONTAINER_STACK_DEPTH)
++        return DE_FALSE;
+-      if (stack->numElements > 0 && !childContainersOk(stack->elements[stack->numElements-1]))
+-              return DE_FALSE;
++    if (stack->numElements > 0 && !childContainersOk(stack->elements[stack->numElements-1]))
++        return DE_FALSE;
+-      stack->elements[stack->numElements]  = type;
+-      stack->numElements                                      += 1;
++    stack->elements[stack->numElements]  = type;
++    stack->numElements                  += 1;
+-      return DE_TRUE;
++    return DE_TRUE;
+ }
+ DE_INLINE ContainerType ContainerStack_pop (ContainerStack* stack)
+ {
+-      DE_ASSERT(stack->numElements > 0);
+-      stack->numElements -= 1;
+-      return stack->elements[stack->numElements];
++    DE_ASSERT(stack->numElements > 0);
++    stack->numElements -= 1;
++    return stack->elements[stack->numElements];
+ }
+ DE_INLINE ContainerType ContainerStack_getTop (const ContainerStack* stack)
+ {
+-      if (stack->numElements > 0)
+-              return stack->elements[stack->numElements-1];
+-      else
+-              return CONTAINERTYPE_LAST;
++    if (stack->numElements > 0)
++        return stack->elements[stack->numElements-1];
++    else
++        return CONTAINERTYPE_LAST;
+ }
+ #endif
+@@ -122,26 +122,26 @@ DE_INLINE ContainerType ContainerStack_getTop (const ContainerStack* stack)
+ /* qpTestLog instance */
+ struct qpTestLog_s
+ {
+-      deUint32                                flags;                          /*!< Logging flags.                                             */
++    deUint32                flags;              /*!< Logging flags.                     */
+-      deMutex                                 lock;                           /*!< Lock for mutable state below.              */
++    deMutex                 lock;               /*!< Lock for mutable state below.      */
+-      /* State protected by lock. */
+-      FILE*                                   outputFile;
+-      qpXmlWriter*                    writer;
+-      deBool                                  isSessionOpen;
+-      deBool                                  isCaseOpen;
++    /* State protected by lock. */
++    FILE*                   outputFile;
++    qpXmlWriter*            writer;
++    deBool                  isSessionOpen;
++    deBool                  isCaseOpen;
+ #if defined(DE_DEBUG)
+-      ContainerStack                  containerStack;         /*!< For container usage verification.  */
++    ContainerStack          containerStack;     /*!< For container usage verification.  */
+ #endif
+ };
+ /* Maps integer to string. */
+ typedef struct qpKeyStringMap_s
+ {
+-      int             key;
+-      char*   string;
++    int     key;
++    char*   string;
+ } qpKeyStringMap;
+ static const char* LOG_FORMAT_VERSION = "0.3.4";
+@@ -149,32 +149,32 @@ static const char* LOG_FORMAT_VERSION = "0.3.4";
+ /* Mapping enum to above strings... */
+ static const qpKeyStringMap s_qpTestTypeMap[] =
+ {
+-      { QP_TEST_CASE_TYPE_SELF_VALIDATE,              "SelfValidate"  },
+-      { QP_TEST_CASE_TYPE_PERFORMANCE,                "Performance"   },
+-      { QP_TEST_CASE_TYPE_CAPABILITY,                 "Capability"    },
+-      { QP_TEST_CASE_TYPE_ACCURACY,                   "Accuracy"              },
++    { QP_TEST_CASE_TYPE_SELF_VALIDATE,      "SelfValidate"  },
++    { QP_TEST_CASE_TYPE_PERFORMANCE,        "Performance"   },
++    { QP_TEST_CASE_TYPE_CAPABILITY,         "Capability"    },
++    { QP_TEST_CASE_TYPE_ACCURACY,           "Accuracy"      },
+-      { QP_TEST_CASE_TYPE_LAST,                               DE_NULL                 }
++    { QP_TEST_CASE_TYPE_LAST,               DE_NULL         }
+ };
+ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpTestTypeMap) == QP_TEST_CASE_TYPE_LAST + 1);
+ static const qpKeyStringMap s_qpTestResultMap[] =
+ {
+-      { QP_TEST_RESULT_PASS,                                          "Pass"                                  },
+-      { QP_TEST_RESULT_FAIL,                                          "Fail"                                  },
+-      { QP_TEST_RESULT_QUALITY_WARNING,                       "QualityWarning"                },
+-      { QP_TEST_RESULT_COMPATIBILITY_WARNING,         "CompatibilityWarning"  },
+-      { QP_TEST_RESULT_PENDING,                                       "Pending"                               },      /* should not be needed here */
+-      { QP_TEST_RESULT_NOT_SUPPORTED,                         "NotSupported"                  },
+-      { QP_TEST_RESULT_RESOURCE_ERROR,                        "ResourceError"                 },
+-      { QP_TEST_RESULT_INTERNAL_ERROR,                        "InternalError"                 },
+-      { QP_TEST_RESULT_CRASH,                                         "Crash"                                 },
+-      { QP_TEST_RESULT_TIMEOUT,                                       "Timeout"                               },
++    { QP_TEST_RESULT_PASS,                      "Pass"                  },
++    { QP_TEST_RESULT_FAIL,                      "Fail"                  },
++    { QP_TEST_RESULT_QUALITY_WARNING,           "QualityWarning"        },
++    { QP_TEST_RESULT_COMPATIBILITY_WARNING,     "CompatibilityWarning"  },
++    { QP_TEST_RESULT_PENDING,                   "Pending"               },  /* should not be needed here */
++    { QP_TEST_RESULT_NOT_SUPPORTED,             "NotSupported"          },
++    { QP_TEST_RESULT_RESOURCE_ERROR,            "ResourceError"         },
++    { QP_TEST_RESULT_INTERNAL_ERROR,            "InternalError"         },
++    { QP_TEST_RESULT_CRASH,                     "Crash"                 },
++    { QP_TEST_RESULT_TIMEOUT,                   "Timeout"               },
+-      /* Add new values here if needed, remember to update qpTestResult enumeration. */
++    /* Add new values here if needed, remember to update qpTestResult enumeration. */
+-      { QP_TEST_RESULT_LAST,                                          DE_NULL                                 }
++    { QP_TEST_RESULT_LAST,                      DE_NULL                 }
+ };
+ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpTestResultMap) == QP_TEST_RESULT_LAST + 1);
+@@ -183,13 +183,13 @@ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpTestResultMap) == QP_TEST_RESULT_LAST +
+ static const qpKeyStringMap s_qpTagMap[] =
+ {
+-      { QP_KEY_TAG_NONE,                      DE_NULL                 },
+-      { QP_KEY_TAG_PERFORMANCE,       "Performance"   },
+-      { QP_KEY_TAG_QUALITY,           "Quality"               },
+-      { QP_KEY_TAG_PRECISION,         "Precision"             },
+-      { QP_KEY_TAG_TIME,                      "Time"                  },
++    { QP_KEY_TAG_NONE,          DE_NULL         },
++    { QP_KEY_TAG_PERFORMANCE,   "Performance"   },
++    { QP_KEY_TAG_QUALITY,       "Quality"       },
++    { QP_KEY_TAG_PRECISION,     "Precision"     },
++    { QP_KEY_TAG_TIME,          "Time"          },
+-      { QP_KEY_TAG_LAST,                      DE_NULL                 }
++    { QP_KEY_TAG_LAST,          DE_NULL         }
+ };
+ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpTagMap) == QP_KEY_TAG_LAST + 1);
+@@ -198,10 +198,10 @@ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpTagMap) == QP_KEY_TAG_LAST + 1);
+ static const qpKeyStringMap s_qpSampleValueTagMap[] =
+ {
+-      { QP_SAMPLE_VALUE_TAG_PREDICTOR,        "Predictor"     },
+-      { QP_SAMPLE_VALUE_TAG_RESPONSE,         "Response"      },
++    { QP_SAMPLE_VALUE_TAG_PREDICTOR,    "Predictor" },
++    { QP_SAMPLE_VALUE_TAG_RESPONSE,     "Response"  },
+-      { QP_SAMPLE_VALUE_TAG_LAST,                     DE_NULL         }
++    { QP_SAMPLE_VALUE_TAG_LAST,         DE_NULL     }
+ };
+ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpSampleValueTagMap) == QP_SAMPLE_VALUE_TAG_LAST + 1);
+@@ -210,12 +210,12 @@ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpSampleValueTagMap) == QP_SAMPLE_VALUE_TA
+ static const qpKeyStringMap s_qpImageCompressionModeMap[] =
+ {
+-      { QP_IMAGE_COMPRESSION_MODE_NONE,       "None"  },
+-      { QP_IMAGE_COMPRESSION_MODE_PNG,        "PNG"   },
++    { QP_IMAGE_COMPRESSION_MODE_NONE,   "None"  },
++    { QP_IMAGE_COMPRESSION_MODE_PNG,    "PNG"   },
+-      { QP_IMAGE_COMPRESSION_MODE_BEST,       DE_NULL },      /* not allowed to be written! */
++    { QP_IMAGE_COMPRESSION_MODE_BEST,   DE_NULL },  /* not allowed to be written! */
+-      { QP_IMAGE_COMPRESSION_MODE_LAST,       DE_NULL }
++    { QP_IMAGE_COMPRESSION_MODE_LAST,   DE_NULL }
+ };
+ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpImageCompressionModeMap) == QP_IMAGE_COMPRESSION_MODE_LAST + 1);
+@@ -224,10 +224,10 @@ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpImageCompressionModeMap) == QP_IMAGE_COM
+ static const qpKeyStringMap s_qpImageFormatMap[] =
+ {
+-      { QP_IMAGE_FORMAT_RGB888,       "RGB888"        },
+-      { QP_IMAGE_FORMAT_RGBA8888,     "RGBA8888"      },
++    { QP_IMAGE_FORMAT_RGB888,   "RGB888"    },
++    { QP_IMAGE_FORMAT_RGBA8888, "RGBA8888"  },
+-      { QP_IMAGE_FORMAT_LAST,         DE_NULL         }
++    { QP_IMAGE_FORMAT_LAST,     DE_NULL     }
+ };
+ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpImageFormatMap) == QP_IMAGE_FORMAT_LAST + 1);
+@@ -236,91 +236,91 @@ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpImageFormatMap) == QP_IMAGE_FORMAT_LAST
+ static const qpKeyStringMap s_qpShaderTypeMap[] =
+ {
+-      { QP_SHADER_TYPE_VERTEX,                        "VertexShader"                  },
+-      { QP_SHADER_TYPE_FRAGMENT,                      "FragmentShader"                },
+-      { QP_SHADER_TYPE_GEOMETRY,                      "GeometryShader"                },
+-      { QP_SHADER_TYPE_TESS_CONTROL,          "TessControlShader"             },
+-      { QP_SHADER_TYPE_TESS_EVALUATION,       "TessEvaluationShader"  },
+-      { QP_SHADER_TYPE_COMPUTE,                       "ComputeShader"                 },
++    { QP_SHADER_TYPE_VERTEX,            "VertexShader"          },
++    { QP_SHADER_TYPE_FRAGMENT,          "FragmentShader"        },
++    { QP_SHADER_TYPE_GEOMETRY,          "GeometryShader"        },
++    { QP_SHADER_TYPE_TESS_CONTROL,      "TessControlShader"     },
++    { QP_SHADER_TYPE_TESS_EVALUATION,   "TessEvaluationShader"  },
++    { QP_SHADER_TYPE_COMPUTE,           "ComputeShader"         },
+-      { QP_SHADER_TYPE_LAST,                          DE_NULL                                 }
++    { QP_SHADER_TYPE_LAST,              DE_NULL                 }
+ };
+ DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_qpShaderTypeMap) == QP_SHADER_TYPE_LAST + 1);
+ static void qpTestLog_flushFile (qpTestLog* log)
+ {
+-      DE_ASSERT(log && log->outputFile);
+-      fflush(log->outputFile);
++    DE_ASSERT(log && log->outputFile);
++    fflush(log->outputFile);
+ #if (DE_OS == DE_OS_WIN32) && (DE_COMPILER == DE_COMPILER_MSC)
+-      /* \todo [petri] Is this really necessary? */
+-      FlushFileBuffers((HANDLE)_get_osfhandle(_fileno(log->outputFile)));
++    /* \todo [petri] Is this really necessary? */
++    FlushFileBuffers((HANDLE)_get_osfhandle(_fileno(log->outputFile)));
+ #endif
+ }
+-#define QP_LOOKUP_STRING(KEYMAP, KEY) qpLookupString(KEYMAP, DE_LENGTH_OF_ARRAY(KEYMAP), (int)(KEY))
++#define QP_LOOKUP_STRING(KEYMAP, KEY)   qpLookupString(KEYMAP, DE_LENGTH_OF_ARRAY(KEYMAP), (int)(KEY))
+ static const char* qpLookupString (const qpKeyStringMap* keyMap, int keyMapSize, int key)
+ {
+-      DE_ASSERT(keyMap);
+-      DE_ASSERT(deInBounds32(key, 0, keyMapSize));
+-      DE_ASSERT(keyMap[key].key == key);
+-      DE_UNREF(keyMapSize); /* for asserting only */
+-      return keyMap[key].string;
++    DE_ASSERT(keyMap);
++    DE_ASSERT(deInBounds32(key, 0, keyMapSize));
++    DE_ASSERT(keyMap[key].key == key);
++    DE_UNREF(keyMapSize); /* for asserting only */
++    return keyMap[key].string;
+ }
+ DE_INLINE void int32ToString (int val, char buf[32])
+ {
+-      deSprintf(&buf[0], 32, "%d", val);
++    deSprintf(&buf[0], 32, "%d", val);
+ }
+ DE_INLINE void int64ToString (deInt64 val, char buf[32])
+ {
+-      deSprintf(&buf[0], 32, "%lld", (long long int)val);
++    deSprintf(&buf[0], 32, "%lld", (long long int)val);
+ }
+ DE_INLINE void floatToString (float value, char* buf, size_t bufSize)
+ {
+-      deSprintf(buf, bufSize, "%f", value);
++    deSprintf(buf, bufSize, "%f", value);
+ }
+ DE_INLINE void doubleToString (double value, char* buf, size_t bufSize)
+ {
+-      deSprintf(buf, bufSize, "%f", value);
++    deSprintf(buf, bufSize, "%f", value);
+ }
+ static deBool beginSession (qpTestLog* log)
+ {
+-      DE_ASSERT(log && !log->isSessionOpen);
++    DE_ASSERT(log && !log->isSessionOpen);
+-      /* Write session info. */
+-      fprintf(log->outputFile, "#sessionInfo releaseName %s\n", qpGetReleaseName());
+-      fprintf(log->outputFile, "#sessionInfo releaseId 0x%08x\n", qpGetReleaseId());