Chad Versace <chad.vers...@linux.intel.com> writes: > Commit 2f89662 added the driconf option 'clamp_max_samples'. In that > commit, the option did not alter the context version. > > Specifically, Mesa constructed a GL 3.0 context for Baytrail even if > clamp_max_samples=0, which clamps GL_MAX_SAMPLES to 0. This violates the > GL 3.0 spec, which requires GL_MAX_SAMPLES >= 4. > > The spec violation causes WebGL fail on Chromium because it correctly > assumes that a GL 3.0 context supports at least 4 samples. > > This patch fixes calculation of the context version to respect the > post-clamped value of GL_MAX_SAMPLES. This in turn fixes WebGL on > Chromium when clamp_max_samples=0.
The extra copy of something-a-lot-like-intel_quantize_num_samples() still bothers me, for debug code that we don't expect to ever get turned on. Since it's only called at context init time, something like this might work: /* Clamp max_samples to the highest implementation-supported sample * count less than or equal to the driconf clamp_max_samples option. */ unsigned clamp_max_samples = driQueryOptioni(&brw->optionCache, "clamp_max_samples"); unsigned max_samples = intel_quantize_num_samples(clamp_max_samples); while (intel_quantize_num_samples(max_samples) > clamp_max_samples) max_samples /= 2;
pgpW_PufUphtZ.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev