This patch allows GL_SAMPLES to be set to either 0 or 1 on i965
platforms that don't support MSAA (those prior to Gen6). Setting
GL_SAMPLES=1 has the same effect as setting it to 0 on these platforms
(because MSAA is unsupported), but is distinguishable via the GL API.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50165
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
return 0;
return 0;
default:
- /* MSAA unsupported */
+ /* MSAA unsupported. However, a careful reading of
+ * EXT_framebuffer_multisample reveals that we need to permit
+ * num_samples to be 1 (since num_samples is permitted to be as high as
+ * GL_MAX_SAMPLES, and GL_MAX_SAMPLES must be at least 1). Since
+ * platforms before Gen6 don't support MSAA, this is safe, because
+ * multisampling won't happen anyhow.
+ */
+ if (num_samples > 0)
+ return 1;
return 0;
}
}