From 90dd70b8ea724c1ce9701fc1979ca0bfca657026 Mon Sep 17 00:00:00 2001 From: Jeannot Breton Date: Wed, 7 Jun 2017 17:09:00 -0500 Subject: [PATCH] Fix shader draw parameter pack alignment issue The test allocates a buffer of width*height*3 elements and expects the readPixels to only write to this memory. This is not correct if the window width is not a multiple of 4 Adding a gl.pixelStorei(GL_PACK_ALIGNMENT, 1) before the readPixels fixes the issue Affects: KHR-GL45.shader_draw_parameters_tests.ShaderDrawArraysParameters Components: OpenGL VK-GL-CTS issue: 477 Change-Id: I2bef139f5b1e39fe52b2f00e5a529ce503a5d567 --- external/openglcts/modules/gl/gl4cShaderDrawParametersTests.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/external/openglcts/modules/gl/gl4cShaderDrawParametersTests.cpp b/external/openglcts/modules/gl/gl4cShaderDrawParametersTests.cpp index 99e6087..8f1c228 100644 --- a/external/openglcts/modules/gl/gl4cShaderDrawParametersTests.cpp +++ b/external/openglcts/modules/gl/gl4cShaderDrawParametersTests.cpp @@ -287,7 +287,9 @@ bool ShaderDrawParametersTestBase::verify() std::vector pixels; pixels.resize(width * height * 3); + gl.pixelStorei(GL_PACK_ALIGNMENT, 1); gl.readPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels.data()); + gl.pixelStorei(GL_PACK_ALIGNMENT, 4); std::vector::iterator it; for (it = m_resultPoints.begin(); it != m_resultPoints.end(); ++it) -- 2.7.4