Mesa (master): dri/nouveau: add AllocTextureImageBuffer implementation

Francisco Jerez currojerez at kemper.freedesktop.org
Sun Oct 6 20:27:27 UTC 2013


Module: Mesa
Branch: master
Commit: 7178d6ac590211cf123254688da1a540cce6c0a9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7178d6ac590211cf123254688da1a540cce6c0a9

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Fri Oct  4 04:28:58 2013 -0400

dri/nouveau: add AllocTextureImageBuffer implementation

This fixes issues where get_rt_format would see a 0 format because the
nouveau_surface had not been properly initialized. Fixes crash on
supertuxkart startup (which still fails due to out-of-vram issues).

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Signed-off-by: Francisco Jerez <currojerez at riseup.net>

---

 src/mesa/drivers/dri/nouveau/nouveau_texture.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index da74e8f..8904389 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -494,6 +494,14 @@ nouveau_compressed_teximage(struct gl_context *ctx, GLuint dims,
 			 &ctx->Unpack, GL_TRUE);
 }
 
+static GLboolean
+nouveau_teximage_alloc(struct gl_context *ctx, struct gl_texture_image *ti)
+{
+	nouveau_teximage(ctx, 3, ti, 0, 0, 0, NULL,
+			 &ctx->DefaultPacking, GL_FALSE);
+	return GL_TRUE;
+}
+
 static void
 nouveau_texsubimage(struct gl_context *ctx, GLint dims,
 		    struct gl_texture_image *ti,
@@ -634,6 +642,7 @@ nouveau_texture_functions_init(struct dd_function_table *functions)
 	functions->DeleteTexture = nouveau_texture_free;
 	functions->NewTextureImage = nouveau_teximage_new;
 	functions->FreeTextureImageBuffer = nouveau_teximage_free;
+	functions->AllocTextureImageBuffer = nouveau_teximage_alloc;
 	functions->ChooseTextureFormat = nouveau_choose_tex_format;
 	functions->TexImage = nouveau_teximage_123d;
 	functions->TexSubImage = nouveau_texsubimage_123d;




More information about the mesa-commit mailing list