aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/gl/GrGLCaps.cpp3
-rw-r--r--src/gpu/gl/GrGLCaps.h5
-rw-r--r--src/gpu/gl/GrGpuGL.cpp7
-rw-r--r--src/gpu/gl/GrGpuGL.h3
4 files changed, 9 insertions, 9 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index e3dcd57f30..b23a1f8153 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -22,6 +22,7 @@ void GrGLCaps::reset() {
fMaxSampleCount = 0;
fCoverageAAType = kNone_CoverageAAType;
fMaxFragmentUniformVectors = 0;
+ fMaxVertexAttributes = 0;
fRGBA8RenderbufferSupport = false;
fBGRAFormatSupport = false;
fBGRAIsInternalFormat = false;
@@ -44,6 +45,7 @@ GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) {
fStencilFormats = caps.fStencilFormats;
fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs;
fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors;
+ fMaxVertexAttributes = caps.fMaxVertexAttributes;
fMSFBOType = caps.fMSFBOType;
fMaxSampleCount = caps.fMaxSampleCount;
fCoverageAAType = caps.fCoverageAAType;
@@ -83,6 +85,7 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo) {
GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max);
fMaxFragmentUniformVectors = max / 4;
}
+ GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes);
if (kDesktop_GrGLBinding == binding) {
fRGBA8RenderbufferSupport = true;
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index d159d98963..70f17bd9ec 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -171,6 +171,9 @@ public:
/// The maximum number of fragment uniform vectors (GLES has min. 16).
int maxFragmentUniformVectors() const { return fMaxFragmentUniformVectors; }
+ // maximum number of attribute values per vertex
+ int maxVertexAttributes() const { return fMaxVertexAttributes; }
+
/// ES requires an extension to support RGBA8 in RenderBufferStorage
bool rgba8RenderbufferSupport() const { return fRGBA8RenderbufferSupport; }
@@ -260,6 +263,8 @@ private:
SkTArray<VerifiedColorConfigs, true> fStencilVerifiedColorConfigs;
int fMaxFragmentUniformVectors;
+ int fMaxVertexAttributes;
+
MSFBOType fMSFBOType;
int fMaxSampleCount;
CoverageAAType fCoverageAAType;
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index ec535b8a14..7b44035f24 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -280,11 +280,6 @@ void GrGpuGL::initCaps() {
fCaps.fShaderDerivativeSupport =
this->hasExtension("GL_OES_standard_derivatives");
}
-
- GR_GL_GetIntegerv(this->glInterface(),
- GR_GL_MAX_VERTEX_ATTRIBS,
- &fMaxVertexAttribs);
-
}
void GrGpuGL::fillInConfigRenderableTable() {
@@ -549,7 +544,7 @@ void GrGpuGL::onResetContext() {
int posAttrIdx = GrGLProgram::PositionAttributeIdx();
GL_CALL(EnableVertexAttribArray(posAttrIdx));
// Disable all other vertex attributes.
- for (int va = 0; va < fMaxVertexAttribs; ++va) {
+ for (int va = 0; va < this->glCaps().maxVertexAttributes(); ++va) {
if (va != posAttrIdx) {
GL_CALL(DisableVertexAttribArray(va));
}
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index 211dea80dc..fd6ba8ffbd 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -330,9 +330,6 @@ private:
GrColor fHWConstAttribColor;
GrColor fHWConstAttribCoverage;
GrGLProgram fCurrentProgram;
- // If we get rid of fixed function subclass this should move
- // to the GLCaps struct in parent class
- GrGLint fMaxVertexAttribs;
int fActiveTextureUnitIdx;