Commit 0bb791ed by Geoff Lang Committed by Commit Bot

Revert "ES31: Add test on large strides"

This is failing on Linux AMD: https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.gpu.fyi%2FLinux_Release__AMD_R7_240_%2F1729%2F%2B%2Frecipes%2Fsteps%2Fangle_end2end_tests%2F0%2Fstdout ../../third_party/angle/src/tests/gl_tests/VertexAttributeTest.cpp:684: Failure Expected: (maxStride) >= (2048), actual: 0 vs 2048 This reverts commit 0ba963ef. Reason for revert: <INSERT REASONING HERE> Original change's description: > ES31: Add test on large strides > > ES3.1 requires the implementation should define MAX_VERTEX_ATTRIB_STRIDE, > which should be emulated when we use D3D11 backends. > > This patch adds tests to verify this value required in ES3.1 are > supported to be used directly in glVertexAttribPointer for rendering. > > BUG=angleproject:1593 > > TEST=angle_end2end_tests > > Change-Id: I1ac206e4f6c972b5748552177c787c0adcb66786 > Reviewed-on: https://chromium-review.googlesource.com/441308 > Commit-Queue: Yuly Novikov <ynovikov@chromium.org> > Reviewed-by: Yuly Novikov <ynovikov@chromium.org> > TBR=ynovikov@chromium.org,geofflang@chromium.org,jmadill@chromium.org,cwallez@chromium.org,yunchao.he@intel.com,qiankun.miao@intel.com,jiawei.shao@intel.com,yang.gu@intel.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=angleproject:1593 Change-Id: I036da9d6d5633bcc055cc8cfbfde9a15ae67f59c Reviewed-on: https://chromium-review.googlesource.com/452743 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 6445ddf8
...@@ -443,7 +443,7 @@ struct Caps ...@@ -443,7 +443,7 @@ struct Caps
GLuint64 maxServerWaitTimeout; GLuint64 maxServerWaitTimeout;
// ES 3.1 (April 29, 2015) Table 20.41: Implementation dependent values (cont.) // ES 3.1 (April 29, 2015) Table 20.41: Implementation dependent values (cont.)
GLint maxVertexAttribRelativeOffset; GLuint maxVertexAttribRelativeOffset;
GLuint maxVertexAttribBindings; GLuint maxVertexAttribBindings;
GLint maxVertexAttribStride; GLint maxVertexAttribStride;
GLuint maxElementsIndices; GLuint maxElementsIndices;
......
...@@ -1224,12 +1224,8 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons ...@@ -1224,12 +1224,8 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
static_cast<GLuint>(GetMaximumVertexOutputVectors(featureLevel)) * 4; static_cast<GLuint>(GetMaximumVertexOutputVectors(featureLevel)) * 4;
caps->maxVertexTextureImageUnits = caps->maxVertexTextureImageUnits =
static_cast<GLuint>(GetMaximumVertexTextureUnits(featureLevel)); static_cast<GLuint>(GetMaximumVertexTextureUnits(featureLevel));
// Vertex Attrib Bindings not supported.
// Vertex Attribute Bindings are emulated on D3D11.
caps->maxVertexAttribBindings = caps->maxVertexAttributes; caps->maxVertexAttribBindings = caps->maxVertexAttributes;
// Experimental testing confirmed 2048 is the maximum stride that D3D11 can support on all
// platforms.
caps->maxVertexAttribStride = 2048;
// Fragment shader limits // Fragment shader limits
caps->maxFragmentUniformComponents = caps->maxFragmentUniformComponents =
......
...@@ -612,90 +612,6 @@ TEST_P(VertexAttributeTest, DrawArraysWithBufferOffset) ...@@ -612,90 +612,6 @@ TEST_P(VertexAttributeTest, DrawArraysWithBufferOffset)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
class VertexAttributeTestES31 : public VertexAttributeTestES3
{
protected:
VertexAttributeTestES31() {}
void drawArraysWithStrideAndOffset(GLint stride, GLsizeiptr offset)
{
GLint floatStride = stride ? (stride / TypeStride(GL_FLOAT)) : 1;
GLsizeiptr floatOffset = offset / TypeStride(GL_FLOAT);
size_t floatCount = static_cast<size_t>(floatOffset) + mVertexCount * floatStride;
GLsizeiptr inputSize = static_cast<GLsizeiptr>(floatCount) * TypeStride(GL_FLOAT);
initBasicProgram();
glUseProgram(mProgram);
std::vector<GLfloat> inputData(floatCount);
GLfloat expectedData[mVertexCount];
for (size_t count = 0; count < mVertexCount; ++count)
{
inputData[floatOffset + count * floatStride] = static_cast<GLfloat>(count);
expectedData[count] = static_cast<GLfloat>(count);
}
auto quadVertices = GetQuadVertices();
GLsizeiptr quadVerticesSize =
static_cast<GLsizeiptr>(quadVertices.size() * sizeof(quadVertices[0]));
glGenBuffers(1, &mQuadBuffer);
glBindBuffer(GL_ARRAY_BUFFER, mQuadBuffer);
glBufferData(GL_ARRAY_BUFFER, quadVerticesSize, nullptr, GL_DYNAMIC_DRAW);
glBufferSubData(GL_ARRAY_BUFFER, 0, quadVerticesSize, quadVertices.data());
GLint positionLocation = glGetAttribLocation(mProgram, "position");
ASSERT_NE(-1, positionLocation);
glVertexAttribPointer(positionLocation, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
glEnableVertexAttribArray(positionLocation);
// Ensure inputSize, inputStride and inputOffset are multiples of TypeStride(GL_FLOAT).
GLsizei inputStride = stride ? floatStride * TypeStride(GL_FLOAT) : 0;
GLsizeiptr inputOffset = floatOffset * TypeStride(GL_FLOAT);
glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
glBufferData(GL_ARRAY_BUFFER, inputSize, nullptr, GL_STATIC_DRAW);
glBufferSubData(GL_ARRAY_BUFFER, 0, inputSize, &inputData[0]);
glVertexAttribPointer(mTestAttrib, 1, GL_FLOAT, GL_FALSE, inputStride,
reinterpret_cast<const GLvoid *>(inputOffset));
glEnableVertexAttribArray(mTestAttrib);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glVertexAttribPointer(mExpectedAttrib, 1, GL_FLOAT, GL_FALSE, 0, expectedData);
glEnableVertexAttribArray(mExpectedAttrib);
glDrawArrays(GL_TRIANGLES, 0, 6);
checkPixels();
EXPECT_GL_NO_ERROR();
}
// Set the maximum value for stride if the stride is too large.
const GLint MAX_STRIDE_FOR_TEST = 4095;
};
// Verify that MAX_VERTEX_ATTRIB_STRIDE is no less than the minimum required value (2048) in ES3.1.
TEST_P(VertexAttributeTestES31, MaxVertexAttribStride)
{
GLint maxStride;
glGetIntegerv(GL_MAX_VERTEX_ATTRIB_STRIDE, &maxStride);
ASSERT_GL_NO_ERROR();
EXPECT_GE(maxStride, 2048);
}
// Verify using MAX_VERTEX_ATTRIB_STRIDE as stride doesn't mess up the draw.
// Use default value if the value of MAX_VERTEX_ATTRIB_STRIDE is too large for this test.
TEST_P(VertexAttributeTestES31, DrawArraysWithLargeStride)
{
GLint maxStride;
glGetIntegerv(GL_MAX_VERTEX_ATTRIB_STRIDE, &maxStride);
ASSERT_GL_NO_ERROR();
GLint largeStride = (maxStride < MAX_STRIDE_FOR_TEST) ? maxStride : MAX_STRIDE_FOR_TEST;
drawArraysWithStrideAndOffset(largeStride, 0);
}
class VertexAttributeCachingTest : public VertexAttributeTest class VertexAttributeCachingTest : public VertexAttributeTest
{ {
protected: protected:
...@@ -969,8 +885,6 @@ ANGLE_INSTANTIATE_TEST(VertexAttributeTest, ...@@ -969,8 +885,6 @@ ANGLE_INSTANTIATE_TEST(VertexAttributeTest,
ANGLE_INSTANTIATE_TEST(VertexAttributeTestES3, ES3_D3D11(), ES3_OPENGL(), ES3_OPENGLES()); ANGLE_INSTANTIATE_TEST(VertexAttributeTestES3, ES3_D3D11(), ES3_OPENGL(), ES3_OPENGLES());
ANGLE_INSTANTIATE_TEST(VertexAttributeTestES31, ES31_D3D11(), ES31_OPENGL(), ES31_OPENGLES());
ANGLE_INSTANTIATE_TEST(VertexAttributeCachingTest, ANGLE_INSTANTIATE_TEST(VertexAttributeCachingTest,
ES2_D3D9(), ES2_D3D9(),
ES2_D3D11(), ES2_D3D11(),
......
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