Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: src/gpu/gl/GrGLProgramEffects.cpp

Issue 543623004: Removing vertex attrib indices (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: warning fixed Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgramEffects.h ('k') | src/gpu/gl/GrGLShaderVar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramEffects.cpp
diff --git a/src/gpu/gl/GrGLProgramEffects.cpp b/src/gpu/gl/GrGLProgramEffects.cpp
index 98e813835ac82f11ddd0dfdf1f42796708647c14..369ec1076030f25e8abccf694006692abb1fbf3a 100644
--- a/src/gpu/gl/GrGLProgramEffects.cpp
+++ b/src/gpu/gl/GrGLProgramEffects.cpp
@@ -11,7 +11,7 @@
#include "gl/GrGLEffect.h"
#include "gl/GrGLPathRendering.h"
#include "gl/builders/GrGLProgramBuilder.h"
-#include "gl/GrGLVertexEffect.h"
+#include "gl/GrGLGeometryProcessor.h"
#include "gl/GrGpuGL.h"
typedef GrGLProgramEffects::TransformedCoords TransformedCoords;
@@ -123,7 +123,7 @@ bool GrGLProgramEffects::GenEffectMetaKey(const GrDrawEffect& drawEffect, const
uint32_t textureKey = GrGLProgramEffects::GenTextureKey(drawEffect, caps);
uint32_t transformKey = GrGLProgramEffects::GenTransformKey(drawEffect);
- uint32_t attribKey = GrGLProgramEffects::GenAttribKey(drawEffect);
+ uint32_t attribKey = GrGLProgramEffects::GenAttribKey(drawEffect.castEffect<GrEffect>());
uint32_t classID = drawEffect.effect()->getFactory().effectClassID();
// Currently we allow 16 bits for each of the above portions of the meta-key. Fail if they
@@ -139,14 +139,14 @@ bool GrGLProgramEffects::GenEffectMetaKey(const GrDrawEffect& drawEffect, const
return true;
}
-uint32_t GrGLProgramEffects::GenAttribKey(const GrDrawEffect& drawEffect) {
+uint32_t GrGLProgramEffects::GenAttribKey(const GrEffect& effect) {
uint32_t key = 0;
- int numAttributes = drawEffect.getVertexAttribIndexCount();
+
+ const GrEffect::VertexAttribArray& vars = effect.getVertexAttribs();
+ int numAttributes = vars.count();
SkASSERT(numAttributes <= 2);
- const int* attributeIndices = drawEffect.getVertexAttribIndices();
for (int a = 0; a < numAttributes; ++a) {
- uint32_t value = attributeIndices[a] << 3 * a;
- SkASSERT(0 == (value & key)); // keys for each attribute ought not to overlap
+ uint32_t value = 1 << a;
key |= value;
}
return key;
@@ -279,7 +279,7 @@ void GrGLVertexProgramEffects::emitEffect(GrGLFullProgramBuilder* builder,
vsBuilder->codeAppend(openBrace.c_str());
if (glEffect->isVertexEffect()) {
- GrGLVertexEffect* vertexEffect = static_cast<GrGLVertexEffect*>(glEffect);
+ GrGLGeometryProcessor* vertexEffect = static_cast<GrGLGeometryProcessor*>(glEffect);
vertexEffect->emitCode(builder, drawEffect, key, outColor, inColor, coords, samplers);
} else {
glEffect->emitCode(builder, drawEffect, key, outColor, inColor, coords, samplers);
@@ -478,7 +478,7 @@ void GrGLPathTexGenProgramEffects::emitEffect(GrGLFragmentOnlyProgramBuilder* bu
SkSTArray<2, TransformedCoords> coords(effect->numTransforms());
SkSTArray<4, TextureSampler> samplers(effect->numTextures());
- SkASSERT(0 == stage.getVertexAttribIndexCount());
+ SkASSERT(0 == effect->getVertexAttribs().count());
this->setupPathTexGen(builder, drawEffect, &coords);
this->emitSamplers(builder, effect, &samplers);
« no previous file with comments | « src/gpu/gl/GrGLProgramEffects.h ('k') | src/gpu/gl/GrGLShaderVar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698