aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/gl/GrGLProgram.cpp8
-rw-r--r--src/gpu/gl/GrGpuGL.h7
2 files changed, 11 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 60bae63feb..5c88441615 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -202,8 +202,12 @@ void GrGLProgram::BuildDesc(const GrDrawState& drawState,
} else {
desc->fCoverageAttributeIndex = GrDrawState::kCoverageOverrideAttribIndexValue;
}
- desc->fEdgeAttributeIndex = drawState.getAttribIndex(GrDrawState::kEdge_AttribIndex);
- desc->fTexCoordAttributeIndex = drawState.getAttribIndex(GrDrawState::kTexCoord_AttribIndex);
+ if (desc->fAttribBindings & GrDrawState::kEdge_AttribBindingsBit) {
+ desc->fEdgeAttributeIndex = drawState.getAttribIndex(GrDrawState::kEdge_AttribIndex);
+ }
+ if (GrDrawState::AttributesBindExplicitTexCoords(desc->fAttribBindings)) {
+ desc->fTexCoordAttributeIndex = drawState.getAttribIndex(GrDrawState::kTexCoord_AttribIndex);
+ }
#if GR_DEBUG
// verify valid vertex attribute state
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index a859d18595..a0194151c7 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -10,6 +10,7 @@
#ifndef GrGpuGL_DEFINED
#define GrGpuGL_DEFINED
+
#include "GrBinHashKey.h"
#include "GrDrawState.h"
#include "GrGpu.h"
@@ -292,7 +293,7 @@ private:
this->setVertexBufferID(0);
}
for (int i = 0; i < fAttribArrayCount; ++i) {
- if (fAttribArrays[i].vertexBufferID() == id) {
+ if (fAttribArrays[i].isVertexBufferIDBound(id)) {
fAttribArrays[i].invalidate();
}
}
@@ -379,7 +380,9 @@ private:
fAttribPointerIsValid = false;
}
- GrGLuint vertexBufferID() const { return fVertexBufferID; }
+ bool isVertexBufferIDBound(GrGLuint id) const {
+ return fAttribPointerIsValid && id == fVertexBufferID;
+ }
private:
bool fEnableIsValid;
bool fAttribPointerIsValid;