Bumped num stages to 4 in preparation for AA clipping

http://codereview.appspot.com/6135046/



git-svn-id: http://skia.googlecode.com/svn/trunk@3783 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2012-04-27 18:59:52 +00:00
parent 76b7fcc79e
commit ec05eaaeac
5 changed files with 18 additions and 23 deletions

View File

@ -38,7 +38,7 @@ public:
* or not.
*/
enum {
kNumStages = 3,
kNumStages = 4,
kMaxTexCoords = kNumStages
};

View File

@ -75,26 +75,30 @@ void gen_globals() {
/* These values were generated by the above function */
const GrVertexLayout gStageTexCoordMasks[] = {
0x49,
0x92,
0x124
0x1111,
0x2222,
0x4444,
0x8888,
};
GR_STATIC_ASSERT(GrDrawState::kNumStages == GR_ARRAY_COUNT(gStageTexCoordMasks));
const GrVertexLayout gStageMasks[] = {
0x249,
0x492,
0x924
};
const GrVertexLayout gStageMasks[] = {
0x11111,
0x22222,
0x44444,
0x88888,
};
GR_STATIC_ASSERT(GrDrawState::kNumStages == GR_ARRAY_COUNT(gStageMasks));
const GrVertexLayout gTexCoordMasks[] = {
0x7,
0x38,
0x1c0,
0xf,
0xf0,
0xf00,
0xf000,
};
GR_STATIC_ASSERT(GrDrawState::kMaxTexCoords == GR_ARRAY_COUNT(gTexCoordMasks));
bool check_layout(GrVertexLayout layout) {
// can only have 1 or 0 bits set for each stage.
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
@ -1291,3 +1295,4 @@ void GrDrawTarget::Caps::print() const {
GrPrintf("Max Render Target Size : %d\n", fMaxRenderTargetSize);
}

View File

@ -275,9 +275,6 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLGetIntegerv(GrGLenum pname, GrGLint* params)
case GR_GL_MAX_VERTEX_ATTRIBS:
*params = 16;
break;
case GR_GL_MAX_TEXTURE_UNITS:
*params = 8;
break;
default:
GrCrash("Unexpected pname to GetIntegerv");
}

View File

@ -230,10 +230,6 @@ void GrGpuGL::initCaps() {
const GrGLInterface* gl = this->glInterface();
GR_GL_GetIntegerv(gl, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
GrAssert(maxTextureUnits > GrDrawState::kNumStages);
if (kES2_GrGLBinding != this->glBinding()) {
GR_GL_GetIntegerv(gl, GR_GL_MAX_TEXTURE_UNITS, &maxTextureUnits);
GrAssert(maxTextureUnits > GrDrawState::kNumStages);
}
GrGLint numFormats;
GR_GL_GetIntegerv(gl, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats);

View File

@ -758,9 +758,6 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLGetIntegerv(GrGLenum pname, GrGLint* params)
case GR_GL_MAX_VARYING_VECTORS:
*params = kDefaultMaxVaryingVectors;
break;
case GR_GL_MAX_TEXTURE_UNITS:
*params = GrDebugGL::getInstance()->getMaxTextureUnits();
break;
default:
GrCrash("Unexpected pname to GetIntegerv");
}