diff options
Diffstat (limited to 'mesalib/src/mesa/drivers/dri/swrast')
-rw-r--r-- | mesalib/src/mesa/drivers/dri/swrast/swrast.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c index b31700d10..f8d749453 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c @@ -96,7 +96,7 @@ static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, else texFormat = MESA_FORMAT_ARGB8888; - _mesa_init_teximage_fields(&dri_ctx->Base, target, texImage, + _mesa_init_teximage_fields(&dri_ctx->Base, texImage, w, h, 1, 0, internalFormat, texFormat); sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)swImage->Data, @@ -707,7 +707,12 @@ InitExtensionsES2(struct gl_context *ctx) static GLboolean dri_create_context(gl_api api, const struct gl_config * visual, - __DRIcontext * cPriv, void *sharedContextPrivate) + __DRIcontext * cPriv, + unsigned major_version, + unsigned minor_version, + uint32_t flags, + unsigned *error, + void *sharedContextPrivate) { struct dri_context *ctx = NULL; struct dri_context *share = (struct dri_context *)sharedContextPrivate; @@ -717,9 +722,22 @@ dri_create_context(gl_api api, TRACE; + /* Flag filtering is handled in dri2CreateContextAttribs. + */ + (void) flags; + + if (api == API_OPENGL + && (major_version > 2 + || (major_version == 2 && minor_version > 1))) { + *error = __DRI_CTX_ERROR_BAD_VERSION; + goto context_fail; + } + ctx = CALLOC_STRUCT(dri_context); - if (ctx == NULL) + if (ctx == NULL) { + *error = __DRI_CTX_ERROR_NO_MEMORY; goto context_fail; + } cPriv->driverPrivate = ctx; ctx->cPriv = cPriv; @@ -736,6 +754,7 @@ dri_create_context(gl_api api, /* basic context setup */ if (!_mesa_initialize_context(mesaCtx, api, visual, sharedCtx, &functions, (void *) cPriv)) { + *error = __DRI_CTX_ERROR_NO_MEMORY; goto context_fail; } @@ -777,6 +796,7 @@ dri_create_context(gl_api api, break; } + *error = __DRI_CTX_ERROR_SUCCESS; return GL_TRUE; context_fail: |