GLSL: Make sampling operations have agnostic precision qualifiers for desktop.

Desktop defaults to highp for samplers, but this should not apply to the built-in
functions, so make it appy only to user declarations.
This commit is contained in:
John Kessenich 2017-10-19 00:26:39 -06:00
parent 3112b5686d
commit f0e35bf0ef
4 changed files with 69 additions and 5 deletions

View file

@ -126,11 +126,6 @@ void TParseContext::setPrecisionDefaults()
sampler.set(EbtFloat, Esd2D);
sampler.external = true;
defaultSamplerPrecision[computeSamplerTypeIndex(sampler)] = EpqLow;
} else {
// Non-ES profile
// All default to highp.
for (int type = 0; type < maxSamplerIndex; ++type)
defaultSamplerPrecision[type] = EpqHigh;
}
// If we are parsing built-in computational variables/functions, it is meaningful to record
@ -146,6 +141,13 @@ void TParseContext::setPrecisionDefaults()
defaultPrecision[EbtUint] = EpqHigh;
defaultPrecision[EbtFloat] = EpqHigh;
}
if (profile != EEsProfile) {
// Non-ES profile
// All sampler precisions default to highp.
for (int type = 0; type < maxSamplerIndex; ++type)
defaultSamplerPrecision[type] = EpqHigh;
}
}
defaultPrecision[EbtSampler] = EpqLow;