i915: Added debug filling code of texture, not active
authorJakob Bornecrantz <jakob@tungstengraphics.com>
Fri, 4 Jul 2008 17:23:52 +0000 (19:23 +0200)
committerJakob Bornecrantz <jakob@tungstengraphics.com>
Fri, 4 Jul 2008 17:33:40 +0000 (19:33 +0200)
src/gallium/drivers/i915simple/i915_texture.c

index 5d6769924c326e819a878bd99de58b7e10beee92..cf4964b26b39aa751bc5e8f81daf15bc3a71fa22 100644 (file)
@@ -581,6 +581,7 @@ i915_texture_create(struct pipe_screen *screen,
    struct i915_screen *i915screen = i915_screen(screen);
    struct pipe_winsys *ws = screen->winsys;
    struct i915_texture *tex = CALLOC_STRUCT(i915_texture);
+   size_t tex_size;
 
    if (!tex)
       return NULL;
@@ -600,14 +601,22 @@ i915_texture_create(struct pipe_screen *screen,
         goto fail;
    }
 
+   tex_size = tex->stride * tex->total_nblocksy;
+
    tex->buffer = ws->buffer_create(ws, 64,
                                   PIPE_BUFFER_USAGE_PIXEL,
-                                  tex->stride *
-                                  tex->total_nblocksy);
+                                  tex_size);
 
    if (!tex->buffer)
       goto fail;
 
+#if 0
+   void *ptr = ws->buffer_map(ws, tex->buffer,
+      PIPE_BUFFER_USAGE_CPU_WRITE);
+   memset(ptr, 0x80, tex_size);
+   ws->buffer_unmap(ws, tex->buffer);
+#endif
+
    return &tex->base;
 
 fail: