diff options
author | Keith Whitwell <[email protected]> | 2009-12-22 09:40:39 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-12-22 09:40:39 +0000 |
commit | aa02683e45f1eaf61bba2ba7eeda7686efeed2ca (patch) | |
tree | 63e0ef2fa85e5d7ebd6ffc6ae9043ce0819251a2 /src/gallium/auxiliary/util | |
parent | ebbc73d1aed283c9bc4aa2b37bed4374bbaec5b5 (diff) | |
parent | 0fc4dd3819af252c028ed43bbd668b4f34104e32 (diff) |
Merge branch 'i965g-restart'
Conflicts:
configure.ac
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_debug.c | 27 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_math.h | 13 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_prim.h | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_upload_mgr.h | 2 |
4 files changed, 44 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 27e0b0d1595..4e01123fff1 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -70,6 +70,7 @@ #include "util/u_stream.h" #include "util/u_math.h" #include "util/u_tile.h" +#include "util/u_prim.h" #ifdef PIPE_SUBSYSTEM_WINDOWS_DISPLAY @@ -601,6 +602,32 @@ const char *pf_name( enum pipe_format format ) } + +static const struct debug_named_value pipe_prim_names[] = { +#ifdef DEBUG + DEBUG_NAMED_VALUE(PIPE_PRIM_POINTS), + DEBUG_NAMED_VALUE(PIPE_PRIM_LINES), + DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_LOOP), + DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP), + DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES), + DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP), + DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_FAN), + DEBUG_NAMED_VALUE(PIPE_PRIM_QUADS), + DEBUG_NAMED_VALUE(PIPE_PRIM_QUAD_STRIP), + DEBUG_NAMED_VALUE(PIPE_PRIM_POLYGON), +#endif + DEBUG_NAMED_VALUE_END +}; + + +const char *u_prim_name( unsigned prim ) +{ + return debug_dump_enum(pipe_prim_names, prim); +} + + + + #ifdef DEBUG void debug_dump_image(const char *prefix, unsigned format, unsigned cpp, diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index b76592d1ec6..81aeb83cbb5 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -583,6 +583,19 @@ do { \ #endif +static INLINE uint32_t util_unsigned_fixed(float value, unsigned frac_bits) +{ + value *= (1<<frac_bits); + return value < 0 ? 0 : value; +} + +static INLINE int32_t util_signed_fixed(float value, unsigned frac_bits) +{ + return value * (1<<frac_bits); +} + + + #ifdef __cplusplus } #endif diff --git a/src/gallium/auxiliary/util/u_prim.h b/src/gallium/auxiliary/util/u_prim.h index a9b533eea70..74343299623 100644 --- a/src/gallium/auxiliary/util/u_prim.h +++ b/src/gallium/auxiliary/util/u_prim.h @@ -135,4 +135,6 @@ static INLINE unsigned u_reduced_prim( unsigned pipe_prim ) } } +const char *u_prim_name( unsigned pipe_prim ); + #endif diff --git a/src/gallium/auxiliary/util/u_upload_mgr.h b/src/gallium/auxiliary/util/u_upload_mgr.h index 745b5834af6..e158bed9d04 100644 --- a/src/gallium/auxiliary/util/u_upload_mgr.h +++ b/src/gallium/auxiliary/util/u_upload_mgr.h @@ -32,6 +32,8 @@ #ifndef U_UPLOAD_MGR_H #define U_UPLOAD_MGR_H +#include "pipe/p_defines.h" + struct pipe_screen; struct pipe_buffer; struct u_upload_mgr; |