i965g: First clear!
authorJakob Bornecrantz <jakob@vmware.com>
Fri, 6 Nov 2009 18:34:23 +0000 (18:34 +0000)
committerJakob Bornecrantz <jakob@vmware.com>
Fri, 6 Nov 2009 18:34:23 +0000 (18:34 +0000)
src/gallium/drivers/i965/brw_screen_texture.c

index adc0aaa8a987d3a2a57b6207fa9357fc9c77f475..842c70a39ad655393c96e837a29d0f12e90adeec 100644 (file)
@@ -384,8 +384,6 @@ brw_texture_blanket_winsys_buffer(struct pipe_screen *screen,
 {
    struct brw_screen *bscreen = brw_screen(screen);
    struct brw_texture *tex;
-   enum brw_buffer_type buffer_type;
-   enum pipe_error ret;
 
    if (templ->target != PIPE_TEXTURE_2D ||
        templ->last_level != 0 ||
@@ -419,17 +417,13 @@ brw_texture_blanket_winsys_buffer(struct pipe_screen *screen,
    if (!brw_texture_layout(bscreen, tex))
       goto fail;
 
-   
-   if (templ->tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
-                           PIPE_TEXTURE_USAGE_PRIMARY)) {
-      buffer_type = BRW_BUFFER_TYPE_SCANOUT;
-   } else {
-      buffer_type = BRW_BUFFER_TYPE_TEXTURE;
-   }
+   /* XXX Maybe some more checks? */
+   if ((pitch / tex->cpp) < tex->pitch)
+      goto fail;
 
-   tex->bo = buffer;
+   tex->pitch = pitch / tex->cpp;
 
-   tex->pitch = pitch;
+   tex->bo = buffer;
 
    /* fix this warning */
 #if 0