Commit c30003d6 by Jamie Madill

Fix zero-size textures and unpack buffers.

We would sometimes attempt to use a NULL staging texture when initializing a zero size texture when using unpack buffers. Change-Id: I2e03141c19d9c47eeffb0d56c03bcfe476a9e48d Reviewed-on: https://chromium-review.googlesource.com/181781Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarNicolas Capens <nicolascapens@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 4b8c3eba
...@@ -263,6 +263,12 @@ GLenum Texture::getBaseLevelInternalFormat() const ...@@ -263,6 +263,12 @@ GLenum Texture::getBaseLevelInternalFormat() const
void Texture::setImage(const PixelUnpackState &unpack, GLenum type, const void *pixels, rx::Image *image) void Texture::setImage(const PixelUnpackState &unpack, GLenum type, const void *pixels, rx::Image *image)
{ {
// No-op
if (image->getWidth() == 0 || image->getHeight() == 0 || image->getDepth() == 0)
{
return;
}
// We no longer need the "GLenum format" parameter to TexImage to determine what data format "pixels" contains. // We no longer need the "GLenum format" parameter to TexImage to determine what data format "pixels" contains.
// From our image internal format we know how many channels to expect, and "type" gives the format of pixel's components. // From our image internal format we know how many channels to expect, and "type" gives the format of pixel's components.
const void *pixelData = pixels; const void *pixelData = pixels;
......
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