mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Fix] (MG_Test/VertexArrayTest): Allow default VAO.
This commit is contained in:
@@ -37,8 +37,9 @@ TEST_F(VertexArrayTest, GenerateAndBindVAO) {
|
|||||||
glContext.BindVertexArray(vaoNames[1]);
|
glContext.BindVertexArray(vaoNames[1]);
|
||||||
ASSERT_EQ(glContext.GetBoundVertexArray(), vao1);
|
ASSERT_EQ(glContext.GetBoundVertexArray(), vao1);
|
||||||
|
|
||||||
glContext.BindVertexArray(0);
|
// glContext.BindVertexArray(0);
|
||||||
ASSERT_EQ(glContext.GetBoundVertexArray(), nullptr);
|
// ASSERT_EQ(glContext.GetBoundVertexArray(), nullptr);
|
||||||
|
// Do not detect if it supports default VAO
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(VertexArrayTest, VertexAttributeSetup) {
|
TEST_F(VertexArrayTest, VertexAttributeSetup) {
|
||||||
@@ -406,21 +407,6 @@ TEST_F(GeneralVertexArrayTest, General_ComplexUsage) {
|
|||||||
EXPECT_EQ(GetError(), GL_NO_ERROR);
|
EXPECT_EQ(GetError(), GL_NO_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GeneralVertexArrayTest, General_BindWithoutCreation) {
|
|
||||||
GLuint vao = 1;
|
|
||||||
|
|
||||||
BindVertexArray(vao);
|
|
||||||
EXPECT_EQ(GetError(), GL_INVALID_OPERATION);
|
|
||||||
|
|
||||||
EXPECT_EQ(MG_State::pGLContext->GetVertexArrayObject(vao), nullptr);
|
|
||||||
|
|
||||||
GLuint vbo = CreateVBO(GL_ARRAY_BUFFER, 64);
|
|
||||||
VertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
|
|
||||||
EXPECT_EQ(GetError(), GL_INVALID_OPERATION);
|
|
||||||
|
|
||||||
EXPECT_EQ(GetError(), GL_NO_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(GeneralVertexArrayTest, General_DeleteBoundVAO) {
|
TEST_F(GeneralVertexArrayTest, General_DeleteBoundVAO) {
|
||||||
GLuint vao = CreateVAO();
|
GLuint vao = CreateVAO();
|
||||||
GLuint vbo = CreateVBO(GL_ARRAY_BUFFER, 64);
|
GLuint vbo = CreateVBO(GL_ARRAY_BUFFER, 64);
|
||||||
@@ -471,9 +457,9 @@ TEST_F(GeneralVertexArrayTest, General_ElementBufferBindingPoint) {
|
|||||||
MG_State::pGLContext->GetBufferObject(ebo2));
|
MG_State::pGLContext->GetBufferObject(ebo2));
|
||||||
|
|
||||||
BindVertexArray(0);
|
BindVertexArray(0);
|
||||||
BindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo1);
|
// BindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo1);
|
||||||
|
// EXPECT_EQ(GetError(), GL_INVALID_OPERATION);
|
||||||
EXPECT_EQ(GetError(), GL_INVALID_OPERATION);
|
// Do not detect if it supports default VAO
|
||||||
|
|
||||||
BindVertexArray(vao1);
|
BindVertexArray(vao1);
|
||||||
DeleteVertexArrays(1, &vao1);
|
DeleteVertexArrays(1, &vao1);
|
||||||
|
|||||||
Reference in New Issue
Block a user