mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-11-27 17:40:43 +00:00
i965: Move compiler debug functions to intel_screen.c
They reference the compiler so they shouldn't go in libi965_compiler.la. Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
This commit is contained in:
parent
327161a48d
commit
870ff6cd38
@ -27,46 +27,6 @@
|
|||||||
#include "main/errors.h"
|
#include "main/errors.h"
|
||||||
#include "util/debug.h"
|
#include "util/debug.h"
|
||||||
|
|
||||||
static void
|
|
||||||
shader_debug_log_mesa(void *data, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
struct brw_context *brw = (struct brw_context *)data;
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
va_start(args, fmt);
|
|
||||||
GLuint msg_id = 0;
|
|
||||||
_mesa_gl_vdebug(&brw->ctx, &msg_id,
|
|
||||||
MESA_DEBUG_SOURCE_SHADER_COMPILER,
|
|
||||||
MESA_DEBUG_TYPE_OTHER,
|
|
||||||
MESA_DEBUG_SEVERITY_NOTIFICATION, fmt, args);
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
shader_perf_log_mesa(void *data, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
struct brw_context *brw = (struct brw_context *)data;
|
|
||||||
|
|
||||||
va_list args;
|
|
||||||
va_start(args, fmt);
|
|
||||||
|
|
||||||
if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
|
|
||||||
va_list args_copy;
|
|
||||||
va_copy(args_copy, args);
|
|
||||||
vfprintf(stderr, fmt, args_copy);
|
|
||||||
va_end(args_copy);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (brw->perf_debug) {
|
|
||||||
GLuint msg_id = 0;
|
|
||||||
_mesa_gl_vdebug(&brw->ctx, &msg_id,
|
|
||||||
MESA_DEBUG_SOURCE_SHADER_COMPILER,
|
|
||||||
MESA_DEBUG_TYPE_PERFORMANCE,
|
|
||||||
MESA_DEBUG_SEVERITY_MEDIUM, fmt, args);
|
|
||||||
}
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define COMMON_OPTIONS \
|
#define COMMON_OPTIONS \
|
||||||
.lower_sub = true, \
|
.lower_sub = true, \
|
||||||
.lower_fdiv = true, \
|
.lower_fdiv = true, \
|
||||||
@ -139,8 +99,6 @@ brw_compiler_create(void *mem_ctx, const struct brw_device_info *devinfo)
|
|||||||
struct brw_compiler *compiler = rzalloc(mem_ctx, struct brw_compiler);
|
struct brw_compiler *compiler = rzalloc(mem_ctx, struct brw_compiler);
|
||||||
|
|
||||||
compiler->devinfo = devinfo;
|
compiler->devinfo = devinfo;
|
||||||
compiler->shader_debug_log = shader_debug_log_mesa;
|
|
||||||
compiler->shader_perf_log = shader_perf_log_mesa;
|
|
||||||
|
|
||||||
brw_fs_alloc_reg_sets(compiler);
|
brw_fs_alloc_reg_sets(compiler);
|
||||||
brw_vec4_alloc_reg_set(compiler);
|
brw_vec4_alloc_reg_set(compiler);
|
||||||
|
@ -1467,6 +1467,46 @@ brw_get_revision(int fd)
|
|||||||
#define I915_PARAM_HAS_RESOURCE_STREAMER 36
|
#define I915_PARAM_HAS_RESOURCE_STREAMER 36
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
shader_debug_log_mesa(void *data, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
struct brw_context *brw = (struct brw_context *)data;
|
||||||
|
va_list args;
|
||||||
|
|
||||||
|
va_start(args, fmt);
|
||||||
|
GLuint msg_id = 0;
|
||||||
|
_mesa_gl_vdebug(&brw->ctx, &msg_id,
|
||||||
|
MESA_DEBUG_SOURCE_SHADER_COMPILER,
|
||||||
|
MESA_DEBUG_TYPE_OTHER,
|
||||||
|
MESA_DEBUG_SEVERITY_NOTIFICATION, fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
shader_perf_log_mesa(void *data, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
struct brw_context *brw = (struct brw_context *)data;
|
||||||
|
|
||||||
|
va_list args;
|
||||||
|
va_start(args, fmt);
|
||||||
|
|
||||||
|
if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
|
||||||
|
va_list args_copy;
|
||||||
|
va_copy(args_copy, args);
|
||||||
|
vfprintf(stderr, fmt, args_copy);
|
||||||
|
va_end(args_copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (brw->perf_debug) {
|
||||||
|
GLuint msg_id = 0;
|
||||||
|
_mesa_gl_vdebug(&brw->ctx, &msg_id,
|
||||||
|
MESA_DEBUG_SOURCE_SHADER_COMPILER,
|
||||||
|
MESA_DEBUG_TYPE_PERFORMANCE,
|
||||||
|
MESA_DEBUG_SEVERITY_MEDIUM, fmt, args);
|
||||||
|
}
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the driver specific part of the createNewScreen entry point.
|
* This is the driver specific part of the createNewScreen entry point.
|
||||||
* Called when using DRI2.
|
* Called when using DRI2.
|
||||||
@ -1579,6 +1619,8 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
|
|||||||
|
|
||||||
intelScreen->compiler = brw_compiler_create(intelScreen,
|
intelScreen->compiler = brw_compiler_create(intelScreen,
|
||||||
intelScreen->devinfo);
|
intelScreen->devinfo);
|
||||||
|
intelScreen->compiler->shader_debug_log = shader_debug_log_mesa;
|
||||||
|
intelScreen->compiler->shader_perf_log = shader_perf_log_mesa;
|
||||||
intelScreen->program_id = 1;
|
intelScreen->program_id = 1;
|
||||||
|
|
||||||
if (intelScreen->devinfo->has_resource_streamer) {
|
if (intelScreen->devinfo->has_resource_streamer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user