diff options
author | Neil Roberts <[email protected]> | 2014-10-01 20:00:46 +0100 |
---|---|---|
committer | Adam Jackson <[email protected]> | 2017-11-06 16:09:02 -0500 |
commit | 6d87500fe12e77ad13db057430964b864cacb055 (patch) | |
tree | ace32137fad6b6ed17de33d7c1566b31263598d2 /src/mesa/drivers/dri/r200 | |
parent | 8c0729fd99c8548ceaf40e273b809ce0a69d8a44 (diff) |
dri: Change __DriverApiRec::CreateContext to take a struct for attribs
Previously the CreateContext method of __DriverApiRec took a set of
arguments to describe the attribute values from the window system API's
CreateContextAttribs function. As more attributes get added this could
quickly get unworkable and every new attribute needs a modification for
every driver.
To fix that, pass the attribute values in a struct instead. The struct
has a bitmask to specify which members are used. The first three members
(two for the GL version and one for the flags) are always set. If the
bit is not set in the attribute mask then it can be assumed the
attribute has the default value. Drivers will error if unknown bits in
the mask are set.
Reviewed-by: Adam Jackson <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Neil Roberts <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_context.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_context.h | 7 |
2 files changed, 6 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index bd4f8b62cd2..edd433ae97e 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -174,11 +174,7 @@ static void r200_init_vtbl(radeonContextPtr radeon) GLboolean r200CreateContext( gl_api api, const struct gl_config *glVisual, __DRIcontext *driContextPriv, - unsigned major_version, - unsigned minor_version, - uint32_t flags, - bool notify_reset, - unsigned priority, + const struct __DriverContextConfig *ctx_config, unsigned *error, void *sharedContextPrivate) { @@ -190,12 +186,12 @@ GLboolean r200CreateContext( gl_api api, int i; int tcl_mode; - if (flags & ~(__DRI_CTX_FLAG_DEBUG | __DRI_CTX_FLAG_NO_ERROR)) { + if (ctx_config->flags & ~(__DRI_CTX_FLAG_DEBUG | __DRI_CTX_FLAG_NO_ERROR)) { *error = __DRI_CTX_ERROR_UNKNOWN_FLAG; return false; } - if (notify_reset) { + if (ctx_config->attribute_mask) { *error = __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE; return false; } @@ -251,7 +247,7 @@ GLboolean r200CreateContext( gl_api api, ctx = &rmesa->radeon.glCtx; - driContextSetFlags(ctx, flags); + driContextSetFlags(ctx, ctx_config->flags); /* Initialize the software rasterizer and helper modules. */ diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index 200e0a24312..f9ba6835e80 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -628,11 +628,8 @@ extern void r200DestroyContext( __DRIcontext *driContextPriv ); extern GLboolean r200CreateContext( gl_api api, const struct gl_config *glVisual, __DRIcontext *driContextPriv, - unsigned major_version, - unsigned minor_version, - uint32_t flags, - bool notify_reset, - unsigned priority, + const struct __DriverContextConfig * + ctx_config, unsigned *error, void *sharedContextPrivate); extern GLboolean r200MakeCurrent( __DRIcontext *driContextPriv, |