From 833f5bbfafee00ad44085e121eea0a2579eb3459 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 6 Nov 2009 18:34:23 +0000 Subject: [PATCH] i965g: First clear! --- src/gallium/drivers/i965/brw_screen_texture.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) 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 -- 2.30.2