Mesa (i965g-restart): i965g: Fix texture blanket function
Jakob Bornecrantz
wallbraker at kemper.freedesktop.org
Fri Nov 6 17:03:43 UTC 2009
Module: Mesa
Branch: i965g-restart
Commit: 2eb6b0defe65b01a7ed1562c2f16c17125242c16
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2eb6b0defe65b01a7ed1562c2f16c17125242c16
Author: Jakob Bornecrantz <jakob at vmware.com>
Date: Fri Nov 6 16:40:54 2009 +0000
i965g: Fix texture blanket function
---
src/gallium/drivers/i965/brw_screen_texture.c | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c
index 911f482..adc0aaa 100644
--- a/src/gallium/drivers/i965/brw_screen_texture.c
+++ b/src/gallium/drivers/i965/brw_screen_texture.c
@@ -387,12 +387,14 @@ brw_texture_blanket_winsys_buffer(struct pipe_screen *screen,
enum brw_buffer_type buffer_type;
enum pipe_error ret;
- if (pf_is_compressed(templ->format))
+ if (templ->target != PIPE_TEXTURE_2D ||
+ templ->last_level != 0 ||
+ templ->depth[0] != 1)
return NULL;
- if (pf_is_depth_or_stencil(templ->format))
+ if (pf_is_compressed(templ->format))
return NULL;
-
+
tex = CALLOC_STRUCT(brw_texture);
if (!tex)
return NULL;
@@ -408,6 +410,9 @@ brw_texture_blanket_winsys_buffer(struct pipe_screen *screen,
if (1)
tex->tiling = BRW_TILING_NONE;
+ else if (bscreen->chipset.is_965 &&
+ pf_is_depth_or_stencil(templ->format))
+ tex->tiling = BRW_TILING_Y;
else
tex->tiling = BRW_TILING_X;
@@ -424,17 +429,13 @@ brw_texture_blanket_winsys_buffer(struct pipe_screen *screen,
tex->bo = buffer;
- if (tex->pitch != pitch)
- goto fail;
-
+ tex->pitch = pitch;
-/* fix this warning
+ /* fix this warning */
+#if 0
if (tex->size > buffer->size)
goto fail;
- */
-
- if (ret)
- goto fail;
+#endif
tex->ss.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW;
tex->ss.ss0.surface_type = translate_tex_target(tex->base.target);
More information about the mesa-commit
mailing list