Commit d61396b4 by Geoff Lang Committed by Commit Bot

Reduce the number of iterations of SwizzleTest.

KHR_debug from the GL drivers was generating a lot of spam. BUG=angleproject:1925 Change-Id: I89568ea2bec3afb629f86c25d9e80aad1dbe79f8 Reviewed-on: https://chromium-review.googlesource.com/450857Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent c9da71ff
...@@ -25,29 +25,34 @@ class SwizzleTest : public ANGLETest ...@@ -25,29 +25,34 @@ class SwizzleTest : public ANGLETest
setConfigBlueBits(8); setConfigBlueBits(8);
setConfigAlphaBits(8); setConfigAlphaBits(8);
GLenum swizzles[] = constexpr GLenum swizzles[] = {
{ GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_ZERO, GL_ONE,
GL_RED,
GL_GREEN,
GL_BLUE,
GL_ALPHA,
GL_ZERO,
GL_ONE,
}; };
for (int r = 0; r < 6; r++) // Only use every 13th swizzle permutation, use a prime number to make sure the permuations
// are somewhat evenly distributed. Reduces the permuations from 1296 to 100.
constexpr size_t swizzleReductionFactor = 13;
size_t swizzleCount = 0;
for (GLenum r : swizzles)
{ {
for (int g = 0; g < 6; g++) for (GLenum g : swizzles)
{ {
for (int b = 0; b < 6; b++) for (GLenum b : swizzles)
{ {
for (int a = 0; a < 6; a++) for (GLenum a : swizzles)
{ {
swizzleCount++;
if (swizzleCount % swizzleReductionFactor != 0)
{
continue;
}
swizzlePermutation permutation; swizzlePermutation permutation;
permutation.swizzleRed = swizzles[r]; permutation.swizzleRed = r;
permutation.swizzleGreen = swizzles[g]; permutation.swizzleGreen = g;
permutation.swizzleBlue = swizzles[b]; permutation.swizzleBlue = b;
permutation.swizzleAlpha = swizzles[a]; permutation.swizzleAlpha = a;
mPermutations.push_back(permutation); mPermutations.push_back(permutation);
} }
} }
...@@ -163,10 +168,8 @@ class SwizzleTest : public ANGLETest ...@@ -163,10 +168,8 @@ class SwizzleTest : public ANGLETest
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
for (size_t i = 0; i < mPermutations.size(); i++) for (const auto &permutation : mPermutations)
{ {
const swizzlePermutation& permutation = mPermutations[i];
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, permutation.swizzleRed); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, permutation.swizzleRed);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, permutation.swizzleGreen); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, permutation.swizzleGreen);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, permutation.swizzleBlue); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, permutation.swizzleBlue);
......
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