[Mesa-dev] [PATCH 8/8] nv30: make sure that cbufs and zsbuf have the same depth

Ilia Mirkin imirkin at alum.mit.edu
Fri Oct 4 01:34:19 PDT 2013


This should finally fix RT_FORMAT errors due to weird fb configurations.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/gallium/drivers/nouveau/nv30/nv30_screen.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 1e9849d..009e71a 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -271,6 +271,24 @@ nv30_screen_is_format_supported(struct pipe_screen *pscreen,
    return (nv30_format_info(pscreen, format)->bindings & bindings) == bindings;
 }
 
+static boolean
+nv30_screen_is_fb_format_supported(
+      const struct pipe_screen *screen,
+      int num_color_formats,
+      const enum pipe_format *color_formats,
+      enum pipe_format zsformat)
+{
+   if (!util_format_same_cbuf_formats(
+             screen, num_color_formats, color_formats, zsformat))
+      return FALSE;
+
+   if (num_color_formats == 0 || zsformat == PIPE_FORMAT_NONE)
+      return TRUE;
+
+   return (util_format_get_blocksize(color_formats[0]) > 2) ==
+      (util_format_get_blocksize(zsformat) > 2);
+}
+
 static void
 nv30_screen_fence_emit(struct pipe_screen *pscreen, uint32_t *sequence)
 {
@@ -377,7 +395,7 @@ nv30_screen_create(struct nouveau_device *dev)
    pscreen->get_shader_param = nv30_screen_get_shader_param;
    pscreen->context_create = nv30_context_create;
    pscreen->is_format_supported = nv30_screen_is_format_supported;
-   pscreen->is_fb_format_supported = util_format_same_cbuf_formats;
+   pscreen->is_fb_format_supported = nv30_screen_is_fb_format_supported;
    nv30_resource_screen_init(pscreen);
    nouveau_screen_init_vdec(&screen->base);
 
-- 
1.8.1.5



More information about the mesa-dev mailing list