}
out_value[0] = ((bits >> 4) & 0xf) / 16.0f;
out_value[1] = (bits & 0xf) / 16.0f;
- debug_printf("VIRGL: sample postion [%2d/%2d] = (%f, %f)\n",
- index, sample_count, out_value[0], out_value[1]);
+
+ if (virgl_debug & VIRGL_DEBUG_VERBOSE)
+ debug_printf("VIRGL: sample postion [%2d/%2d] = (%f, %f)\n",
+ index, sample_count, out_value[0], out_value[1]);
}
struct pipe_context *virgl_context_create(struct pipe_screen *pscreen,
bret = tgsi_dump_str(tokens, TGSI_DUMP_FLOAT_AS_HEX, str, str_total_size);
if (bret == false) {
- debug_printf("Failed to translate shader in available space - trying again\n");
+ if (virgl_debug & VIRGL_DEBUG_VERBOSE)
+ debug_printf("Failed to translate shader in available space - trying again\n");
old_size = str_total_size;
str_total_size = 65536 * ++retry_size;
str = REALLOC(str, old_size, str_total_size);
#include "virgl_public.h"
#include "virgl_context.h"
+int virgl_debug = 0;
+static const struct debug_named_value debug_options[] = {
+ { "verbose", VIRGL_DEBUG_VERBOSE, NULL },
+ DEBUG_NAMED_VALUE_END
+};
+DEBUG_GET_ONCE_FLAGS_OPTION(virgl_debug, "VIRGL_DEBUG", debug_options, 0)
+
static const char *
virgl_get_vendor(struct pipe_screen *screen)
{
if (!screen)
return NULL;
+ virgl_debug = debug_get_option_virgl_debug();
+
screen->vws = vws;
screen->base.get_name = virgl_get_name;
screen->base.get_vendor = virgl_get_vendor;
#include "util/slab.h"
#include "virgl_winsys.h"
+#define VIRGL_DEBUG_VERBOSE 1
+extern int virgl_debug;
+
struct virgl_screen {
struct pipe_screen base;