Commit de32c3d2 by Trevor David Black Committed by Commit Bot

Reland "Created test and fixed texture storage bug in d3d11"

This is a reland of 03f3ba5b Original change's description: > Created test and fixed texture storage bug in d3d11 > > Bug: b/172489285 > Change-Id: If7d88cf50d99da3380082c60fb3936ae0b20c4e5 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2519876 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: b/172489285 Change-Id: I6b8226164a09aed208c56cb78b5d2c1385298cbe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2546034Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarTrevor David Black <vantablack@google.com> Commit-Queue: Trevor David Black <vantablack@google.com>
parent 326f128b
...@@ -1606,8 +1606,8 @@ angle::Result TextureD3D_2D::redefineImage(const gl::Context *context, ...@@ -1606,8 +1606,8 @@ angle::Result TextureD3D_2D::redefineImage(const gl::Context *context,
} }
if ((level >= storageLevels && storageLevels != 0) || size.width != storageWidth || if ((level >= storageLevels && storageLevels != 0) || size.width != storageWidth ||
size.height != storageHeight || size.height != storageHeight || internalformat != storageFormat ||
internalformat != storageFormat) // Discard mismatched storage mEGLImageTarget) // Discard mismatched storage
{ {
ANGLE_TRY(releaseTexStorage(context)); ANGLE_TRY(releaseTexStorage(context));
markAllImagesDirty(); markAllImagesDirty();
......
...@@ -3832,6 +3832,41 @@ TEST_P(ImageTest, UpdatedExternalTexture) ...@@ -3832,6 +3832,41 @@ TEST_P(ImageTest, UpdatedExternalTexture)
glDeleteTextures(1, &targetTexture); glDeleteTextures(1, &targetTexture);
} }
// Check that the texture successfully updates when an image is deleted
TEST_P(ImageTest, DeletedImageWithSameSizeAndFormat)
{
EGLWindow *window = getEGLWindow();
ANGLE_SKIP_TEST_IF(!hasOESExt() || !hasBaseExt() || !has2DTextureExt());
GLubyte originalData[4] = {255, 0, 255, 255};
GLubyte updateData[4] = {0, 255, 0, 255};
// Create the Image
GLuint source;
EGLImageKHR image;
createEGLImage2DTextureSource(1, 1, GL_RGBA, GL_UNSIGNED_BYTE, kDefaultAttribs, originalData,
&source, &image);
// Create texture & bind to Image
GLuint texture;
createEGLImageTargetTexture2D(image, &texture);
// Delete Image
eglDestroyImageKHR(window->getDisplay(), image);
ASSERT_EGL_SUCCESS();
// Redefine Texture
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, updateData);
ASSERT_GL_NO_ERROR();
// Clean up
glDeleteTextures(1, &source);
glDeleteTextures(1, &texture);
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these // Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against. // tests should be run against.
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3(ImageTest); ANGLE_INSTANTIATE_TEST_ES2_AND_ES3(ImageTest);
......
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