Revert "Unifying the various texture interfaces where possible"
This reverts commit 8c9038d6f57a4b53c97c4fb803259e7a50ab4cea.
Change-Id: I29c25121870e6f8d12144d235029f46fff90be7c
Reviewed-on: https://chromium-review.googlesource.com/210651
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/renderer/d3d/TextureD3D.cpp b/src/libGLESv2/renderer/d3d/TextureD3D.cpp
index 90364ea..a813422 100644
--- a/src/libGLESv2/renderer/d3d/TextureD3D.cpp
+++ b/src/libGLESv2/renderer/d3d/TextureD3D.cpp
@@ -12,7 +12,6 @@
#include "libEGL/Surface.h"
#include "libGLESv2/Buffer.h"
#include "libGLESv2/Framebuffer.h"
-#include "libGLESv2/Texture.h"
#include "libGLESv2/main.h"
#include "libGLESv2/formatutils.h"
#include "libGLESv2/renderer/BufferImpl.h"
@@ -251,19 +250,12 @@
return storage;
}
-Image *TextureD3D_2D::getImage(int level, int layer) const
+Image *TextureD3D_2D::getImage(int level) const
{
ASSERT(level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS);
- ASSERT(layer == 0);
return mImageArray[level];
}
-GLsizei TextureD3D_2D::getLayerCount(int level) const
-{
- ASSERT(level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS);
- return 1;
-}
-
void TextureD3D_2D::setUsage(GLenum usage)
{
mUsage = usage;
@@ -306,21 +298,17 @@
return gl::GetDepthBits(getInternalFormat(level)) > 0;
}
-void TextureD3D_2D::setImage(GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum internalFormat, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
+void TextureD3D_2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum internalFormat, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_2D && depth == 1);
-
GLenum sizedInternalFormat = gl::IsSizedInternalFormat(internalFormat) ? internalFormat
: gl::GetSizedInternalFormat(format, type);
bool fastUnpacked = false;
- redefineImage(level, sizedInternalFormat, width, height);
-
// Attempt a fast gpu copy of the pixel data to the surface
if (isFastUnpackable(unpack, sizedInternalFormat) && isLevelComplete(level))
{
// Will try to create RT storage if it does not exist
- RenderTarget *destRenderTarget = getRenderTarget(level, 0);
+ RenderTarget *destRenderTarget = getRenderTarget(level);
gl::Box destArea(0, 0, 0, getWidth(level), getHeight(level), 1);
if (destRenderTarget && fastUnpackPixels(unpack, pixels, destArea, sizedInternalFormat, type, destRenderTarget))
@@ -338,25 +326,18 @@
}
}
-void TextureD3D_2D::setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels)
+void TextureD3D_2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_2D && depth == 1);
-
- // compressed formats don't have separate sized internal formats-- we can just use the compressed format directly
- redefineImage(level, format, width, height);
-
TextureD3D::setCompressedImage(imageSize, pixels, mImageArray[level]);
}
-void TextureD3D_2D::subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
+void TextureD3D_2D::subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_2D && depth == 1 && zoffset == 0);
-
bool fastUnpacked = false;
if (isFastUnpackable(unpack, getInternalFormat(level)) && isLevelComplete(level))
{
- RenderTarget *renderTarget = getRenderTarget(level, 0);
+ RenderTarget *renderTarget = getRenderTarget(level);
gl::Box destArea(xoffset, yoffset, 0, width, height, 1);
if (renderTarget && fastUnpackPixels(unpack, pixels, destArea, getInternalFormat(level), type, renderTarget))
@@ -374,24 +355,16 @@
}
}
-void TextureD3D_2D::subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels)
+void TextureD3D_2D::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_2D && depth == 1 && zoffset == 0);
-
if (TextureD3D::subImageCompressed(xoffset, yoffset, 0, width, height, 1, format, imageSize, pixels, mImageArray[level]))
{
commitRect(level, xoffset, yoffset, width, height);
}
}
-void TextureD3D_2D::copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
+void TextureD3D_2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
{
- ASSERT(target == GL_TEXTURE_2D);
-
- GLenum sizedInternalFormat = gl::IsSizedInternalFormat(format) ? format
- : gl::GetSizedInternalFormat(format, GL_UNSIGNED_BYTE);
- redefineImage(level, sizedInternalFormat, width, height);
-
if (!mImageArray[level]->isRenderableFormat())
{
mImageArray[level]->copy(0, 0, 0, x, y, width, height, source);
@@ -417,8 +390,6 @@
void TextureD3D_2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
{
- ASSERT(target == GL_TEXTURE_2D && zoffset == 0);
-
// can only make our texture storage to a render target if level 0 is defined (with a width & height) and
// the current level we're copying to is defined (with appropriate format, width & height)
bool canCreateRenderTarget = isLevelComplete(level) && isLevelComplete(0);
@@ -449,10 +420,8 @@
}
}
-void TextureD3D_2D::storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+void TextureD3D_2D::storage(GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
{
- ASSERT(target == GL_TEXTURE_2D && depth == 1);
-
for (int level = 0; level < levels; level++)
{
GLsizei levelWidth = std::max(1, width >> level);
@@ -568,14 +537,7 @@
void TextureD3D_2D::generateMipmaps()
{
- // Purge array levels 1 through q and reset them to represent the generated mipmap levels.
int levelCount = mipLevels();
- for (int level = 1; level < levelCount; level++)
- {
- redefineImage(level, getBaseLevelInternalFormat(),
- std::max(getBaseLevelWidth() >> level, 1),
- std::max(getBaseLevelHeight() >> level, 1));
- }
if (mTexStorage && mTexStorage->isRenderTarget())
{
@@ -595,16 +557,13 @@
}
}
-unsigned int TextureD3D_2D::getRenderTargetSerial(GLint level, GLint layer)
+unsigned int TextureD3D_2D::getRenderTargetSerial(GLint level)
{
- ASSERT(layer == 0);
return (ensureRenderTarget() ? mTexStorage->getRenderTargetSerial(level) : 0);
}
-RenderTarget *TextureD3D_2D::getRenderTarget(GLint level, GLint layer)
+RenderTarget *TextureD3D_2D::getRenderTarget(GLint level)
{
- ASSERT(layer == 0);
-
// ensure the underlying texture is created
if (!ensureRenderTarget())
{
@@ -622,10 +581,8 @@
return mTexStorage->getRenderTarget(level);
}
-RenderTarget *TextureD3D_2D::getDepthStencil(GLint level, GLint layer)
+RenderTarget *TextureD3D_2D::getDepthSencil(GLint level)
{
- ASSERT(layer == 0);
-
// ensure the underlying texture is created
if (!ensureRenderTarget())
{
@@ -908,17 +865,10 @@
return storage;
}
-Image *TextureD3D_Cube::getImage(int level, int layer) const
+Image *TextureD3D_Cube::getImage(GLenum target, int level) const
{
ASSERT(level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS);
- ASSERT(layer < 6);
- return mImageArray[layer][level];
-}
-
-GLsizei TextureD3D_Cube::getLayerCount(int level) const
-{
- ASSERT(level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS);
- return 6;
+ return mImageArray[targetToIndex(target)][level];
}
void TextureD3D_Cube::setUsage(GLenum usage)
@@ -926,24 +876,21 @@
mUsage = usage;
}
-GLenum TextureD3D_Cube::getInternalFormat(GLint level, GLint layer) const
+GLenum TextureD3D_Cube::getInternalFormat(GLenum target, GLint level) const
{
if (level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
- return mImageArray[layer][level]->getInternalFormat();
+ return mImageArray[targetToIndex(target)][level]->getInternalFormat();
else
return GL_NONE;
}
-bool TextureD3D_Cube::isDepth(GLint level, GLint layer) const
+bool TextureD3D_Cube::isDepth(GLenum target, GLint level) const
{
- return gl::GetDepthBits(getInternalFormat(level, layer)) > 0;
+ return gl::GetDepthBits(getInternalFormat(target, level)) > 0;
}
-void TextureD3D_Cube::setImage(GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum internalFormat, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
+void TextureD3D_Cube::setImage(int faceIndex, GLint level, GLsizei width, GLsizei height, GLenum internalFormat, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
{
- ASSERT(depth == 1);
-
- int faceIndex = gl::TextureCubeMap::targetToLayerIndex(target);
GLenum sizedInternalFormat = gl::IsSizedInternalFormat(internalFormat) ? internalFormat
: gl::GetSizedInternalFormat(format, type);
@@ -952,36 +899,27 @@
TextureD3D::setImage(unpack, type, pixels, mImageArray[faceIndex][level]);
}
-void TextureD3D_Cube::setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels)
+void TextureD3D_Cube::setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
{
- ASSERT(depth == 1);
-
// compressed formats don't have separate sized internal formats-- we can just use the compressed format directly
- int faceIndex = gl::TextureCubeMap::targetToLayerIndex(target);
-
+ int faceIndex = targetToIndex(target);
redefineImage(faceIndex, level, format, width, height);
TextureD3D::setCompressedImage(imageSize, pixels, mImageArray[faceIndex][level]);
}
-void TextureD3D_Cube::subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
+void TextureD3D_Cube::subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
{
- ASSERT(depth == 1 && zoffset == 0);
-
- int faceIndex = gl::TextureCubeMap::targetToLayerIndex(target);
-
+ int faceIndex = targetToIndex(target);
if (TextureD3D::subImage(xoffset, yoffset, 0, width, height, 1, format, type, unpack, pixels, mImageArray[faceIndex][level]))
{
commitRect(faceIndex, level, xoffset, yoffset, width, height);
}
}
-void TextureD3D_Cube::subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels)
+void TextureD3D_Cube::subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels)
{
- ASSERT(depth == 1 && zoffset == 0);
-
- int faceIndex = gl::TextureCubeMap::targetToLayerIndex(target);
-
+ int faceIndex = targetToIndex(target);
if (TextureD3D::subImageCompressed(xoffset, yoffset, 0, width, height, 1, format, imageSize, pixels, mImageArray[faceIndex][level]))
{
commitRect(faceIndex, level, xoffset, yoffset, width, height);
@@ -990,7 +928,7 @@
void TextureD3D_Cube::copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
{
- int faceIndex = gl::TextureCubeMap::targetToLayerIndex(target);
+ int faceIndex = targetToIndex(target);
GLenum sizedInternalFormat = gl::IsSizedInternalFormat(format) ? format
: gl::GetSizedInternalFormat(format, GL_UNSIGNED_BYTE);
redefineImage(faceIndex, level, sizedInternalFormat, width, height);
@@ -1022,7 +960,7 @@
void TextureD3D_Cube::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
{
- int faceIndex = gl::TextureCubeMap::targetToLayerIndex(target);
+ int faceIndex = targetToIndex(target);
// We can only make our texture storage to a render target if the level we're copying *to* is complete
// and the base level is cube-complete. The base level must be cube complete (common case) because we cannot
@@ -1054,14 +992,11 @@
}
}
-void TextureD3D_Cube::storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+void TextureD3D_Cube::storage(GLsizei levels, GLenum internalformat, GLsizei size)
{
- ASSERT(width == height);
- ASSERT(depth == 1);
-
for (int level = 0; level < levels; level++)
{
- GLsizei mipSize = std::max(1, width >> level);
+ GLsizei mipSize = std::max(1, size >> level);
for (int faceIndex = 0; faceIndex < 6; faceIndex++)
{
mImageArray[faceIndex][level]->redefine(mRenderer, GL_TEXTURE_CUBE_MAP, internalformat, mipSize, mipSize, 1, true);
@@ -1078,7 +1013,7 @@
mImmutable = true;
- setCompleteTexStorage(new TextureStorageInterfaceCube(mRenderer, internalformat, IsRenderTargetUsage(mUsage), width, levels));
+ setCompleteTexStorage(new TextureStorageInterfaceCube(mRenderer, internalformat, IsRenderTargetUsage(mUsage), size, levels));
}
bool TextureD3D_Cube::isSamplerComplete(const gl::SamplerState &samplerState) const
@@ -1088,7 +1023,7 @@
bool mipmapping = IsMipmapFiltered(samplerState);
// TODO(geofflang): use context's texture caps
- if (!mRenderer->getRendererTextureCaps().get(getInternalFormat(0, 0)).filterable)
+ if (!mRenderer->getRendererTextureCaps().get(getInternalFormat(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0)).filterable)
{
if (samplerState.magFilter != GL_NEAREST ||
(samplerState.minFilter != GL_NEAREST && samplerState.minFilter != GL_NEAREST_MIPMAP_NEAREST))
@@ -1188,15 +1123,13 @@
}
}
-unsigned int TextureD3D_Cube::getRenderTargetSerial(GLint level, GLint layer)
+unsigned int TextureD3D_Cube::getRenderTargetSerial(GLenum target, GLint level)
{
- GLenum target = gl::TextureCubeMap::layerIndexToTarget(layer);
return (ensureRenderTarget() ? mTexStorage->getRenderTargetSerial(target, level) : 0);
}
-RenderTarget *TextureD3D_Cube::getRenderTarget(GLint level, GLint layer)
+RenderTarget *TextureD3D_Cube::getRenderTarget(GLenum target, GLint level)
{
- GLenum target = gl::TextureCubeMap::layerIndexToTarget(layer);
ASSERT(gl::IsCubemapTextureTarget(target));
// ensure the underlying texture is created
@@ -1205,10 +1138,10 @@
return NULL;
}
- updateStorageFaceLevel(layer, level);
+ updateStorageFaceLevel(targetToIndex(target), level);
// ensure this is NOT a depth texture
- if (isDepth(level, layer))
+ if (isDepth(target, level))
{
return NULL;
}
@@ -1216,9 +1149,8 @@
return mTexStorage->getRenderTarget(target, level);
}
-RenderTarget *TextureD3D_Cube::getDepthStencil(GLint level, GLint layer)
+RenderTarget *TextureD3D_Cube::getDepthStencil(GLenum target, GLint level)
{
- GLenum target = gl::TextureCubeMap::layerIndexToTarget(layer);
ASSERT(gl::IsCubemapTextureTarget(target));
// ensure the underlying texture is created
@@ -1227,10 +1159,10 @@
return NULL;
}
- updateStorageFaceLevel(layer, level);
+ updateStorageFaceLevel(targetToIndex(target), level);
// ensure this is a depth texture
- if (!isDepth(level, layer))
+ if (!isDepth(target, level))
{
return NULL;
}
@@ -1238,6 +1170,17 @@
return mTexStorage->getRenderTarget(target, level);
}
+int TextureD3D_Cube::targetToIndex(GLenum target)
+{
+ META_ASSERT(GL_TEXTURE_CUBE_MAP_NEGATIVE_X - GL_TEXTURE_CUBE_MAP_POSITIVE_X == 1);
+ META_ASSERT(GL_TEXTURE_CUBE_MAP_POSITIVE_Y - GL_TEXTURE_CUBE_MAP_POSITIVE_X == 2);
+ META_ASSERT(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y - GL_TEXTURE_CUBE_MAP_POSITIVE_X == 3);
+ META_ASSERT(GL_TEXTURE_CUBE_MAP_POSITIVE_Z - GL_TEXTURE_CUBE_MAP_POSITIVE_X == 4);
+ META_ASSERT(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z - GL_TEXTURE_CUBE_MAP_POSITIVE_X == 5);
+
+ return target - GL_TEXTURE_CUBE_MAP_POSITIVE_X;
+}
+
void TextureD3D_Cube::initializeStorage(bool renderTarget)
{
// Only initialize the first time this texture is used as a render target or shader resource
@@ -1514,19 +1457,12 @@
return storage;
}
-Image *TextureD3D_3D::getImage(int level, int layer) const
+Image *TextureD3D_3D::getImage(int level) const
{
ASSERT(level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS);
- ASSERT(layer == 0);
return mImageArray[level];
}
-GLsizei TextureD3D_3D::getLayerCount(int level) const
-{
- ASSERT(level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS);
- return 1;
-}
-
void TextureD3D_3D::setUsage(GLenum usage)
{
mUsage = usage;
@@ -1569,10 +1505,8 @@
return gl::GetDepthBits(getInternalFormat(level)) > 0;
}
-void TextureD3D_3D::setImage(GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum internalFormat, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
+void TextureD3D_3D::setImage(GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum internalFormat, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_3D);
-
GLenum sizedInternalFormat = gl::IsSizedInternalFormat(internalFormat) ? internalFormat
: gl::GetSizedInternalFormat(format, type);
redefineImage(level, sizedInternalFormat, width, height, depth);
@@ -1601,20 +1535,16 @@
}
}
-void TextureD3D_3D::setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels)
+void TextureD3D_3D::setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_3D);
-
// compressed formats don't have separate sized internal formats-- we can just use the compressed format directly
redefineImage(level, format, width, height, depth);
TextureD3D::setCompressedImage(imageSize, pixels, mImageArray[level]);
}
-void TextureD3D_3D::subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
+void TextureD3D_3D::subImage(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_3D);
-
bool fastUnpacked = false;
// Attempt a fast gpu copy of the pixel data to the surface if the app bound an unpack buffer
@@ -1638,25 +1568,16 @@
}
}
-void TextureD3D_3D::subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels)
+void TextureD3D_3D::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_3D);
-
if (TextureD3D::subImageCompressed(xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pixels, mImageArray[level]))
{
commitRect(level, xoffset, yoffset, zoffset, width, height, depth);
}
}
-void TextureD3D_3D::copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
-{
- UNIMPLEMENTED();
-}
-
void TextureD3D_3D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
{
- ASSERT(target == GL_TEXTURE_3D);
-
// can only make our texture storage to a render target if level 0 is defined (with a width & height) and
// the current level we're copying to is defined (with appropriate format, width & height)
bool canCreateRenderTarget = isLevelComplete(level) && isLevelComplete(0);
@@ -1687,10 +1608,8 @@
}
}
-void TextureD3D_3D::storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+void TextureD3D_3D::storage(GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
{
- ASSERT(target == GL_TEXTURE_3D);
-
for (int level = 0; level < levels; level++)
{
GLsizei levelWidth = std::max(1, width >> level);
@@ -2129,10 +2048,8 @@
return gl::GetDepthBits(getInternalFormat(level)) > 0;
}
-void TextureD3D_2DArray::setImage(GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum internalFormat, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
+void TextureD3D_2DArray::setImage(GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum internalFormat, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_2D_ARRAY);
-
GLenum sizedInternalFormat = gl::IsSizedInternalFormat(internalFormat) ? internalFormat
: gl::GetSizedInternalFormat(format, type);
redefineImage(level, sizedInternalFormat, width, height, depth);
@@ -2146,10 +2063,8 @@
}
}
-void TextureD3D_2DArray::setCompressedImage(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels)
+void TextureD3D_2DArray::setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_2D_ARRAY);
-
// compressed formats don't have separate sized internal formats-- we can just use the compressed format directly
redefineImage(level, format, width, height, depth);
@@ -2162,10 +2077,8 @@
}
}
-void TextureD3D_2DArray::subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
+void TextureD3D_2DArray::subImage(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const gl::PixelUnpackState &unpack, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_2D_ARRAY);
-
GLenum internalformat = getInternalFormat(level);
GLsizei inputDepthPitch = gl::GetDepthPitch(internalformat, type, width, height, unpack.alignment);
@@ -2181,10 +2094,8 @@
}
}
-void TextureD3D_2DArray::subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels)
+void TextureD3D_2DArray::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels)
{
- ASSERT(target == GL_TEXTURE_2D_ARRAY);
-
GLsizei inputDepthPitch = gl::GetDepthPitch(format, GL_UNSIGNED_BYTE, width, height, 1);
for (int i = 0; i < depth; i++)
@@ -2199,15 +2110,8 @@
}
}
-void TextureD3D_2DArray::copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
-{
- UNIMPLEMENTED();
-}
-
void TextureD3D_2DArray::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
{
- ASSERT(target == GL_TEXTURE_2D_ARRAY);
-
// can only make our texture storage to a render target if level 0 is defined (with a width & height) and
// the current level we're copying to is defined (with appropriate format, width & height)
bool canCreateRenderTarget = isLevelComplete(level) && isLevelComplete(0);
@@ -2237,10 +2141,8 @@
}
}
-void TextureD3D_2DArray::storage(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+void TextureD3D_2DArray::storage(GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
{
- ASSERT(target == GL_TEXTURE_2D_ARRAY);
-
deleteImages();
for (int level = 0; level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)