aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GLProgramsTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/GLProgramsTest.cpp')
-rw-r--r--tests/GLProgramsTest.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 0df29aafbf..d85d8a5f95 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -54,12 +54,6 @@ void GrGLProgramDesc::setRandom(SkMWCRandom* random,
fDiscardIfZeroCoverage = random->nextBool();
- if (gpu->caps()->dualSourceBlendingSupport()) {
- fDualSrcOutput = random->nextULessThan(kDualSrcOutputCnt);
- } else {
- fDualSrcOutput = kNone_DualSrcOutput;
- }
-
bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::kMaxVertexAttribCnt;
fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1;
@@ -78,6 +72,17 @@ void GrGLProgramDesc::setRandom(SkMWCRandom* random,
if (dstRead) {
this->fDstRead = GrGLShaderBuilder::KeyForDstRead(dstTexture, gpu->glCaps());
}
+
+ CoverageOutput coverageOutput;
+ bool illegalCoverageOutput;
+ do {
+ coverageOutput = static_cast<CoverageOutput>(random->nextULessThan(kCoverageOutputCnt));
+ illegalCoverageOutput = (!gpu->caps()->dualSourceBlendingSupport() &&
+ CoverageOutputUsesSecondaryOutput(coverageOutput)) ||
+ !dstRead && kCombineWithDst_CoverageOutput == coverageOutput;
+ } while (illegalCoverageOutput);
+
+ fCoverageOutput = coverageOutput;
}
bool GrGpuGL::programUnitTest(int maxStages) {