1 /**************************************************************************
3 * Copyright 2008 VMware, Inc.
4 * Copyright (c) 2008 VMware, Inc.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sub license, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 **************************************************************************/
30 #include "util/u_debug.h"
31 #include "u_debug_gallium.h"
33 #include "util/format/u_format.h"
38 debug_print_format(const char *msg
, unsigned fmt
)
40 debug_printf("%s: %s\n", msg
, util_format_name(fmt
));
45 * Print PIPE_TRANSFER_x flags with a message.
48 debug_print_transfer_flags(const char *msg
, unsigned usage
)
50 debug_printf("%s: ", msg
);
51 util_dump_transfer_usage(stdout
, usage
);
57 * Print PIPE_BIND_x flags with a message.
60 debug_print_bind_flags(const char *msg
, unsigned usage
)
62 static const struct debug_named_value names
[] = {
63 DEBUG_NAMED_VALUE(PIPE_BIND_DEPTH_STENCIL
),
64 DEBUG_NAMED_VALUE(PIPE_BIND_RENDER_TARGET
),
65 DEBUG_NAMED_VALUE(PIPE_BIND_BLENDABLE
),
66 DEBUG_NAMED_VALUE(PIPE_BIND_SAMPLER_VIEW
),
67 DEBUG_NAMED_VALUE(PIPE_BIND_VERTEX_BUFFER
),
68 DEBUG_NAMED_VALUE(PIPE_BIND_INDEX_BUFFER
),
69 DEBUG_NAMED_VALUE(PIPE_BIND_CONSTANT_BUFFER
),
70 DEBUG_NAMED_VALUE(PIPE_BIND_DISPLAY_TARGET
),
71 DEBUG_NAMED_VALUE(PIPE_BIND_STREAM_OUTPUT
),
72 DEBUG_NAMED_VALUE(PIPE_BIND_CURSOR
),
73 DEBUG_NAMED_VALUE(PIPE_BIND_CUSTOM
),
74 DEBUG_NAMED_VALUE(PIPE_BIND_GLOBAL
),
75 DEBUG_NAMED_VALUE(PIPE_BIND_SHADER_BUFFER
),
76 DEBUG_NAMED_VALUE(PIPE_BIND_SHADER_IMAGE
),
77 DEBUG_NAMED_VALUE(PIPE_BIND_COMPUTE_RESOURCE
),
78 DEBUG_NAMED_VALUE(PIPE_BIND_COMMAND_ARGS_BUFFER
),
79 DEBUG_NAMED_VALUE(PIPE_BIND_SCANOUT
),
80 DEBUG_NAMED_VALUE(PIPE_BIND_SHARED
),
81 DEBUG_NAMED_VALUE(PIPE_BIND_LINEAR
),
85 debug_printf("%s: %s\n", msg
, debug_dump_flags(names
, usage
));
90 * Print PIPE_USAGE_x enum values with a message.
93 debug_print_usage_enum(const char *msg
, enum pipe_resource_usage usage
)
95 static const struct debug_named_value names
[] = {
96 DEBUG_NAMED_VALUE(PIPE_USAGE_DEFAULT
),
97 DEBUG_NAMED_VALUE(PIPE_USAGE_IMMUTABLE
),
98 DEBUG_NAMED_VALUE(PIPE_USAGE_DYNAMIC
),
99 DEBUG_NAMED_VALUE(PIPE_USAGE_STREAM
),
100 DEBUG_NAMED_VALUE(PIPE_USAGE_STAGING
),
101 DEBUG_NAMED_VALUE_END
104 debug_printf("%s: %s\n", msg
, debug_dump_enum(names
, usage
));