Commit 25843dd6 by Yuly Novikov Committed by Commit Bot

Align memory access in Copy32FixedTo32FVertexData

Bug: angleproject:2895 Change-Id: Idfe379e34c4f165b91babcb1990df28fa151d807 Reviewed-on: https://chromium-review.googlesource.com/c/1286373 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 4024e217
...@@ -129,12 +129,26 @@ inline void Copy32FixedTo32FVertexData(const uint8_t *input, size_t stride, size ...@@ -129,12 +129,26 @@ inline void Copy32FixedTo32FVertexData(const uint8_t *input, size_t stride, size
for (size_t i = 0; i < count; i++) for (size_t i = 0; i < count; i++)
{ {
const GLfixed* offsetInput = reinterpret_cast<const GLfixed*>(input + (stride * i)); const uint8_t *offsetInput = input + i * stride;
float* offsetOutput = reinterpret_cast<float*>(output) + i * outputComponentCount; float *offsetOutput = reinterpret_cast<float *>(output) + i * outputComponentCount;
for (size_t j = 0; j < inputComponentCount; j++) // GLfixed access must be 4-byte aligned on arm32, input and stride sometimes are not
if (reinterpret_cast<uintptr_t>(offsetInput) % sizeof(GLfixed) == 0)
{
for (size_t j = 0; j < inputComponentCount; j++)
{
offsetOutput[j] =
static_cast<float>(reinterpret_cast<const GLfixed *>(offsetInput)[j]) * divisor;
}
}
else
{ {
offsetOutput[j] = static_cast<float>(offsetInput[j]) * divisor; for (size_t j = 0; j < inputComponentCount; j++)
{
GLfixed alignedInput;
memcpy(&alignedInput, offsetInput + j * sizeof(GLfixed), sizeof(GLfixed));
offsetOutput[j] = static_cast<float>(alignedInput) * divisor;
}
} }
// 4-component output formats would need special padding in the alpha channel. // 4-component output formats would need special padding in the alpha channel.
......
...@@ -197,10 +197,6 @@ ...@@ -197,10 +197,6 @@
// Passes on Pixel XL. Fails on 5x and Pixel 2. Might be fixd in latest driver. // Passes on Pixel XL. Fails on 5x and Pixel 2. Might be fixd in latest driver.
2609 VULKAN ANDROID : dEQP-GLES2.functional.texture.mipmap.cube.generate.* = SKIP 2609 VULKAN ANDROID : dEQP-GLES2.functional.texture.mipmap.cube.generate.* = SKIP
// These two tests crash on 32-bit configs. Possibly due to an alignment bug.
2895 VULKAN ANDROID : dEQP-GLES2.functional.draw.random.42 = SKIP
2895 VULKAN ANDROID : dEQP-GLES2.functional.draw.random.59 = SKIP
// Fails on Nexus 5x only. TODO(jmadill): Remove suppression when possible. http://anglebug.com/2791 // Fails on Nexus 5x only. TODO(jmadill): Remove suppression when possible. http://anglebug.com/2791
2791 VULKAN ANDROID : dEQP-GLES2.functional.clipping.* = SKIP 2791 VULKAN ANDROID : dEQP-GLES2.functional.clipping.* = SKIP
2599 VULKAN ANDROID : dEQP-GLES2.functional.rasterization.limits.points = FAIL 2599 VULKAN ANDROID : dEQP-GLES2.functional.rasterization.limits.points = FAIL
......
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