From 29f642a95205b5cdd82e50ab420ec858c3ceffe6 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Mon, 2 Oct 2017 13:17:33 -0600 Subject: 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 Commit-Queue: Chris Dalton --- src/gpu/ccpr/GrCCPRTriangleProcessor.cpp | 7 +++++-- 1 file 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"); } -- cgit v1.2.3