i965: Replace fprintfs with assertions in GLenum comparison translators.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 29 Jun 2013 02:03:06 +0000 (19:03 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 3 Jul 2013 17:48:14 +0000 (10:48 -0700)
These functions translate GLenum comparison operations into the hardware
enumerations.  They should never be passed something other than a GL
comparison operator, or something is very broken.

Assertions seem more appropriate than fprintf.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/intel_state.c

index e4a63e5c6ad08b36b8bc2761d06fd54cfdddfadf..3bb0fc196d3f34944d9db7dc823e799c0fce2655 100644 (file)
@@ -59,7 +59,7 @@ intel_translate_shadow_compare_func(GLenum func)
        return BRW_COMPAREFUNCTION_NEVER;
    }
 
-   fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+   assert(!"Invalid shadow comparison function.");
    return BRW_COMPAREFUNCTION_NEVER;
 }
 
@@ -85,7 +85,7 @@ intel_translate_compare_func(GLenum func)
       return BRW_COMPAREFUNCTION_ALWAYS;
    }
 
-   fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+   assert(!"Invalid comparison function.");
    return BRW_COMPAREFUNCTION_ALWAYS;
 }