aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGpuGL.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-21 14:48:23 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-21 14:48:23 +0000
commit8e919add406c5d20918a7f0ca811317312e6ce67 (patch)
treeccf88d598957c568910be6f2455763bbaa435372 /src/gpu/gl/GrGpuGL.cpp
parent15455b2a13e9c673ea41a32ca9205bbc21415abc (diff)
Fix GrProgramsTest to not generate tests with too many TexCoord references
Make GrProgramsTest check how many texture coordinate sets are available and select random effects up until the amount runs out. Otherwise, following effect sequence would fail the shader compilation when Skia is compiled with nv_path_rendering on (eg. when fixed function codepath is used): * Stage 0: TextureDomain (1 texcoord) * Stage 1: Convolution (1 texcoord) * Stage 2: Bitmap Alpha Threshold (2 texcoords) * Stage 3: DisplacementMap (2 texcoords) * Stage 4: Config Conversion (1 texcoords) * Stage 5: Two-Point Conical Gradient (2 texcoords) This would use more texture coordinate sets than 8, which is fairly common amount currently. R=bsalomon@google.com, cdalton@nvidia.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/32403002 git-svn-id: http://skia.googlecode.com/svn/trunk@11881 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGpuGL.cpp')
-rw-r--r--src/gpu/gl/GrGpuGL.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 1fd6f7dd45..108979dffc 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2108,6 +2108,7 @@ void GrGpuGL::enableTexGen(int unitIdx,
SkASSERT(this->glCaps().fixedFunctionSupport());
SkASSERT(this->caps()->pathRenderingSupport());
SkASSERT(components >= kS_TexGenComponents && components <= kSTR_TexGenComponents);
+ SkASSERT(this->glCaps().maxFixedFunctionTextureCoords() >= unitIdx);
if (GR_GL_OBJECT_LINEAR == fHWTexGenSettings[unitIdx].fMode &&
components == fHWTexGenSettings[unitIdx].fNumComponents &&
@@ -2180,6 +2181,7 @@ void GrGpuGL::enableTexGen(int unitIdx, TexGenComponents components, const SkMat
void GrGpuGL::disableUnusedTexGen(int numUsedTexCoordSets) {
SkASSERT(this->glCaps().fixedFunctionSupport());
+ SkASSERT(this->glCaps().maxFixedFunctionTextureCoords() >= numUsedTexCoordSets);
for (int i = numUsedTexCoordSets; i < fHWActiveTexGenSets; i++) {
if (0 == fHWTexGenSettings[i].fNumComponents) {