Mesa (master): graw: emit warnings when context/surface creation failes

Brian Paul brianp at kemper.freedesktop.org
Fri Sep 10 01:19:40 UTC 2010


Module: Mesa
Branch: master
Commit: 821e39001885a04618d8b054d9a531b119721730
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=821e39001885a04618d8b054d9a531b119721730

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Sep  9 18:52:10 2010 -0600

graw: emit warnings when context/surface creation failes

---

 src/gallium/tests/graw/tri.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/gallium/tests/graw/tri.c b/src/gallium/tests/graw/tri.c
index 8f68fc7..f7e3958 100644
--- a/src/gallium/tests/graw/tri.c
+++ b/src/gallium/tests/graw/tri.c
@@ -2,6 +2,8 @@
  * any utility code, just the graw interface and gallium.
  */
 
+#include <stdio.h>
+
 #include "state_tracker/graw.h"
 #include "pipe/p_screen.h"
 #include "pipe/p_context.h"
@@ -179,8 +181,10 @@ static void init( void )
    }
    
    ctx = screen->context_create(screen, NULL);
-   if (ctx == NULL)
+   if (ctx == NULL) {
+      fprintf(stderr, "Unable to create context!\n");
       exit(3);
+   }
 
    templat.target = PIPE_TEXTURE_2D;
    templat.format = formats[i];
@@ -194,14 +198,18 @@ static void init( void )
    
    tex = screen->resource_create(screen,
                                  &templat);
-   if (tex == NULL)
+   if (tex == NULL) {
+      fprintf(stderr, "Unable to create screen texture!\n");
       exit(4);
+   }
 
    surf = screen->get_tex_surface(screen, tex, 0, 0, 0,
                                   PIPE_BIND_RENDER_TARGET |
                                   PIPE_BIND_DISPLAY_TARGET);
-   if (surf == NULL)
+   if (surf == NULL) {
+      fprintf(stderr, "Unable to get tex surface!\n");
       exit(5);
+   }
 
    memset(&fb, 0, sizeof fb);
    fb.nr_cbufs = 1;




More information about the mesa-commit mailing list