Adding Texture3D support.
Bug 19126833
Added Texture3D argument verifications.
Added the basic API and functions. A few are still unimplemented:
- Image::loadCompressedData() (for depth other than 1)
- Texture3D::copyImage()
- Texture3D::generateMipmaps()
Added colour grading test for 3D texture
Change-Id: I9e52afa7213999f94c5916c2f301fc6fa4b42c0d
Reviewed-on: https://swiftshader-review.googlesource.com/1730
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/libGL/Image.cpp b/src/OpenGL/libGL/Image.cpp
index 9e98db2..4168d82 100644
--- a/src/OpenGL/libGL/Image.cpp
+++ b/src/OpenGL/libGL/Image.cpp
@@ -32,7 +32,7 @@
Image::Image(Texture *parentTexture, GLsizei width, GLsizei height, GLenum format, GLenum type)
: parentTexture(parentTexture)
- , egl::Image(getParentResource(parentTexture), width, height, format, type, selectInternalFormat(format, type))
+ , egl::Image(getParentResource(parentTexture), width, height, 1, format, type, selectInternalFormat(format, type))
{
referenceCount = 1;
}
@@ -176,7 +176,7 @@
return sw::FORMAT_A8R8G8B8;
}
- void Image::loadImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *input)
+ void Image::loadImageData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint unpackAlignment, const void *input)
{
GLsizei inputPitch = ComputePitch(width, format, type, unpackAlignment);
void *buffer = lock(0, 0, sw::LOCK_WRITEONLY);
@@ -644,7 +644,7 @@
}
}
- void Image::loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
+ void Image::loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels)
{
int inputPitch = ComputeCompressedPitch(width, format);
int rows = imageSize / inputPitch;