Commit d5861a68 by Yuly Novikov Committed by Commit Bot

Fix ASAN errors in end2end tests.

2 minor issues of reading from uninitialized memory in tests. Removes the suppressions from the fixed tests. Bug: chromium:1029378 Change-Id: I466ce231cfed1ce53a60732706c05b778b096805 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2055649Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 4f9608ca
...@@ -637,10 +637,6 @@ TEST_P(ComputeShaderTest, DispatchComputeIndirect) ...@@ -637,10 +637,6 @@ TEST_P(ComputeShaderTest, DispatchComputeIndirect)
// Flaky crash on teardown, see http://anglebug.com/3349 // Flaky crash on teardown, see http://anglebug.com/3349
ANGLE_SKIP_TEST_IF(IsD3D11() && IsIntel() && IsWindows()); ANGLE_SKIP_TEST_IF(IsD3D11() && IsIntel() && IsWindows());
// ASAN error on vulkan backend; ASAN tests only enabled on Mac Swangle
// (http://crbug.com/1029378)
ANGLE_SKIP_TEST_IF(IsOSX() && isSwiftshader());
GLTexture texture; GLTexture texture;
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
const char kCSSource[] = R"(#version 310 es const char kCSSource[] = R"(#version 310 es
...@@ -654,7 +650,7 @@ void main() ...@@ -654,7 +650,7 @@ void main()
ANGLE_GL_COMPUTE_PROGRAM(program, kCSSource); ANGLE_GL_COMPUTE_PROGRAM(program, kCSSource);
glUseProgram(program.get()); glUseProgram(program.get());
const int kWidth = 4, kHeight = 6; const int kWidth = 4, kHeight = 6;
GLuint inputValues[] = {0}; GLuint inputValues[kWidth][kHeight] = {};
GLBuffer buffer; GLBuffer buffer;
glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, buffer); glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, buffer);
......
...@@ -3280,10 +3280,6 @@ TEST_P(GLSLTest_ES31, ArraysOfArraysSampler) ...@@ -3280,10 +3280,6 @@ TEST_P(GLSLTest_ES31, ArraysOfArraysSampler)
// Test that structs containing arrays of samplers work as expected. // Test that structs containing arrays of samplers work as expected.
TEST_P(GLSLTest_ES31, StructArraySampler) TEST_P(GLSLTest_ES31, StructArraySampler)
{ {
// ASAN error on vulkan backend; ASAN tests only enabled on Mac Swangle
// (http://crbug.com/1029378)
ANGLE_SKIP_TEST_IF(IsOSX() && isSwiftshader());
constexpr char kFS[] = constexpr char kFS[] =
"#version 310 es\n" "#version 310 es\n"
"precision mediump float;\n" "precision mediump float;\n"
...@@ -3299,13 +3295,14 @@ TEST_P(GLSLTest_ES31, StructArraySampler) ...@@ -3299,13 +3295,14 @@ TEST_P(GLSLTest_ES31, StructArraySampler)
glUseProgram(program.get()); glUseProgram(program.get());
GLTexture textures[2]; GLTexture textures[2];
GLColor expected = MakeGLColor(32, 64, 96, 255); GLColor expected = MakeGLColor(32, 64, 96, 255);
GLubyte data[6] = {}; // Two bytes of padding, so that texture can be initialized with 4 bytes
memcpy(data, expected.data(), sizeof(expected));
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
glActiveTexture(GL_TEXTURE0 + i); glActiveTexture(GL_TEXTURE0 + i);
glBindTexture(GL_TEXTURE_2D, textures[i]); glBindTexture(GL_TEXTURE_2D, textures[i]);
// Each element provides two components. // Each element provides two components.
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, data + 2 * i);
expected.data() + 2 * i);
std::stringstream uniformName; std::stringstream uniformName;
uniformName << "test.data[" << i << "]"; uniformName << "test.data[" << i << "]";
// Then send it as a uniform // Then send it as a uniform
......
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