vrend: Improved KHR_debug usage

Make sure we add debug printing to the sub-context
and disable printing when getting the format list.

Signed-off-by: Jakob Bornecrantz <jakob.bornecrantz@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Jakob Bornecrantz 7 years ago committed by Dave Airlie
parent ba65735fb6
commit b37ab49b52
  1. 19
      src/vrend_renderer.c

@ -100,6 +100,7 @@ struct global_renderer_state {
bool inited; bool inited;
bool use_core_profile; bool use_core_profile;
bool have_debug_cb;
bool have_mesa_invert; bool have_mesa_invert;
bool have_samplers; bool have_samplers;
bool have_robustness; bool have_robustness;
@ -3852,6 +3853,7 @@ int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)
glDebugMessageCallback(vrend_debug_cb, NULL); glDebugMessageCallback(vrend_debug_cb, NULL);
glEnable(GL_DEBUG_OUTPUT); glEnable(GL_DEBUG_OUTPUT);
glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS); glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
vrend_state.have_debug_cb = true;
} }
vrend_state.gl_major_ver = gl_ver / 10; vrend_state.gl_major_ver = gl_ver / 10;
@ -3901,8 +3903,18 @@ int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)
vrend_object_set_destroy_callback(VIRGL_OBJECT_SAMPLER_STATE, vrend_destroy_sampler_state_object); vrend_object_set_destroy_callback(VIRGL_OBJECT_SAMPLER_STATE, vrend_destroy_sampler_state_object);
vrend_object_set_destroy_callback(VIRGL_OBJECT_VERTEX_ELEMENTS, vrend_destroy_vertex_elements_object); vrend_object_set_destroy_callback(VIRGL_OBJECT_VERTEX_ELEMENTS, vrend_destroy_vertex_elements_object);
/* disable for format testing, spews a lot of errors */
if (vrend_state.have_debug_cb) {
glDisable(GL_DEBUG_OUTPUT);
}
vrend_build_format_list(); vrend_build_format_list();
/* disable for format testing */
if (vrend_state.have_debug_cb) {
glDisable(GL_DEBUG_OUTPUT);
}
vrend_clicbs->destroy_gl_context(gl_context); vrend_clicbs->destroy_gl_context(gl_context);
list_inithead(&vrend_state.fence_list); list_inithead(&vrend_state.fence_list);
list_inithead(&vrend_state.fence_wait_list); list_inithead(&vrend_state.fence_wait_list);
@ -6449,6 +6461,13 @@ void vrend_renderer_create_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
sub->gl_context = vrend_clicbs->create_gl_context(0, &ctx_params); sub->gl_context = vrend_clicbs->create_gl_context(0, &ctx_params);
vrend_clicbs->make_current(0, sub->gl_context); vrend_clicbs->make_current(0, sub->gl_context);
/* enable if vrend_renderer_init function has done it as well */
if (vrend_state.have_debug_cb) {
glDebugMessageCallback(vrend_debug_cb, NULL);
glEnable(GL_DEBUG_OUTPUT);
glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
}
sub->sub_ctx_id = sub_ctx_id; sub->sub_ctx_id = sub_ctx_id;
if (!vrend_state.have_vertex_attrib_binding) { if (!vrend_state.have_vertex_attrib_binding) {

Loading…
Cancel
Save