*
**********************************************************/
+#include "git_sha1.h" /* For MESA_GIT_SHA1 */
#include "util/u_format.h"
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "util/u_string.h"
#include "util/u_math.h"
+#include "os/os_process.h"
+
#include "svga_winsys.h"
#include "svga_public.h"
#include "svga_context.h"
#include "svga_format.h"
+#include "svga_msg.h"
#include "svga_screen.h"
#include "svga_tgsi.h"
#include "svga_resource_texture.h"
/* NOTE: this constant may get moved into a svga3d*.h header file */
#define SVGA3D_DX_MAX_RESOURCE_SIZE (128 * 1024 * 1024)
+#ifndef MESA_GIT_SHA1
+#define MESA_GIT_SHA1 "(unknown git revision)"
+#endif
+
#ifdef DEBUG
int SVGA_DEBUG = 0;
{ "cache", DEBUG_CACHE, NULL },
{ "streamout", DEBUG_STREAMOUT, NULL },
{ "query", DEBUG_QUERY, NULL },
+ { "samplers", DEBUG_SAMPLERS, NULL },
DEBUG_NAMED_VALUE_END
};
#endif
case PIPE_CAP_INT64_DIVMOD:
case PIPE_CAP_TGSI_TEX_TXF_LZ:
case PIPE_CAP_TGSI_CLOCK:
+ case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
+ case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
+ case PIPE_CAP_TGSI_BALLOT:
+ case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+ case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
+ case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
+ case PIPE_CAP_POST_DEPTH_COVERAGE:
return 0;
}
case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
case PIPE_SHADER_CAP_LOWER_IF_THRESHOLD:
+ case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
return 0;
case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
return 32;
case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
case PIPE_SHADER_CAP_LOWER_IF_THRESHOLD:
+ case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
return 0;
case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
return 32;
case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
case PIPE_SHADER_CAP_LOWER_IF_THRESHOLD:
+ case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
return 0;
case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
return 32;
}
+static void
+init_logging(struct pipe_screen *screen)
+{
+ static const char *log_prefix = "Mesa: ";
+ char host_log[1000];
+
+ /* Log Version to Host */
+ util_snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
+ "%s%s", log_prefix, svga_get_name(screen));
+ svga_host_log(host_log);
+
+ util_snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
+ "%s%s (%s)", log_prefix, PACKAGE_VERSION, MESA_GIT_SHA1);
+ svga_host_log(host_log);
+
+ /* If the SVGA_EXTRA_LOGGING env var is set, log the process's command
+ * line (program name and arguments).
+ */
+ if (debug_get_bool_option("SVGA_EXTRA_LOGGING", FALSE)) {
+ char cmdline[1000];
+ if (os_get_command_line(cmdline, sizeof(cmdline))) {
+ util_snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
+ "%s%s", log_prefix, cmdline);
+ svga_host_log(host_log);
+ }
+ }
+}
+
+
static void
svga_destroy_screen( struct pipe_screen *screen )
{
svgascreen->hw_version = SVGA3D_HWVERSION_WS65_B1;
}
+ if (svgascreen->hw_version < SVGA3D_HWVERSION_WS8_B1) {
+ /* too old for 3D acceleration */
+ debug_printf("Hardware version 0x%x is too old for accerated 3D\n",
+ svgascreen->hw_version);
+ goto error2;
+ }
+
/*
* The D16, D24X8, and D24S8 formats always do an implicit shadow compare
* when sampled from, where as the DF16, DF24, and D24S8_INT do not. So
}
(void) mtx_init(&svgascreen->tex_mutex, mtx_plain);
- (void) mtx_init(&svgascreen->swc_mutex, mtx_plain);
+ (void) mtx_init(&svgascreen->swc_mutex, mtx_recursive);
svga_screen_cache_init(svgascreen);
+ init_logging(screen);
+
return screen;
error2:
FREE(svgascreen);