diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-10-02 13:17:33 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-02 19:42:28 +0000 |
commit | 29f642a95205b5cdd82e50ab420ec858c3ceffe6 (patch) | |
tree | 1948b6d9793e1f145e21be5ee24e3f75373eb512 | |
parent | 73f7e1dbdd2921343262b1a57f74a02700edef68 (diff) |
CCPR: Add WAR for an Intel GLSL compiler assertion
Bug: skia:
Change-Id: I8056f10292c28e243a2b9e7c9fa6a4a0705fbab9
Reviewed-on: https://skia-review.googlesource.com/54021
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
-rw-r--r-- | src/gpu/ccpr/GrCCPRTriangleProcessor.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gpu/ccpr/GrCCPRTriangleProcessor.cpp b/src/gpu/ccpr/GrCCPRTriangleProcessor.cpp index 1aac0ed9c2..83b5c7b608 100644 --- a/src/gpu/ccpr/GrCCPRTriangleProcessor.cpp +++ b/src/gpu/ccpr/GrCCPRTriangleProcessor.cpp @@ -16,9 +16,12 @@ void GrCCPRTriangleProcessor::onEmitVertexShader(const GrCCPRCoverageProcessor& const TexelBufferHandle& pointsBuffer, const char* atlasOffset, const char* rtAdjust, GrGPArgs* gpArgs) const { + // Copy the input attrib to an intermediate array. The Intel GLSL compiler hits an internal + // assertion if we index the input attrib itself with sk_VertexID. + v->codeAppendf("int indices[3] = int[3](%s.x, %s.y, %s.z);", + proc.instanceAttrib(), proc.instanceAttrib(), proc.instanceAttrib()); v->codeAppend ("float2 self = "); - v->appendTexelFetch(pointsBuffer, - SkStringPrintf("%s[sk_VertexID]", proc.instanceAttrib()).c_str()); + v->appendTexelFetch(pointsBuffer, "indices[sk_VertexID]"); v->codeAppendf(".xy + %s;", atlasOffset); gpArgs->fPositionVar.set(kFloat2_GrSLType, "self"); } |