Increased the number of color attachments enums supported

Since the new headers have been committed, a larger amount of
color attachments enums can be supported. Added the new enums
where appropriate.

Change-Id: Idd7210fbeaeb7828ca6c094bed115addd90b497c
Reviewed-on: https://swiftshader-review.googlesource.com/4332
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/libGLESv2/libGLESv2.cpp b/src/OpenGL/libGLESv2/libGLESv2.cpp
index d01ac8d..3a8ee72 100644
--- a/src/OpenGL/libGLESv2/libGLESv2.cpp
+++ b/src/OpenGL/libGLESv2/libGLESv2.cpp
@@ -2153,6 +2153,22 @@
 		case GL_COLOR_ATTACHMENT13:

 		case GL_COLOR_ATTACHMENT14:

 		case GL_COLOR_ATTACHMENT15:

+		case GL_COLOR_ATTACHMENT16:

+		case GL_COLOR_ATTACHMENT17:

+		case GL_COLOR_ATTACHMENT18:

+		case GL_COLOR_ATTACHMENT19:

+		case GL_COLOR_ATTACHMENT20:

+		case GL_COLOR_ATTACHMENT21:

+		case GL_COLOR_ATTACHMENT22:

+		case GL_COLOR_ATTACHMENT23:

+		case GL_COLOR_ATTACHMENT24:

+		case GL_COLOR_ATTACHMENT25:

+		case GL_COLOR_ATTACHMENT26:

+		case GL_COLOR_ATTACHMENT27:

+		case GL_COLOR_ATTACHMENT28:

+		case GL_COLOR_ATTACHMENT29:

+		case GL_COLOR_ATTACHMENT30:

