gallium: add st_api feature mask to prevent advertising MS visuals

v2: use a define for the maximum sample count
v3: also test odd sample counts (r300 supports MS3)

While multisample renderbuffers are supported by mesa, MS visuals
are not, so we need a way to tell dri/st not to advertise them even
if the gallium driver does support multisampled surfaces.

Otherwise applications selecting these non-functional visuals would
run into trouble ...

Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Christoph Bumiller
2012-05-21 23:46:11 +02:00
parent 6404095fba
commit f80c2874ec
4 changed files with 37 additions and 12 deletions

View File

@@ -69,6 +69,17 @@ enum st_profile_type
#define ST_PROFILE_OPENGL_ES1_MASK (1 << ST_PROFILE_OPENGL_ES1)
#define ST_PROFILE_OPENGL_ES2_MASK (1 << ST_PROFILE_OPENGL_ES2)
/**
* Optional API/state tracker features.
*/
enum st_api_feature
{
ST_API_FEATURE_MS_VISUALS /**< support for multisample visuals */
};
/* for feature_mask in st_api */
#define ST_API_FEATURE_MS_VISUALS_MASK (1 << ST_API_FEATURE_MS_VISUALS)
/**
* New context flags for GL 3.0 and beyond.
*
@@ -429,6 +440,11 @@ struct st_api
*/
unsigned profile_mask;
/**
* The supported optional features. Tested with ST_FEATURE_*_MASK.
*/
unsigned feature_mask;
/**
* Destroy the API.
*/