Commit c2a620b0 by James Darpinian Committed by Commit Bot

Fix out of bounds indices in transform feedback test

Type confusion on the index buffer. It should be unsigned shorts. Fixes a crash on iOS. Bug: angleproject:4992 Bug: angleproject:5417 Change-Id: I18179a89dd81fff2582636496ea9684e432f4400 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2601162Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 5c0ba543
...@@ -2431,20 +2431,20 @@ void main() { ...@@ -2431,20 +2431,20 @@ void main() {
GLBuffer vertexBuffer, indexBuffer, xfbBuffer; GLBuffer vertexBuffer, indexBuffer, xfbBuffer;
GLVertexArray vao; GLVertexArray vao;
constexpr std::array<float, 4> kAttribInitData = {1, 2, 3, 4}; constexpr std::array<float, 4> kAttribInitData = {1, 2, 3, 4};
constexpr std::array<float, 4> kIndexInitData = {0, 1, 2, 3}; constexpr std::array<unsigned short, 4> kIndexInitData = {0, 1, 2, 3};
constexpr std::array<float, 4> kXfbInitData = {0, 0, 0, 0}; constexpr std::array<float, 4> kXfbInitData = {0, 0, 0, 0};
// Initialize buffers. // Initialize buffers.
glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
glBufferData(GL_ARRAY_BUFFER, kAttribInitData.size() * sizeof(float), kAttribInitData.data(), glBufferData(GL_ARRAY_BUFFER, kAttribInitData.size() * sizeof(kAttribInitData[0]),
GL_STATIC_DRAW); kAttribInitData.data(), GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, kIndexInitData.size() * sizeof(float), glBufferData(GL_ELEMENT_ARRAY_BUFFER, kIndexInitData.size() * sizeof(kIndexInitData[0]),
kIndexInitData.data(), GL_STATIC_DRAW); kIndexInitData.data(), GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, xfbBuffer); glBindBuffer(GL_ARRAY_BUFFER, xfbBuffer);
glBufferData(GL_ARRAY_BUFFER, kXfbInitData.size() * sizeof(float), kXfbInitData.data(), glBufferData(GL_ARRAY_BUFFER, kXfbInitData.size() * sizeof(kXfbInitData[0]),
GL_STATIC_DRAW); kXfbInitData.data(), GL_STATIC_DRAW);
// This tests that having a transform feedback buffer bound in an unbound VAO // This tests that having a transform feedback buffer bound in an unbound VAO
// does not affect anything. // does not affect anything.
......
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