From 448d2d333c5f04bbf4710a0c23a0d3adfc2954b0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 14 Oct 2018 08:22:26 +0200 Subject: [PATCH] Set ctx_driver --- gfx/common/gdi_common.h | 1 + gfx/common/gl_common.h | 1 + gfx/common/sixel_common.h | 1 + gfx/common/vulkan_common.h | 1 + gfx/drivers/gdi_gfx.c | 1 + gfx/drivers/gl.c | 1 + gfx/drivers/sixel_gfx.c | 1 + gfx/drivers/vg.c | 3 +++ gfx/drivers/vulkan.c | 1 + 9 files changed, 11 insertions(+) diff --git a/gfx/common/gdi_common.h b/gfx/common/gdi_common.h index 4bac582f3f..3fc5423f9f 100644 --- a/gfx/common/gdi_common.h +++ b/gfx/common/gdi_common.h @@ -35,6 +35,7 @@ typedef struct gdi unsigned screen_width; unsigned screen_height; void *ctx_data; + const gfx_ctx_driver_t *ctx_driver; } gdi_t; typedef struct gdi_texture diff --git a/gfx/common/gl_common.h b/gfx/common/gl_common.h index 4488287813..893fdfb709 100644 --- a/gfx/common/gl_common.h +++ b/gfx/common/gl_common.h @@ -318,6 +318,7 @@ struct gl const gl_renderchain_driver_t *renderchain_driver; void *renderchain_data; void *ctx_data; + const gfx_ctx_driver_t *ctx_driver; }; static INLINE void gl_bind_texture(GLuint id, GLint wrap_mode, GLint mag_filter, diff --git a/gfx/common/sixel_common.h b/gfx/common/sixel_common.h index d0bda4cef9..f53438f0eb 100644 --- a/gfx/common/sixel_common.h +++ b/gfx/common/sixel_common.h @@ -30,6 +30,7 @@ typedef struct sixel unsigned screen_width; unsigned screen_height; void *ctx_data; + const gfx_ctx_driver_t *ctx_driver; } sixel_t; #endif diff --git a/gfx/common/vulkan_common.h b/gfx/common/vulkan_common.h index 524f69336d..10d6a1b1ba 100644 --- a/gfx/common/vulkan_common.h +++ b/gfx/common/vulkan_common.h @@ -333,6 +333,7 @@ typedef struct vk vulkan_context_t *context; video_info_t video; void *ctx_data; + const gfx_ctx_driver_t *ctx_driver; VkFormat tex_fmt; math_matrix_4x4 mvp, mvp_no_rot; diff --git a/gfx/drivers/gdi_gfx.c b/gfx/drivers/gdi_gfx.c index b560f52d07..8765351ca4 100644 --- a/gfx/drivers/gdi_gfx.c +++ b/gfx/drivers/gdi_gfx.c @@ -114,6 +114,7 @@ static void *gdi_gfx_init(const video_info_t *video, if (ctx_data) gdi->ctx_data = ctx_data; + gdi->ctx_driver = ctx_driver; video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver); RARCH_LOG("[GDI]: Found GDI context: %s\n", ctx_driver->ident); diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 9ba79b00e4..bf23195a58 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -1733,6 +1733,7 @@ static void *gl_init(const video_info_t *video, video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver); + gl->ctx_driver = ctx_driver; gl->video_info = *video; RARCH_LOG("[GL]: Found GL context: %s\n", ctx_driver->ident); diff --git a/gfx/drivers/sixel_gfx.c b/gfx/drivers/sixel_gfx.c index 20676cc755..6966820e14 100644 --- a/gfx/drivers/sixel_gfx.c +++ b/gfx/drivers/sixel_gfx.c @@ -227,6 +227,7 @@ static void *sixel_gfx_init(const video_info_t *video, if (ctx_data) sixel->ctx_data = ctx_data; + sixel->ctx_driver = ctx_driver; video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver); RARCH_LOG("[SIXEL]: Found SIXEL context: %s\n", ctx_driver->ident); diff --git a/gfx/drivers/vg.c b/gfx/drivers/vg.c index f830e89117..b93ce38fb2 100644 --- a/gfx/drivers/vg.c +++ b/gfx/drivers/vg.c @@ -71,6 +71,8 @@ typedef struct VGuint mGlyphIndices[1024]; VGPaint mPaintFg; VGPaint mPaintBg; + void *ctx_data; + const gfx_ctx_driver_t *ctx_driver; } vg_t; static PFNVGCREATEEGLIMAGETARGETKHRPROC pvgCreateEGLImageTargetKHR; @@ -115,6 +117,7 @@ static void *vg_init(const video_info_t *video, if (ctx_data) vg->ctx_data = ctx_data; + vg->ctx_driver = ctx; video_context_driver_set((void*)ctx); video_context_driver_get_video_size(&mode); diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index abf12506fb..6713a46fbc 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -1146,6 +1146,7 @@ static void *vulkan_init(const video_info_t *video, goto error; } + vk->ctx_driver = ctx_driver; video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver); video_context_driver_get_video_size(&mode);