vrend_debug: Remove hard coded vrend_use_debug_cb

This was hard coded as zero before and can't be changed at runtime.
Change to use the "VREND_DEBUG" environment variable to control this
behavior.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Lepton Wu 5 years ago
parent 845bc4889b
commit 4dd3e61a99
  1. 1
      src/vrend_debug.c
  2. 1
      src/vrend_debug.h
  3. 5
      src/vrend_renderer.c

@ -123,6 +123,7 @@ static const struct debug_named_value vrend_debug_options[] = {
{"gles", dbg_gles, "GLES host specific debug"},
{"all", dbg_all, "Enable all debugging output"},
{"guestallow", dbg_allow_guest_override, "Allow the guest to override the debug flags"},
{"khr", dbg_khr, "Enable debug via KHR_debug extension"},
DEBUG_NAMED_VALUE_END
};

@ -49,6 +49,7 @@ enum virgl_debug_flags {
dbg_all = (1 << 13) - 1,
dbg_allow_guest_override = 1 << 16,
dbg_feature_use = 1 << 17,
dbg_khr = 1 << 18,
};
const char *vrend_get_comand_name(enum virgl_context_cmd cmd);

@ -67,9 +67,6 @@ extern struct virgl_gbm *gbm;
extern struct virgl_egl *egl;
#endif
/* debugging via KHR_debug extension */
int vrend_use_debug_cb = 0;
int use_context = CONTEXT_NONE;
static const uint32_t fake_occlusion_query_samples_passed_default = 1024;
@ -5759,7 +5756,7 @@ int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)
gl_ver = epoxy_gl_version();
/* enable error output as early as possible */
if (vrend_use_debug_cb && epoxy_has_gl_extension("GL_KHR_debug")) {
if (vrend_debug(NULL, dbg_khr) && epoxy_has_gl_extension("GL_KHR_debug")) {
glDebugMessageCallback(vrend_debug_cb, NULL);
glEnable(GL_DEBUG_OUTPUT);
glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS);

Loading…
Cancel
Save