Commit dbb18b53 by Shahbaz Youssefi Committed by Commit Bot

Add texture base-level related tests

Bug: angleproject:4695 Bug: angleproject:4696 Bug: angleproject:4698 Bug: angleproject:4699 Bug: angleproject:4701 Change-Id: Ia49e2100851c029b1ae05bc1398528170d71c3cb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2233402 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 5d7014e4
......@@ -462,6 +462,33 @@ TEST_P(FramebufferTest_ES3, TextureAttachmentMipLevels)
ExpectFramebufferCompleteOrUnsupported(GL_FRAMEBUFFER);
}
TEST_P(FramebufferTest_ES3, TextureAttachmentMipLevelsReadBack)
{
// http://anglebug.com/4695
ANGLE_SKIP_TEST_IF(IsVulkan());
GLFramebuffer framebuffer;
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
GLTexture texture;
glBindTexture(GL_TEXTURE_2D, texture);
const std::array<GLColor, 2 * 2> mip0Data = {GLColor::red, GLColor::red, GLColor::red,
GLColor::red};
const std::array<GLColor, 1 * 1> mip1Data = {GLColor::green};
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, mip0Data.data());
glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, mip1Data.data());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 1);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 1);
EXPECT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
glClearColor(0, 0, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::blue);
}
// Test that passing an attachment COLOR_ATTACHMENTm where m is equal to MAX_COLOR_ATTACHMENTS
// generates an INVALID_OPERATION.
// OpenGL ES Version 3.0.5 (November 3, 2016), 4.4.2.4 Attaching Texture Images to a Framebuffer, p.
......
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