3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/mesa/swrast-settexbuffer.patch
Eelco Dolstra cf6bc1aeae * Apply a patch to prevent the X server from segfaulting if kwin is
run with swrast_dri (e.g. with the VGA driver).  (NixOS/121)

svn path=/nixpkgs/branches/x-updates/; revision=26201
2011-03-07 21:16:34 +00:00

25 lines
1.2 KiB
Diff

https://build.opensuse.org/package/view_file?file=0001-Fix-crash-in-swrast-when-setting-a-texture-for-a-pix.patch&package=Mesa&project=openSUSE%3AFactory&srcmd5=be25d34ad69853c2bb21ed376061d573
diff -ru Mesa-7.10.1-orig//src/mesa/drivers/dri/swrast/swrast.c Mesa-7.10.1//src/mesa/drivers/dri/swrast/swrast.c
--- Mesa-7.10.1-orig//src/mesa/drivers/dri/swrast/swrast.c 2010-12-14 22:43:15.000000000 +0100
+++ Mesa-7.10.1//src/mesa/drivers/dri/swrast/swrast.c 2011-03-07 18:08:17.062816112 +0100
@@ -61,6 +61,7 @@
static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
GLint texture_format, __DRIdrawable *dPriv)
{
+ GET_CURRENT_CONTEXT(ctx);
struct dri_context *dri_ctx;
int x, y, w, h;
__DRIscreen *sPriv = dPriv->driScreenPriv;
@@ -90,6 +91,10 @@
_mesa_init_teximage_fields(&dri_ctx->Base, target, texImage,
w, h, 1, 0, internalFormat, texFormat);
+ ctx->Driver.TexImage2D(ctx, target, 0, internalFormat,
+ w, h, 0, texture_format, GL_UNSIGNED_INT_8_8_8_8,
+ NULL, &ctx->Unpack, texObj, texImage);
+
sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)texImage->Data,
dPriv->loaderPrivate);