Remove the GL_NV_read_depth_stencil extension

Remove it root and stem to ensure there can't be any usage of it, since
it cannot be efficiently supported by ANGLE with SwiftShader Vulkan
without major changes.

Bug: b/147536183
Bug: b/147762087
Change-Id: Ib413e7c7f8d13ee22a5201e34163f592db572d86
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/40112
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/OpenGL/libGLESv2/Context.cpp b/src/OpenGL/libGLESv2/Context.cpp
index 3fe4246..76b20ec 100644
--- a/src/OpenGL/libGLESv2/Context.cpp
+++ b/src/OpenGL/libGLESv2/Context.cpp
@@ -3394,7 +3394,6 @@
 	switch(format)
 	{
 	case GL_DEPTH_COMPONENT:     // GL_NV_read_depth
-	case GL_DEPTH_STENCIL_OES:   // GL_NV_read_depth_stencil
 		renderTarget = framebuffer->getDepthBuffer();
 		break;
 	case GL_STENCIL_INDEX_OES:   // GL_NV_read_stencil
@@ -3414,64 +3413,12 @@
 	sw::SliceRect dstRect(0, 0, width, height, 0);
 	srcRect.clip(0.0f, 0.0f, (float)renderTarget->getWidth(), (float)renderTarget->getHeight());
 
-	if(format != GL_DEPTH_STENCIL_OES)   // The blitter only handles reading either depth or stencil.
-	{
-		sw::Surface *externalSurface = sw::Surface::create(width, height, 1, es2::ConvertReadFormatType(format, type), pixels, outputPitch, outputPitch  *  outputHeight);
-		device->blit(renderTarget, srcRect, externalSurface, dstRect, false, false, false);
-		externalSurface->lockExternal(0, 0, 0, sw::LOCK_READONLY, sw::PUBLIC);
-		externalSurface->unlockExternal();
-		delete externalSurface;
-	}
-	else   // format == GL_DEPTH_STENCIL_OES
-	{
-		ASSERT(renderTarget->getInternalFormat() == sw::FORMAT_D32F_LOCKABLE);
-		float *depth = (float*)renderTarget->lockInternal((int)srcRect.x0, (int)srcRect.y0, 0, sw::LOCK_READONLY, sw::PUBLIC);
-		uint8_t *stencil = (uint8_t*)renderTarget->lockStencil((int)srcRect.x0, (int)srcRect.y0, 0, sw::PUBLIC);
-
-		switch(type)
-		{
-		case GL_UNSIGNED_INT_24_8_OES:
-			{
-				uint32_t *output = (uint32_t*)pixels;
-
-				for(int y = 0; y < height; y++)
-				{
-					for(int x = 0; x < width; x++)
-					{
-						output[x] = ((uint32_t)roundf(depth[x] * 0xFFFFFF00) & 0xFFFFFF00) | stencil[x];
-					}
-
-					depth += renderTarget->getInternalPitchP();
-					stencil += renderTarget->getStencilPitchB();
-					(uint8_t*&)output += outputPitch;
-				}
-			}
-			break;
-		case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
-			{
-				struct D32FS8 { float depth32f; unsigned int stencil24_8; };
-				D32FS8 *output = (D32FS8*)pixels;
-
-				for(int y = 0; y < height; y++)
-				{
-					for(int x = 0; x < width; x++)
-					{
-						output[x].depth32f = depth[x];
-						output[x].stencil24_8 = stencil[x];
-					}
-
-					depth += renderTarget->getInternalPitchP();
-					stencil += renderTarget->getStencilPitchB();
-					(uint8_t*&)output += outputPitch;
-				}
-			}
-			break;
-		default: UNREACHABLE(type);
-		}
-
-		renderTarget->unlockInternal();
-		renderTarget->unlockStencil();
-	}
+	ASSERT(format != GL_DEPTH_STENCIL_OES);  // The blitter only handles reading either depth or stencil.
+	sw::Surface *externalSurface = sw::Surface::create(width, height, 1, es2::ConvertReadFormatType(format, type), pixels, outputPitch, outputPitch  *  outputHeight);
+	device->blit(renderTarget, srcRect, externalSurface, dstRect, false, false, false);
+	externalSurface->lockExternal(0, 0, 0, sw::LOCK_READONLY, sw::PUBLIC);
+	externalSurface->unlockExternal();
+	delete externalSurface;
 
 	renderTarget->release();
 }
@@ -4602,7 +4549,6 @@
 		"GL_NV_fence",
 	//	"GL_NV_framebuffer_blit",  // b/147536183
 		"GL_NV_read_depth",
-		"GL_NV_read_depth_stencil",
 		"GL_NV_read_stencil",
 	};
 
diff --git a/src/OpenGL/libGLESv2/utilities.cpp b/src/OpenGL/libGLESv2/utilities.cpp
index b8c91be..c423b46 100644
--- a/src/OpenGL/libGLESv2/utilities.cpp
+++ b/src/OpenGL/libGLESv2/utilities.cpp
@@ -679,51 +679,6 @@
 			return true;
 		}
 
-		// GL_NV_read_depth_stencil
-		if(format == GL_DEPTH_STENCIL_OES)
-		{
-			Renderbuffer *depthbuffer = framebuffer->getDepthbuffer();
-
-			if(!depthbuffer)
-			{
-				return error(GL_INVALID_OPERATION, false);
-			}
-
-			GLint internalformat = depthbuffer->getFormat();
-
-			switch(type)
-			{
-			case GL_UNSIGNED_INT_24_8_OES:
-				switch(internalformat)
-				{
-				case GL_DEPTH24_STENCIL8:
-					break;
-				case GL_DEPTH32F_STENCIL8:
-					return error(GL_INVALID_OPERATION, false);
-				default:
-					UNREACHABLE(internalformat);
-					return error(GL_INVALID_OPERATION, false);
-				}
-				break;
-			case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
-				switch(internalformat)
-				{
-				case GL_DEPTH32F_STENCIL8:
-					break;
-				case GL_DEPTH24_STENCIL8:
-					return error(GL_INVALID_OPERATION, false);
-				default:
-					UNREACHABLE(internalformat);
-					return error(GL_INVALID_OPERATION, false);
-				}
-				break;
-			default:
-				return error(GL_INVALID_ENUM, false);
-			}
-
-			return true;
-		}
-
 		// GL_NV_read_stencil
 		if(format == GL_STENCIL_INDEX_OES)
 		{