st-api: Have context_create explain why creation failed

This won't be used in the client-side libGL, but the xserver has to
generate a different protocol error depending on the reason context
creation failed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
This commit is contained in:
Ian Romanick
2011-12-13 15:46:20 -08:00
parent 358ecff1ea
commit d18152028e
4 changed files with 36 additions and 5 deletions

View File

@@ -79,6 +79,19 @@ enum st_profile_type
#define ST_CONTEXT_FLAG_FORWARD_COMPATIBLE (1 << 1)
#define ST_CONTEXT_FLAG_ROBUST_ACCESS (1 << 2)
/**
* Reasons that context creation might fail.
*/
enum st_context_error {
ST_CONTEXT_SUCCESS = 0,
ST_CONTEXT_ERROR_NO_MEMORY,
ST_CONTEXT_ERROR_BAD_API,
ST_CONTEXT_ERROR_BAD_VERSION,
ST_CONTEXT_ERROR_BAD_FLAG,
ST_CONTEXT_ERROR_UNKNOWN_ATTRIBUTE,
ST_CONTEXT_ERROR_UNKNOWN_FLAG
};
/**
* Used in st_context_iface->teximage.
*/
@@ -434,6 +447,7 @@ struct st_api
struct st_context_iface *(*create_context)(struct st_api *stapi,
struct st_manager *smapi,
const struct st_context_attribs *attribs,
enum st_context_error *error,
struct st_context_iface *stsharei);
/**