Commit ba4f10a3 by Jamie Madill

Support pixel unpack buffers in TexSubImage3D.

TRAC #23847 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
parent 53683053
......@@ -1757,7 +1757,24 @@ void Texture3D::setCompressedImage(GLint level, GLenum format, GLsizei width, GL
void Texture3D::subImage(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const PixelUnpackState &unpack, const void *pixels)
{
if (Texture::subImage(xoffset, yoffset, zoffset, width, height, depth, format, type, unpack, pixels, mImageArray[level]))
bool fastUnpacked = false;
// Attempt a fast gpu copy of the pixel data to the surface if the app bound an unpack buffer
if (isFastUnpackable(unpack, getInternalFormat(level)))
{
rx::RenderTarget *destRenderTarget = getRenderTarget(level);
Box destArea(xoffset, yoffset, zoffset, width, height, depth);
if (destRenderTarget && fastUnpackPixels(unpack, pixels, destArea, getInternalFormat(level), type, destRenderTarget))
{
// Ensure we don't overwrite our newly initialized data
mImageArray[level]->markClean();
fastUnpacked = true;
}
}
if (!fastUnpacked && Texture::subImage(xoffset, yoffset, zoffset, width, height, depth, format, type, unpack, pixels, mImageArray[level]))
{
commitRect(level, xoffset, yoffset, zoffset, width, height, depth);
}
......
......@@ -6386,11 +6386,6 @@ void __stdcall glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint
return gl::error(GL_INVALID_OPERATION);
}
if (!pixels)
{
return gl::error(GL_INVALID_VALUE);
}
// validateES3TexImageFormat sets the error code if there is an error
if (!ValidateES3TexImageParameters(context, target, level, GL_NONE, false, true,
xoffset, yoffset, zoffset, width, height, depth, 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment