From: Jakob Bornecrantz Date: Fri, 6 Nov 2009 18:34:23 +0000 (+0000) Subject: i965g: First clear! X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=833f5bbfafee00ad44085e121eea0a2579eb3459;p=mesa.git i965g: First clear! --- diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c index adc0aaa8a98..842c70a39ad 100644 --- a/src/gallium/drivers/i965/brw_screen_texture.c +++ b/src/gallium/drivers/i965/brw_screen_texture.c @@ -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