Commit 09924221 by Ian Elliott Committed by Commit Bot

Convert the EGL end2end tests to use RAII types/macros

These tests are frequently cloned to make new tests, and so it's good to do a more-global refactor so that these and future tests will use RAII. Bug: angleproject:4947 Change-Id: I2973e70ee075629965b18c685793975537e96b6c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2372627Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
parent 027f0c38
......@@ -159,26 +159,25 @@ void main()
// Compile a shader so it puts something in the cache
if (programBinaryAvailable())
{
GLuint program = CompileProgram(kVertexShaderSrc, kFragmentShaderSrc);
ASSERT_NE(0u, program);
ANGLE_GL_PROGRAM(program, kVertexShaderSrc, kFragmentShaderSrc);
EXPECT_EQ(CacheOpResult::SetSuccess, gLastCacheOpResult);
gLastCacheOpResult = CacheOpResult::ValueNotSet;
// Compile the same shader again, so it would try to retrieve it from the cache
program = CompileProgram(kVertexShaderSrc, kFragmentShaderSrc);
ASSERT_NE(0u, program);
program.makeRaster(kVertexShaderSrc, kFragmentShaderSrc);
ASSERT_TRUE(program.valid());
EXPECT_EQ(CacheOpResult::GetSuccess, gLastCacheOpResult);
gLastCacheOpResult = CacheOpResult::ValueNotSet;
// Compile another shader, which should create a new entry
program = CompileProgram(kVertexShaderSrc2, kFragmentShaderSrc2);
ASSERT_NE(0u, program);
program.makeRaster(kVertexShaderSrc2, kFragmentShaderSrc2);
ASSERT_TRUE(program.valid());
EXPECT_EQ(CacheOpResult::SetSuccess, gLastCacheOpResult);
gLastCacheOpResult = CacheOpResult::ValueNotSet;
// Compile the first shader again, which should still reside in the cache
program = CompileProgram(kVertexShaderSrc, kFragmentShaderSrc);
ASSERT_NE(0u, program);
program.makeRaster(kVertexShaderSrc, kFragmentShaderSrc);
ASSERT_TRUE(program.valid());
EXPECT_EQ(CacheOpResult::GetSuccess, gLastCacheOpResult);
gLastCacheOpResult = CacheOpResult::ValueNotSet;
}
......
......@@ -152,15 +152,13 @@ TEST_P(EGLContextSharingTest, DisplayShareGroupObjectSharing)
ASSERT_EGL_SUCCESS();
// Create a texture and buffer in ctx 0
GLuint textureFromCtx0 = 0;
glGenTextures(1, &textureFromCtx0);
GLTexture textureFromCtx0;
glBindTexture(GL_TEXTURE_2D, textureFromCtx0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glBindTexture(GL_TEXTURE_2D, 0);
ASSERT_GL_TRUE(glIsTexture(textureFromCtx0));
GLuint bufferFromCtx0 = 0;
glGenBuffers(1, &bufferFromCtx0);
GLBuffer bufferFromCtx0;
glBindBuffer(GL_ARRAY_BUFFER, bufferFromCtx0);
glBufferData(GL_ARRAY_BUFFER, 1, nullptr, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
......@@ -178,8 +176,7 @@ TEST_P(EGLContextSharingTest, DisplayShareGroupObjectSharing)
ASSERT_GL_NO_ERROR();
// Call readpixels on the texture to verify that the backend has proper support
GLuint fbo = 0;
glGenFramebuffers(1, &fbo);
GLFramebuffer fbo;
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureFromCtx0, 0);
......@@ -187,19 +184,9 @@ TEST_P(EGLContextSharingTest, DisplayShareGroupObjectSharing)
glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
ASSERT_GL_NO_ERROR();
glDeleteFramebuffers(1, &fbo);
glDeleteTextures(1, &textureFromCtx0);
ASSERT_GL_NO_ERROR();
ASSERT_GL_FALSE(glIsTexture(textureFromCtx0));
// Switch back to context 0 and delete the buffer
ASSERT_EGL_TRUE(eglMakeCurrent(display, surface, surface, mContexts[0]));
ASSERT_EGL_SUCCESS();
ASSERT_GL_TRUE(glIsBuffer(bufferFromCtx0));
glDeleteBuffers(1, &bufferFromCtx0);
ASSERT_GL_NO_ERROR();
}
// Tests that shared textures using EGL_ANGLE_display_texture_share_group are released when the last
......@@ -226,8 +213,7 @@ TEST_P(EGLContextSharingTest, DisplayShareGroupReleasedWithLastContext)
// Create a texture and buffer in ctx 0
ASSERT_EGL_TRUE(eglMakeCurrent(display, surface, surface, mContexts[0]));
GLuint textureFromCtx0 = 0;
glGenTextures(1, &textureFromCtx0);
GLTexture textureFromCtx0;
glBindTexture(GL_TEXTURE_2D, textureFromCtx0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glBindTexture(GL_TEXTURE_2D, 0);
......
......@@ -198,7 +198,7 @@ class IOSurfaceClientBufferTest : public ANGLETest
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, getGLTextureTarget(), texture,
0);
EXPECT_GL_NO_ERROR();
EXPECT_GLENUM_EQ(glCheckFramebufferStatus(GL_FRAMEBUFFER), GL_FRAMEBUFFER_COMPLETE);
ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
EXPECT_GL_NO_ERROR();
glClearColor(1.0f / 255.0f, 2.0f / 255.0f, 3.0f / 255.0f, 4.0f / 255.0f);
......@@ -321,7 +321,7 @@ class IOSurfaceClientBufferTest : public ANGLETest
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, getGLTextureTarget(), texture,
0);
EXPECT_GL_NO_ERROR();
EXPECT_GLENUM_EQ(glCheckFramebufferStatus(GL_FRAMEBUFFER), GL_FRAMEBUFFER_COMPLETE);
ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
EXPECT_GL_NO_ERROR();
// Create another framebuffer with a regular renderbuffer.
......@@ -335,7 +335,7 @@ class IOSurfaceClientBufferTest : public ANGLETest
EXPECT_GL_NO_ERROR();
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo);
EXPECT_GL_NO_ERROR();
EXPECT_GLENUM_EQ(glCheckFramebufferStatus(GL_FRAMEBUFFER), GL_FRAMEBUFFER_COMPLETE);
ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
EXPECT_GL_NO_ERROR();
glBindRenderbuffer(GL_RENDERBUFFER, 0);
......
......@@ -14,6 +14,7 @@
#include "common/Color.h"
#include "common/platform.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
#include "util/EGLWindow.h"
#include "util/OSWindow.h"
#include "util/Timer.h"
......@@ -293,8 +294,7 @@ TEST_P(EGLPreRotationSurfaceTest, OrientedWindowWithDraw)
" gl_FragColor = vec4(v_data, 0, 1);\n"
"}";
GLuint program = CompileProgram(kVS, kFS);
ASSERT_NE(0u, program);
ANGLE_GL_PROGRAM(program, kVS, kFS);
glUseProgram(program);
GLint positionLocation = glGetAttribLocation(program, "position");
......@@ -303,14 +303,9 @@ TEST_P(EGLPreRotationSurfaceTest, OrientedWindowWithDraw)
GLint redGreenLocation = glGetAttribLocation(program, "redGreen");
ASSERT_NE(-1, redGreenLocation);
GLuint indexBuffer;
glGenBuffers(1, &indexBuffer);
GLuint vertexArray;
glGenVertexArrays(1, &vertexArray);
std::vector<GLuint> vertexBuffers(2);
glGenBuffers(2, &vertexBuffers[0]);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
glBindVertexArray(vertexArray);
......@@ -388,8 +383,7 @@ TEST_P(EGLPreRotationSurfaceTest, OrientedWindowWithDerivativeDraw)
" FragColor = vec4(dFdx(v_data.x), dFdy(v_data.y), 0, 1);\n"
"}";
GLuint program = CompileProgram(kVS, kFS);
ASSERT_NE(0u, program);
ANGLE_GL_PROGRAM(program, kVS, kFS);
glUseProgram(program);
GLint positionLocation = glGetAttribLocation(program, "position");
......@@ -398,14 +392,9 @@ TEST_P(EGLPreRotationSurfaceTest, OrientedWindowWithDerivativeDraw)
GLint redGreenLocation = glGetAttribLocation(program, "redGreen");
ASSERT_NE(-1, redGreenLocation);
GLuint indexBuffer;
glGenBuffers(1, &indexBuffer);
GLuint vertexArray;
glGenVertexArrays(1, &vertexArray);
std::vector<GLuint> vertexBuffers(2);
glGenBuffers(2, &vertexBuffers[0]);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
glBindVertexArray(vertexArray);
......@@ -514,8 +503,7 @@ TEST_P(EGLPreRotationSurfaceTest, ChangeRotationWithDraw)
" gl_FragColor = vec4(v_data, 0, 1);\n"
"}";
GLuint program = CompileProgram(kVS, kFS);
ASSERT_NE(0u, program);
ANGLE_GL_PROGRAM(program, kVS, kFS);
glUseProgram(program);
GLint positionLocation = glGetAttribLocation(program, "position");
......@@ -524,14 +512,9 @@ TEST_P(EGLPreRotationSurfaceTest, ChangeRotationWithDraw)
GLint redGreenLocation = glGetAttribLocation(program, "redGreen");
ASSERT_NE(-1, redGreenLocation);
GLuint indexBuffer;
glGenBuffers(1, &indexBuffer);
GLuint vertexArray;
glGenVertexArrays(1, &vertexArray);
std::vector<GLuint> vertexBuffers(2);
glGenBuffers(2, &vertexBuffers[0]);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
glBindVertexArray(vertexArray);
......@@ -666,21 +649,15 @@ TEST_P(EGLPreRotationLargeSurfaceTest, OrientedWindowWithFragCoordDraw)
" gl_FragColor = vec4(gl_FragCoord.x / 256.0, gl_FragCoord.y / 256.0, 0.0, 1.0);\n"
"}";
GLuint program = CompileProgram(kVS, kFS);
ASSERT_NE(0u, program);
ANGLE_GL_PROGRAM(program, kVS, kFS);
glUseProgram(program);
GLint positionLocation = glGetAttribLocation(program, "position");
ASSERT_NE(-1, positionLocation);
GLuint indexBuffer;
glGenBuffers(1, &indexBuffer);
GLuint vertexArray;
glGenVertexArrays(1, &vertexArray);
GLuint vertexBuffer;
glGenBuffers(1, &vertexBuffer);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffer;
glBindVertexArray(vertexArray);
......@@ -751,7 +728,10 @@ class EGLPreRotationBlitFramebufferTest : public EGLPreRotationLargeSurfaceTest
return CompileProgram(kVS, kFS);
}
void initializeGeometry(GLuint program)
void initializeGeometry(GLuint program,
GLBuffer *indexBuffer,
GLVertexArray *vertexArray,
GLBuffer *vertexBuffers)
{
GLint positionLocation = glGetAttribLocation(program, "position");
ASSERT_NE(-1, positionLocation);
......@@ -759,19 +739,10 @@ class EGLPreRotationBlitFramebufferTest : public EGLPreRotationLargeSurfaceTest
GLint redGreenLocation = glGetAttribLocation(program, "redGreen");
ASSERT_NE(-1, redGreenLocation);
GLuint indexBuffer;
glGenBuffers(1, &indexBuffer);
GLuint vertexArray;
glGenVertexArrays(1, &vertexArray);
std::vector<GLuint> vertexBuffers(2);
glGenBuffers(2, &vertexBuffers[0]);
glBindVertexArray(vertexArray);
glBindVertexArray(*vertexArray);
std::vector<GLushort> indices = {0, 1, 2, 2, 3, 0};
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, *indexBuffer);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLushort) * indices.size(), &indices[0],
GL_STATIC_DRAW);
......@@ -796,14 +767,9 @@ class EGLPreRotationBlitFramebufferTest : public EGLPreRotationLargeSurfaceTest
glEnableVertexAttribArray(redGreenLocation);
}
GLuint createFBO()
void initializeFBO(GLFramebuffer *framebuffer, GLTexture *texture)
{
GLuint framebuffer = 0;
GLuint texture = 0;
glGenFramebuffers(1, &framebuffer);
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glBindTexture(GL_TEXTURE_2D, *texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
......@@ -811,10 +777,8 @@ class EGLPreRotationBlitFramebufferTest : public EGLPreRotationLargeSurfaceTest
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, mSize, mSize, 0, GL_RGBA, GL_UNSIGNED_BYTE,
nullptr);
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
return framebuffer;
glBindFramebuffer(GL_FRAMEBUFFER, *framebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, *texture, 0);
}
// Ensures that the correct colors are where they should be when the entire 256x256 pattern has
......@@ -860,11 +824,16 @@ TEST_P(EGLPreRotationBlitFramebufferTest, BasicBlitFramebuffer)
ASSERT_NE(0u, program);
glUseProgram(program);
initializeGeometry(program);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
initializeGeometry(program, &indexBuffer, &vertexArray, vertexBuffers);
ASSERT_GL_NO_ERROR();
// Create a texture-backed FBO and render the predictable pattern to it
GLuint fbo = createFBO();
GLFramebuffer fbo;
GLTexture texture;
initializeFBO(&fbo, &texture);
ASSERT_GL_NO_ERROR();
glViewport(0, 0, mSize, mSize);
......@@ -947,11 +916,16 @@ TEST_P(EGLPreRotationBlitFramebufferTest, LeftAndRightBlitFramebuffer)
ASSERT_NE(0u, program);
glUseProgram(program);
initializeGeometry(program);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
initializeGeometry(program, &indexBuffer, &vertexArray, vertexBuffers);
ASSERT_GL_NO_ERROR();
// Create a texture-backed FBO and render the predictable pattern to it
GLuint fbo = createFBO();
GLFramebuffer fbo;
GLTexture texture;
initializeFBO(&fbo, &texture);
ASSERT_GL_NO_ERROR();
glViewport(0, 0, mSize, mSize);
......@@ -1060,11 +1034,16 @@ TEST_P(EGLPreRotationBlitFramebufferTest, TopAndBottomBlitFramebuffer)
ASSERT_NE(0u, program);
glUseProgram(program);
initializeGeometry(program);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
initializeGeometry(program, &indexBuffer, &vertexArray, vertexBuffers);
ASSERT_GL_NO_ERROR();
// Create a texture-backed FBO and render the predictable pattern to it
GLuint fbo = createFBO();
GLFramebuffer fbo;
GLTexture texture;
initializeFBO(&fbo, &texture);
ASSERT_GL_NO_ERROR();
glViewport(0, 0, mSize, mSize);
......@@ -1174,11 +1153,16 @@ TEST_P(EGLPreRotationBlitFramebufferTest, ScaledBlitFramebuffer)
ASSERT_NE(0u, program);
glUseProgram(program);
initializeGeometry(program);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
initializeGeometry(program, &indexBuffer, &vertexArray, vertexBuffers);
ASSERT_GL_NO_ERROR();
// Create a texture-backed FBO and render the predictable pattern to it
GLuint fbo = createFBO();
GLFramebuffer fbo;
GLTexture texture;
initializeFBO(&fbo, &texture);
ASSERT_GL_NO_ERROR();
glViewport(0, 0, mSize, mSize);
......@@ -1292,11 +1276,16 @@ TEST_P(EGLPreRotationBlitFramebufferTest, FboDestBlitFramebuffer)
ASSERT_NE(0u, program);
glUseProgram(program);
initializeGeometry(program);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
initializeGeometry(program, &indexBuffer, &vertexArray, vertexBuffers);
ASSERT_GL_NO_ERROR();
// Create a texture-backed FBO and render the predictable pattern to it
GLuint fbo = createFBO();
GLFramebuffer fbo;
GLTexture texture;
initializeFBO(&fbo, &texture);
ASSERT_GL_NO_ERROR();
glViewport(0, 0, mSize, mSize);
......@@ -1378,11 +1367,16 @@ TEST_P(EGLPreRotationBlitFramebufferTest, FboDestOutOfBoundsSourceBlitFramebuffe
ASSERT_NE(0u, program);
glUseProgram(program);
initializeGeometry(program);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
initializeGeometry(program, &indexBuffer, &vertexArray, vertexBuffers);
ASSERT_GL_NO_ERROR();
// Create a texture-backed FBO and render the predictable pattern to it
GLuint fbo = createFBO();
GLFramebuffer fbo;
GLTexture texture;
initializeFBO(&fbo, &texture);
ASSERT_GL_NO_ERROR();
glViewport(0, 0, mSize, mSize);
......@@ -1530,11 +1524,16 @@ TEST_P(EGLPreRotationBlitFramebufferTest, FboDestOutOfBoundsSourceWithStretchBli
ASSERT_NE(0u, program);
glUseProgram(program);
initializeGeometry(program);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
initializeGeometry(program, &indexBuffer, &vertexArray, vertexBuffers);
ASSERT_GL_NO_ERROR();
// Create a texture-backed FBO and render the predictable pattern to it
GLuint fbo = createFBO();
GLFramebuffer fbo;
GLTexture texture;
initializeFBO(&fbo, &texture);
ASSERT_GL_NO_ERROR();
glViewport(0, 0, mSize, mSize);
......@@ -1649,11 +1648,16 @@ TEST_P(EGLPreRotationBlitFramebufferTest, FboDestOutOfBoundsSourceAndDestBlitFra
ASSERT_NE(0u, program);
glUseProgram(program);
initializeGeometry(program);
GLBuffer indexBuffer;
GLVertexArray vertexArray;
GLBuffer vertexBuffers[2];
initializeGeometry(program, &indexBuffer, &vertexArray, vertexBuffers);
ASSERT_GL_NO_ERROR();
// Create a texture-backed FBO and render the predictable pattern to it
GLuint fbo = createFBO();
GLFramebuffer fbo;
GLTexture texture;
initializeFBO(&fbo, &texture);
ASSERT_GL_NO_ERROR();
glViewport(0, 0, mSize, mSize);
......
......@@ -177,8 +177,7 @@ TEST_P(EGLStreamTest, StreamConsumerGLTextureValidationTest)
ASSERT_EGL_FALSE(result);
ASSERT_EGL_ERROR(EGL_BAD_ACCESS);
GLuint tex;
glGenTextures(1, &tex);
GLTexture tex;
glBindTexture(GL_TEXTURE_EXTERNAL_OES, tex);
result = eglStreamConsumerGLTextureExternalKHR(display, stream);
ASSERT_EGL_TRUE(result);
......@@ -286,8 +285,7 @@ TEST_P(EGLStreamTest, StreamConsumerGLTextureYUVValidationTest)
ASSERT_EGL_FALSE(result);
ASSERT_EGL_ERROR(EGL_BAD_ACCESS);
GLuint tex[2];
glGenTextures(2, tex);
GLTexture tex[2];
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_EXTERNAL_OES, tex[0]);
glActiveTexture(GL_TEXTURE1);
......@@ -342,6 +340,7 @@ TEST_P(EGLStreamTest, StreamConsumerGLTextureYUVDeletionTest)
EGL_NONE,
};
// Note: The purpose of this test means that we can't use the RAII GLTexture class
GLuint tex[2];
glGenTextures(2, tex);
glActiveTexture(GL_TEXTURE0);
......@@ -399,7 +398,7 @@ class D3D11TextureStreamSamplingTest : public ANGLETest
glGenFramebuffers(1, &mFB);
glBindFramebuffer(GL_FRAMEBUFFER, mFB);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, mRB);
ASSERT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER));
ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
glViewport(0, 0, 2, 2);
glClearColor(1, 0, 0, 1);
......@@ -784,8 +783,7 @@ TEST_P(EGLStreamTest, StreamProducerTextureNV12End2End)
EGL_NONE,
};
GLuint tex[2];
glGenTextures(2, tex);
GLTexture tex[2];
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_EXTERNAL_OES, tex[0]);
glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
......
......@@ -14,6 +14,7 @@
#include "common/Color.h"
#include "common/platform.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
#include "util/EGLWindow.h"
#include "util/OSWindow.h"
#include "util/Timer.h"
......@@ -997,14 +998,12 @@ TEST_P(EGLSurfaceTestD3D11, CreateSurfaceWithTextureOffset)
EXPECT_GL_NO_ERROR();
// Blit framebuffer should also blit to the same subrect despite the dstX/Y arguments.
GLuint renderBuffer = 0;
glGenRenderbuffers(1u, &renderBuffer);
GLRenderbuffer renderBuffer;
glBindRenderbuffer(GL_RENDERBUFFER, renderBuffer);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, 50, 50);
EXPECT_GL_NO_ERROR();
GLuint framebuffer = 0;
glGenFramebuffers(1u, &framebuffer);
GLFramebuffer framebuffer;
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, renderBuffer);
EXPECT_GL_NO_ERROR();
......@@ -1023,10 +1022,6 @@ TEST_P(EGLSurfaceTestD3D11, CreateSurfaceWithTextureOffset)
EXPECT_PIXEL_EQ(25, 25, 0, 0, 0, 255);
EXPECT_PIXEL_EQ(75, 75, 0, 255, 0, 255);
EXPECT_GL_NO_ERROR();
glDeleteFramebuffers(1u, &framebuffer);
glDeleteRenderbuffers(1u, &renderBuffer);
EXPECT_GL_NO_ERROR();
}
TEST_P(EGLSurfaceTestD3D11, CreateSurfaceWithMSAA)
......
......@@ -111,7 +111,7 @@ class EGLSurfacelessContextTest : public ANGLETest
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 500, 500, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex->get(), 0);
EXPECT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER));
ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
}
bool checkExtension(bool verbose = true) const
......@@ -197,7 +197,7 @@ TEST_P(EGLSurfacelessContextTest, CheckFramebufferStatus)
GLTexture tex;
createFramebuffer(&fbo, &tex);
glBindFramebuffer(GL_FRAMEBUFFER, fbo.get());
ASSERT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER));
ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
}
// Test that clearing and readpixels work when done in an FBO.
......
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