diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-06-12 12:05:44 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-15 18:06:58 +0000 |
commit | d5d323f45777c4766ddf4c74eedff36ee5d9bc56 (patch) | |
tree | b4af72c66c5265314b19113515e79931de627b26 /src/gpu | |
parent | eee3c09e96d0a925e1ecaec118cc3ac0294e86ea (diff) |
implemented mustImplementGSInvocationsWithLoop workaround in sksl
Bug: skia:
Change-Id: I8434be89537a8baf9e9c5c7a643d28c03108f4ea
Reviewed-on: https://skia-review.googlesource.com/18154
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp b/src/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp index 01f223f4b3..ea8e73f7b8 100644 --- a/src/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp @@ -42,10 +42,6 @@ void GrGLSLGeometryBuilder::configure(InputType inputType, OutputType outputType int numInvocations) { SkASSERT(!this->isConfigured()); fNumInvocations = numInvocations; - if (this->getProgramBuilder()->shaderCaps()->mustImplementGSInvocationsWithLoop()) { - maxVertices *= numInvocations; - numInvocations = 1; - } this->addLayoutQualifier(input_type_name(inputType), kIn_InterfaceQualifier); this->addLayoutQualifier(SkStringPrintf("invocations = %i", numInvocations).c_str(), kIn_InterfaceQualifier); @@ -57,17 +53,4 @@ void GrGLSLGeometryBuilder::configure(InputType inputType, OutputType outputType void GrGLSLGeometryBuilder::onFinalize() { SkASSERT(this->isConfigured()); fProgramBuilder->varyingHandler()->getGeomDecls(&this->inputs(), &this->outputs()); - GrShaderVar sk_InvocationID("sk_InvocationID", kInt_GrSLType); - this->declareGlobal(sk_InvocationID); - SkASSERT(sk_InvocationID.getName() == SkString("sk_InvocationID")); - if (this->getProgramBuilder()->shaderCaps()->mustImplementGSInvocationsWithLoop()) { - SkString invokeFn; - this->emitFunction(kVoid_GrSLType, "invoke", 0, nullptr, this->code().c_str(), &invokeFn); - this->code().printf("for (sk_InvocationID = 0; sk_InvocationID < %i; ++sk_InvocationID) {" - "%s();" - "EndPrimitive();" - "}", fNumInvocations, invokeFn.c_str()); - } else { - this->codePrependf("sk_InvocationID = gl_InvocationID;"); - } } |