screen->pfnSwrGetInterface = SwrGetInterface;
screen->pfnSwrGetInterface = SwrGetTileInterface;
InitTilesTable();
- fprintf(stderr, "(using: builtin).\n");
+ swr_print_info("(using: builtin).\n");
#else
char filename[256] = { 0 };
sprintf(filename, "%sswr%s%s", UTIL_DL_PREFIX, arch, UTIL_DL_EXT);
pInitFunc();
- fprintf(stderr, "(using: %s).\n", filename);
+ swr_print_info("(using: %s).\n", filename);
#endif
+
return true;
}
util_cpu_detect();
if (util_cpu_caps.has_avx512f && util_cpu_caps.has_avx512er) {
- fprintf(stderr, "SWR detected KNL instruction support ");
+ swr_print_info("SWR detected KNL instruction support ");
#ifndef HAVE_SWR_KNL
- fprintf(stderr, "(skipping: not built).\n");
+ swr_print_info("(skipping: not built).\n");
#else
if (swr_initialize_screen_interface(screen, "KNL")) {
screen->is_knl = true;
}
if (util_cpu_caps.has_avx512f && util_cpu_caps.has_avx512bw) {
- fprintf(stderr, "SWR detected SKX instruction support ");
+ swr_print_info("SWR detected SKX instruction support ");
#ifndef HAVE_SWR_SKX
- fprintf(stderr, "(skipping not built).\n");
+ swr_print_info("(skipping not built).\n");
#else
if (swr_initialize_screen_interface(screen, "SKX"))
return p_screen;
}
if (util_cpu_caps.has_avx2) {
- fprintf(stderr, "SWR detected AVX2 instruction support ");
+ swr_print_info("SWR detected AVX2 instruction support ");
#ifndef HAVE_SWR_AVX2
- fprintf(stderr, "(skipping not built).\n");
+ swr_print_info("(skipping not built).\n");
#else
if (swr_initialize_screen_interface(screen, "AVX2"))
return p_screen;
}
if (util_cpu_caps.has_avx) {
- fprintf(stderr, "SWR detected AVX instruction support ");
+ swr_print_info("SWR detected AVX instruction support ");
#ifndef HAVE_SWR_AVX
- fprintf(stderr, "(skipping not built).\n");
+ swr_print_info("(skipping not built).\n");
#else
if (swr_initialize_screen_interface(screen, "AVX"))
return p_screen;
* surface sample count. */
if (screen->msaa_force_enable) {
res->swr.numSamples = screen->msaa_max_count;
- fprintf(stderr,"swr_texture_layout: forcing sample count: %d\n",
+ swr_print_info("swr_texture_layout: forcing sample count: %d\n",
res->swr.numSamples);
}
} else {
struct swr_screen *screen = swr_screen(p_screen);
struct sw_winsys *winsys = screen->winsys;
- fprintf(stderr, "SWR destroy screen!\n");
+ swr_print_info("SWR destroy screen!\n");
if (winsys->destroy)
winsys->destroy(winsys);
fprintf(stderr, "must be power of 2 between 1 and %d" \
" (or 1 to disable msaa)\n",
SWR_MAX_NUM_MULTISAMPLES);
+ fprintf(stderr, "(msaa disabled)\n");
msaa_max_count = 1;
}
- fprintf(stderr, "SWR_MSAA_MAX_COUNT: %d\n", msaa_max_count);
- if (msaa_max_count == 1)
- fprintf(stderr, "(msaa disabled)\n");
+ swr_print_info("SWR_MSAA_MAX_COUNT: %d\n", msaa_max_count);
screen->msaa_max_count = msaa_max_count;
}
screen->msaa_force_enable = debug_get_bool_option(
"SWR_MSAA_FORCE_ENABLE", false);
if (screen->msaa_force_enable)
- fprintf(stderr, "SWR_MSAA_FORCE_ENABLE: true\n");
+ swr_print_info("SWR_MSAA_FORCE_ENABLE: true\n");
}
#include "memory/TilingFunctions.h"
#include "memory/InitMemory.h"
+#include <stdio.h>
+#include <stdarg.h>
struct sw_winsys;
SWR_FORMAT
mesa_to_swr_format(enum pipe_format format);
+static void swr_print_info(const char *format, ...)
+{
+ static bool print_info = debug_get_bool_option("SWR_PRINT_INFO", false);
+ if(print_info) {
+ va_list args;
+ va_start(args, format);
+ vfprintf(stderr, format, args);
+ va_end(args);
+ }
+}
+
#endif