+		case GL_COLOR_ATTACHMENT31:

 			if(clientVersion < 3)

 			{

 				return error(GL_INVALID_ENUM);

@@ -2288,6 +2304,22 @@
 		case GL_COLOR_ATTACHMENT13:

 		case GL_COLOR_ATTACHMENT14:

 		case GL_COLOR_ATTACHMENT15:

+		case GL_COLOR_ATTACHMENT16:

+		case GL_COLOR_ATTACHMENT17:

+		case GL_COLOR_ATTACHMENT18:

+		case GL_COLOR_ATTACHMENT19:

+		case GL_COLOR_ATTACHMENT20:

+		case GL_COLOR_ATTACHMENT21:

+		case GL_COLOR_ATTACHMENT22:

+		case GL_COLOR_ATTACHMENT23:

+		case GL_COLOR_ATTACHMENT24:

+		case GL_COLOR_ATTACHMENT25:

+		case GL_COLOR_ATTACHMENT26:

+		case GL_COLOR_ATTACHMENT27:

+		case GL_COLOR_ATTACHMENT28:

+		case GL_COLOR_ATTACHMENT29:

+		case GL_COLOR_ATTACHMENT30:

+		case GL_COLOR_ATTACHMENT31:

 			if(clientVersion < 3)

 			{

 				return error(GL_INVALID_ENUM);

@@ -2936,6 +2968,22 @@
 		case GL_COLOR_ATTACHMENT13:

 		case GL_COLOR_ATTACHMENT14:

 		case GL_COLOR_ATTACHMENT15:

+		case GL_COLOR_ATTACHMENT16:

+		case GL_COLOR_ATTACHMENT17:

+		case GL_COLOR_ATTACHMENT18:

+		case GL_COLOR_ATTACHMENT19:

+		case GL_COLOR_ATTACHMENT20:

+		case GL_COLOR_ATTACHMENT21:

+		case GL_COLOR_ATTACHMENT22:

+		case GL_COLOR_ATTACHMENT23:

+		case GL_COLOR_ATTACHMENT24:

+		case GL_COLOR_ATTACHMENT25:

+		case GL_COLOR_ATTACHMENT26:

+		case GL_COLOR_ATTACHMENT27:

+		case GL_COLOR_ATTACHMENT28:

+		case GL_COLOR_ATTACHMENT29:

+		case GL_COLOR_ATTACHMENT30:

+		case GL_COLOR_ATTACHMENT31:

 			if(clientVersion < 3)

 			{

 				return error(GL_INVALID_ENUM);

@@ -7317,6 +7365,22 @@
 		case GL_COLOR_ATTACHMENT13:

 		case GL_COLOR_ATTACHMENT14:

 		case GL_COLOR_ATTACHMENT15:

+		case GL_COLOR_ATTACHMENT16:

+		case GL_COLOR_ATTACHMENT17:

+		case GL_COLOR_ATTACHMENT18:

+		case GL_COLOR_ATTACHMENT19:

+		case GL_COLOR_ATTACHMENT20:

+		case GL_COLOR_ATTACHMENT21:

+		case GL_COLOR_ATTACHMENT22:

+		case GL_COLOR_ATTACHMENT23:

+		case GL_COLOR_ATTACHMENT24:

+		case GL_COLOR_ATTACHMENT25:

+		case GL_COLOR_ATTACHMENT26:

+		case GL_COLOR_ATTACHMENT27:

+		case GL_COLOR_ATTACHMENT28:

+		case GL_COLOR_ATTACHMENT29:

+		case GL_COLOR_ATTACHMENT30:

+		case GL_COLOR_ATTACHMENT31:

 			if(clientVersion < 3)

 			{

 				return error(GL_INVALID_ENUM);

diff --git a/src/OpenGL/libGLESv2/libGLESv3.cpp b/src/OpenGL/libGLESv2/libGLESv3.cpp
index caabe19..3408039 100644
--- a/src/OpenGL/libGLESv2/libGLESv3.cpp
+++ b/src/OpenGL/libGLESv2/libGLESv3.cpp
@@ -623,6 +623,22 @@
 		case GL_COLOR_ATTACHMENT13:

 		case GL_COLOR_ATTACHMENT14:

 		case GL_COLOR_ATTACHMENT15:

+		case GL_COLOR_ATTACHMENT16:

+		case GL_COLOR_ATTACHMENT17:

+		case GL_COLOR_ATTACHMENT18:

+		case GL_COLOR_ATTACHMENT19:

+		case GL_COLOR_ATTACHMENT20:

+		case GL_COLOR_ATTACHMENT21:

+		case GL_COLOR_ATTACHMENT22:

+		case GL_COLOR_ATTACHMENT23:

+		case GL_COLOR_ATTACHMENT24:

+		case GL_COLOR_ATTACHMENT25:

+		case GL_COLOR_ATTACHMENT26:

+		case GL_COLOR_ATTACHMENT27:

+		case GL_COLOR_ATTACHMENT28:

+		case GL_COLOR_ATTACHMENT29:

+		case GL_COLOR_ATTACHMENT30:

+		case GL_COLOR_ATTACHMENT31:

 		{

 			GLuint index = (src - GL_COLOR_ATTACHMENT0);

 			if(index >= es2::IMPLEMENTATION_MAX_COLOR_ATTACHMENTS)

@@ -1239,6 +1255,22 @@
 			case GL_COLOR_ATTACHMENT13:

 			case GL_COLOR_ATTACHMENT14:

 			case GL_COLOR_ATTACHMENT15:

+			case GL_COLOR_ATTACHMENT16:

+			case GL_COLOR_ATTACHMENT17:

+			case GL_COLOR_ATTACHMENT18:

+			case GL_COLOR_ATTACHMENT19:

+			case GL_COLOR_ATTACHMENT20:

+			case GL_COLOR_ATTACHMENT21:

+			case GL_COLOR_ATTACHMENT22:

+			case GL_COLOR_ATTACHMENT23:

+			case GL_COLOR_ATTACHMENT24:

+			case GL_COLOR_ATTACHMENT25:

+			case GL_COLOR_ATTACHMENT26:

+			case GL_COLOR_ATTACHMENT27:

+			case GL_COLOR_ATTACHMENT28:

+			case GL_COLOR_ATTACHMENT29:

+			case GL_COLOR_ATTACHMENT30:

+			case GL_COLOR_ATTACHMENT31:

 			{

 				GLuint index = (bufs[i] - GL_COLOR_ATTACHMENT0);

 				if(index >= es2::IMPLEMENTATION_MAX_COLOR_ATTACHMENTS)

@@ -1660,6 +1692,22 @@
 		case GL_COLOR_ATTACHMENT13:

 		case GL_COLOR_ATTACHMENT14:

 		case GL_COLOR_ATTACHMENT15:

+		case GL_COLOR_ATTACHMENT16:

+		case GL_COLOR_ATTACHMENT17:

+		case GL_COLOR_ATTACHMENT18:

+		case GL_COLOR_ATTACHMENT19:

+		case GL_COLOR_ATTACHMENT20:

+		case GL_COLOR_ATTACHMENT21:

+		case GL_COLOR_ATTACHMENT22:

+		case GL_COLOR_ATTACHMENT23:

+		case GL_COLOR_ATTACHMENT24:

+		case GL_COLOR_ATTACHMENT25:

+		case GL_COLOR_ATTACHMENT26:

+		case GL_COLOR_ATTACHMENT27:

+		case GL_COLOR_ATTACHMENT28:

+		case GL_COLOR_ATTACHMENT29:

+		case GL_COLOR_ATTACHMENT30:

+		case GL_COLOR_ATTACHMENT31:

 			if(!framebuffer || framebuffer->getColorbufferName(attachment - GL_COLOR_ATTACHMENT0) == 0)

 			{

 				return error(GL_INVALID_OPERATION);

@@ -3824,7 +3872,7 @@
 					break;

 				default:

 					if(attachments[i] >= GL_COLOR_ATTACHMENT0 &&

-					   attachments[i] <= GL_COLOR_ATTACHMENT15)

+					   attachments[i] <= GL_COLOR_ATTACHMENT31)

 					{

 						if(attachments[i] - GL_COLOR_ATTACHMENT0 >= MAX_DRAW_BUFFERS)

 						{

diff --git a/src/OpenGL/libGLESv2/utilities.cpp b/src/OpenGL/libGLESv2/utilities.cpp
index d7ec68b..dfff1da 100644
--- a/src/OpenGL/libGLESv2/utilities.cpp
+++ b/src/OpenGL/libGLESv2/utilities.cpp
@@ -1352,6 +1352,22 @@
 		case GL_COLOR_ATTACHMENT13:

 		case GL_COLOR_ATTACHMENT14:

 		case GL_COLOR_ATTACHMENT15:

+		case GL_COLOR_ATTACHMENT16:

+		case GL_COLOR_ATTACHMENT17:

+		case GL_COLOR_ATTACHMENT18:

+		case GL_COLOR_ATTACHMENT19:

+		case GL_COLOR_ATTACHMENT20:

+		case GL_COLOR_ATTACHMENT21:

+		case GL_COLOR_ATTACHMENT22:

+		case GL_COLOR_ATTACHMENT23:

+		case GL_COLOR_ATTACHMENT24:

+		case GL_COLOR_ATTACHMENT25:

+		case GL_COLOR_ATTACHMENT26:

+		case GL_COLOR_ATTACHMENT27:

+		case GL_COLOR_ATTACHMENT28:

+		case GL_COLOR_ATTACHMENT29:

+		case GL_COLOR_ATTACHMENT30:

+		case GL_COLOR_ATTACHMENT31:

 			switch(format)

 			{

 			case sw::FORMAT_R8I: