vrend: move virgl_has_gl_colorspace to winsys

Move and rename it to vrend_winsys_has_gl_colorspace.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Chia-I Wu 4 years ago
parent baea5a2cf1
commit 0f5e6ebf85
  1. 14
      src/vrend_renderer.c
  2. 2
      src/vrend_renderer.h
  3. 12
      src/vrend_winsys.c
  4. 2
      src/vrend_winsys.h

@ -5996,7 +5996,7 @@ int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)
init_features(gles ? 0 : gl_ver,
gles ? gl_ver : 0);
vrend_state.features[feat_srgb_write_control] &= virgl_has_gl_colorspace();
vrend_state.features[feat_srgb_write_control] &= vrend_winsys_has_gl_colorspace();
glGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint *) &vrend_state.max_draw_buffers);
@ -10412,18 +10412,6 @@ void vrend_print_context_name(const struct vrend_context *ctx)
vrend_printf("HOST: ");
}
int virgl_has_gl_colorspace(void)
{
bool egl_colorspace = false;
#ifdef HAVE_EPOXY_EGL_H
if (egl)
egl_colorspace = virgl_has_egl_khr_gl_colorspace(egl);
#endif
return use_context == CONTEXT_NONE ||
use_context == CONTEXT_GLX ||
(use_context == CONTEXT_EGL && egl_colorspace);
}
void vrend_renderer_destroy_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
{

@ -468,8 +468,6 @@ unsigned vrend_context_has_debug_flag(const struct vrend_context *ctx,
unsigned vrend_renderer_query_multisample_caps(unsigned max_samples,
struct virgl_caps_v2 *caps);
int virgl_has_gl_colorspace(void);
struct gl_version {
uint32_t major;
uint32_t minor;

@ -36,3 +36,15 @@ struct virgl_gbm *gbm = NULL;
#ifdef HAVE_EPOXY_GLX_H
struct virgl_glx *glx_info = NULL;
#endif
int vrend_winsys_has_gl_colorspace(void)
{
bool egl_colorspace = false;
#ifdef HAVE_EPOXY_EGL_H
if (egl)
egl_colorspace = virgl_has_egl_khr_gl_colorspace(egl);
#endif
return use_context == CONTEXT_NONE ||
use_context == CONTEXT_GLX ||
(use_context == CONTEXT_EGL && egl_colorspace);
}

@ -53,4 +53,6 @@ extern struct virgl_gbm *gbm;
extern struct virgl_glx *glx_info;
#endif
int vrend_winsys_has_gl_colorspace(void);
#endif /* VREND_WINSYS_H */

Loading…
Cancel
Save