aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2014-07-18 12:25:29 -0400
committerTom Stellard <[email protected]>2014-07-21 10:00:09 -0400
commit245e86168a758e35a78077f90cbb4a8cfca0909f (patch)
treef63dd4e09b63927b2725f10e8231fdef315ce44b
parent9ba3105e0a4b186d6b1ee4c23886a3c4cd0a3543 (diff)
radeonsi/compute: Share COMPUTE_DBG macro with r600g
Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/gallium/drivers/r600/evergreen_compute.h13
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.h5
-rw-r--r--src/gallium/drivers/radeonsi/si_compute.c5
3 files changed, 10 insertions, 13 deletions
diff --git a/src/gallium/drivers/r600/evergreen_compute.h b/src/gallium/drivers/r600/evergreen_compute.h
index e760790e632..4fb53a1cb90 100644
--- a/src/gallium/drivers/r600/evergreen_compute.h
+++ b/src/gallium/drivers/r600/evergreen_compute.h
@@ -59,17 +59,4 @@ void r600_compute_global_transfer_flush_region( struct pipe_context *, struct pi
void r600_compute_global_transfer_inline_write( struct pipe_context *, struct pipe_resource *, unsigned level,
unsigned usage, const struct pipe_box *, const void *data, unsigned stride, unsigned layer_stride);
-
-static inline void COMPUTE_DBG(struct r600_screen *rscreen, const char *fmt, ...)
-{
- if (!(rscreen->b.debug_flags & DBG_COMPUTE)) {
- return;
- }
-
- va_list ap;
- va_start(ap, fmt);
- _debug_vprintf(fmt, ap);
- va_end(ap);
-}
-
#endif
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index 8f1a0a5944c..cee96222557 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -515,6 +515,11 @@ static inline unsigned r600_tex_aniso_filter(unsigned filter)
/* else */ return 4;
}
+#define COMPUTE_DBG(rscreen, fmt, args...) \
+ do { \
+ if ((rscreen->b.debug_flags & DBG_COMPUTE)) fprintf(stderr, fmt, ##args); \
+ } while (0);
+
#define R600_ERR(fmt, args...) \
fprintf(stderr, "EE %s:%d %s - "fmt, __FILE__, __LINE__, __func__, ##args)
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index c0637f6f7ec..3a9f00fd41d 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -163,6 +163,11 @@ static void si_launch_grid(
memcpy(kernel_args + (num_work_size_bytes / 4), input, program->input_size);
+ for (i = 0; i < (kernel_args_size / 4); i++) {
+ COMPUTE_DBG(sctx->screen, "input %u : %u\n", i,
+ kernel_args[i]);
+ }
+
si_upload_const_buffer(sctx, &kernel_args_buffer, (uint8_t*)kernel_args,
kernel_args_size, &kernel_args_offset);
kernel_args_va = r600_resource_va(ctx->screen,