Fix using linear layout for depth readback.
We were using a quad-layout depth format as the destination format for
glReadPixels calls with GL_DEPTH_COMPONENT / GL_FLOAT format. Upload to
a texture was also affected.
Bug b/64542192
Change-Id: I8ad700bf86737debe3268ec6a3dbd237cd85ea1a
Reviewed-on: https://swiftshader-review.googlesource.com/15548
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/OpenGL/common/Image.cpp b/src/OpenGL/common/Image.cpp
index 0a7a3fe..d9cb28a 100644
--- a/src/OpenGL/common/Image.cpp
+++ b/src/OpenGL/common/Image.cpp
@@ -537,7 +537,7 @@
case GL_UNSIGNED_SHORT: return sw::FORMAT_D16;
case GL_UNSIGNED_INT_24_8_OES: return sw::FORMAT_D24S8;
case GL_UNSIGNED_INT: return sw::FORMAT_D32;
- case GL_FLOAT: return sw::FORMAT_D32F;
+ case GL_FLOAT: return sw::FORMAT_D32F_LOCKABLE;
default: UNREACHABLE(type);
}
break;