Commit a476d16b by Stephen White Committed by Commit Bot

Check that pixel store params are 0 for fastUnpack path on D3D.

Bug: angleproject:5679 Change-Id: I4b4d0e2340592383e20849ad6be99c1608c048c7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2716705Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Stephen White <senorblanco@chromium.org>
parent bdd1ac23
......@@ -357,9 +357,12 @@ angle::Result TextureD3D::subImageCompressed(const gl::Context *context,
return angle::Result::Continue;
}
bool TextureD3D::isFastUnpackable(const gl::Buffer *unpackBuffer, GLenum sizedInternalFormat)
bool TextureD3D::isFastUnpackable(const gl::Buffer *unpackBuffer,
const gl::PixelUnpackState &unpack,
GLenum sizedInternalFormat)
{
return unpackBuffer != nullptr &&
return unpackBuffer != nullptr && unpack.skipRows == 0 && unpack.skipPixels == 0 &&
unpack.imageHeight == 0 && unpack.skipImages == 0 &&
mRenderer->supportsFastCopyBufferToTexture(sizedInternalFormat);
}
......@@ -943,7 +946,7 @@ angle::Result TextureD3D_2D::setImage(const gl::Context *context,
{
ANGLE_TRY(mTexStorage->releaseMultisampledTexStorageForLevel(index.getLevelIndex()));
}
if (isFastUnpackable(unpackBuffer, internalFormatInfo.sizedInternalFormat) &&
if (isFastUnpackable(unpackBuffer, unpack, internalFormatInfo.sizedInternalFormat) &&
isLevelComplete(index.getLevelIndex()))
{
// Will try to create RT storage if it does not exist
......@@ -986,7 +989,7 @@ angle::Result TextureD3D_2D::setSubImage(const gl::Context *context,
{
ANGLE_TRY(mTexStorage->releaseMultisampledTexStorageForLevel(index.getLevelIndex()));
}
if (isFastUnpackable(unpackBuffer, mipFormat) && isLevelComplete(index.getLevelIndex()))
if (isFastUnpackable(unpackBuffer, unpack, mipFormat) && isLevelComplete(index.getLevelIndex()))
{
RenderTargetD3D *renderTarget = nullptr;
ANGLE_TRY(getRenderTarget(context, index, getRenderToTextureSamples(), &renderTarget));
......@@ -2474,8 +2477,8 @@ angle::Result TextureD3D_3D::setImage(const gl::Context *context,
bool fastUnpacked = false;
// Attempt a fast gpu copy of the pixel data to the surface if the app bound an unpack buffer
if (isFastUnpackable(unpackBuffer, internalFormatInfo.sizedInternalFormat) && !size.empty() &&
isLevelComplete(index.getLevelIndex()))
if (isFastUnpackable(unpackBuffer, unpack, internalFormatInfo.sizedInternalFormat) &&
!size.empty() && isLevelComplete(index.getLevelIndex()))
{
// Will try to create RT storage if it does not exist
RenderTargetD3D *destRenderTarget = nullptr;
......@@ -2514,7 +2517,7 @@ angle::Result TextureD3D_3D::setSubImage(const gl::Context *context,
// Attempt a fast gpu copy of the pixel data to the surface if the app bound an unpack buffer
GLenum mipFormat = getInternalFormat(index.getLevelIndex());
if (isFastUnpackable(unpackBuffer, mipFormat) && isLevelComplete(index.getLevelIndex()))
if (isFastUnpackable(unpackBuffer, unpack, mipFormat) && isLevelComplete(index.getLevelIndex()))
{
RenderTargetD3D *destRenderTarget = nullptr;
ANGLE_TRY(getRenderTarget(context, index, getRenderToTextureSamples(), &destRenderTarget));
......
......@@ -149,7 +149,9 @@ class TextureD3D : public TextureImpl, public angle::ObserverInterface
const gl::PixelUnpackState &unpack,
const uint8_t *pixels,
ptrdiff_t layerOffset);
bool isFastUnpackable(const gl::Buffer *unpackBuffer, GLenum sizedInternalFormat);
bool isFastUnpackable(const gl::Buffer *unpackBuffer,
const gl::PixelUnpackState &unpack,
GLenum sizedInternalFormat);
angle::Result fastUnpackPixels(const gl::Context *context,
const gl::PixelUnpackState &unpack,
gl::Buffer *unpackBuffer,
......
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