Don't call GetShaderPrecisionFormat for geometry shaders.

TBR=egdaniel@google.com

Review URL: https://codereview.chromium.org/791713002
This commit is contained in:
bsalomon 2014-12-09 11:16:12 -08:00 committed by Commit bot
parent 9513143efa
commit 06194c5afd

View File

@ -806,7 +806,7 @@ void GrGLCaps::initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, const Gr
if (kGLES_GrGLStandard == ctxInfo.standard() || ctxInfo.version() >= GR_GL_VER(4,1) ||
ctxInfo.hasExtension("GL_ARB_ES2_compatibility")) {
for (int s = 0; s < kGrShaderTypeCount; ++s) {
if (kGeometry_GrShaderType != s || fGeometryShaderSupport) {
if (kGeometry_GrShaderType != s) {
GrShaderType shaderType = static_cast<GrShaderType>(s);
GrGLenum glShader = shader_type_to_gl_shader(shaderType);
PrecisionInfo* first = NULL;
@ -834,7 +834,7 @@ void GrGLCaps::initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, const Gr
// We're on a desktop GL that doesn't have precision info. Assume they're all 32bit float.
fShaderPrecisionVaries = false;
for (int s = 0; s < kGrShaderTypeCount; ++s) {
if (kGeometry_GrShaderType != s || fGeometryShaderSupport) {
if (kGeometry_GrShaderType != s) {
for (int p = 0; p < kGrSLPrecisionCount; ++p) {
fFloatPrecisions[s][p].fLogRangeLow = 127;
fFloatPrecisions[s][p].fLogRangeHigh = 127;
@ -843,6 +843,15 @@ void GrGLCaps::initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, const Gr
}
}
}
// GetShaderPrecisionFormat doesn't accept GL_GEOMETRY_SHADER as a shader type. Assume they're
// the same as the vertex shader. Only fragment shaders were ever allowed to omit support for
// highp. GS was added after GetShaderPrecisionFormat was added to the list of features that
// are recommended against.
if (fGeometryShaderSupport) {
for (int p = 0; p < kGrSLPrecisionCount; ++p) {
fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVertex_GrShaderType][p];
}
}
}