Conditionally insert gl_PointSize into shaders.
BUG=chromium:648816
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2358843002
Review-Url: https://codereview.chromium.org/2358843002
diff --git a/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp b/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
index 4931e0f..f8302b3 100644
--- a/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
@@ -46,8 +46,10 @@
posVar.c_str(), fRtAdjustName, fRtAdjustName);
}
// We could have the GrGeometryProcessor do this, but its just easier to have it performed
- // here. If we ever need to set variable pointsize, then we can reinvestigate
- this->codeAppend("gl_PointSize = 1.0;");
+ // here. If we ever need to set variable pointsize, then we can reinvestigate.
+ if (this->getProgramBuilder()->desc().header().fHasPointSize) {
+ this->codeAppend("gl_PointSize = 1.0;");
+ }
}
void GrGLSLVertexBuilder::onFinalize() {