|
From: José F. <jfo...@vm...> - 2011-02-06 11:04:29
|
Using the same approach as texCombine.
Logged all combinations and ensured that the frequencies match the desired.
---
src/glean/tblend.cpp | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/glean/tblend.cpp b/src/glean/tblend.cpp
index 057ee4a..00f64e1 100644
--- a/src/glean/tblend.cpp
+++ b/src/glean/tblend.cpp
@@ -695,6 +695,7 @@ BlendFuncTest::runOne(BlendFuncResult& r, Window& w) {
unsigned numOperatorsRGB, numOperatorsA;
BlendFuncResult::PartialResult p;
bool allPassed = true;
+ unsigned testNo, testStride;
// test for features, get function pointers
if (GLUtils::getVersion() >= 1.4) {
@@ -770,6 +771,18 @@ BlendFuncTest::runOne(BlendFuncResult& r, Window& w) {
numOperatorsA = 1; // just ADD
}
+ // If quick mode, run fewer tests
+ if (env->options.quick) {
+ testStride = 11; // a prime number
+ assert(ELEMENTS(srcFactors) % testStride);
+ assert(ELEMENTS(dstFactors) % testStride);
+ assert(ELEMENTS(operators) % testStride);
+ }
+ else {
+ testStride = 1;
+ }
+ testNo = testStride - 1;
+
#if 0
// use this to test a single combination:
p.srcRGB = p.srcA = GL_SRC_ALPHA;
@@ -831,6 +844,15 @@ BlendFuncTest::runOne(BlendFuncResult& r, Window& w) {
needsBlendColor(p.dstA)))
continue;
+ // skip all but every testStride-th test
+ ++testNo;
+ if (testNo == testStride || step >= 1000) {
+ testNo = 0;
+ }
+ else {
+ continue;
+ }
+
if (!runCombo(r, w, p, *env)) {
allPassed = false;
}
--
1.7.2.3
|