From 7894410d85769c138cb2ef1ba8dfce9f27fa7a06 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 7 Jul 2021 17:57:47 +0200 Subject: [PATCH] vrend: Move GL blitter forward declaration to vrend_blitter.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It just seems to make more sense there. Related: https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/125 Signed-off-by: Gert Wollny Reviewed-by: Corentin Noël . --- src/vrend_blitter.c | 4 ++-- src/vrend_blitter.h | 12 ++++++++++++ src/vrend_renderer.c | 1 + src/vrend_renderer.h | 7 ------- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/vrend_blitter.c b/src/vrend_blitter.c index 9cac0e5..947fded 100644 --- a/src/vrend_blitter.c +++ b/src/vrend_blitter.c @@ -320,7 +320,7 @@ static GLuint blit_get_frag_tex_col(struct vrend_blitter_ctx *blit_ctx, int pipe_tex_target, unsigned nr_samples, const struct vrend_format_table *src_entry, - uint8_t swizzle[static 4]) + const uint8_t swizzle[static 4]) { assert(pipe_tex_target < PIPE_MAX_TEXTURE_TYPES); @@ -702,7 +702,7 @@ static void vrend_set_vertex_param(GLuint prog_id) void vrend_renderer_blit_gl(ASSERTED struct vrend_context *ctx, struct vrend_resource *src_res, struct vrend_resource *dst_res, - struct vrend_blit_info *info) + const struct vrend_blit_info *info) { struct vrend_blitter_ctx *blit_ctx = &vrend_blit_ctx; GLuint buffers; diff --git a/src/vrend_blitter.h b/src/vrend_blitter.h index c4a7adb..c5c4b68 100644 --- a/src/vrend_blitter.h +++ b/src/vrend_blitter.h @@ -24,6 +24,9 @@ #ifndef VREND_BLITTER_H #define VREND_BLITTER_H +#include "util/os_misc.h" +#include "util/macros.h" + /* shaders for blitting */ #define HEADER_GL \ @@ -126,9 +129,18 @@ "}\n" +struct vrend_context; +struct vrend_resource; +struct vrend_blit_info; #define FS_TEXFETCH_DS_MSAA_GL HEADER_GL FS_TEXFETCH_DS_MSAA_BODY #define FS_TEXFETCH_DS_MSAA_GLES HEADER_GLES FS_TEXFETCH_DS_MSAA_BODY_GLES #define FS_TEXFETCH_DS_MSAA_ARRAY_GLES HEADER_GLES_MS_ARRAY FS_TEXFETCH_DS_MSAA_BODY_GLES +/* implement blitting using OpenGL. */ +void vrend_renderer_blit_gl(ASSERTED struct vrend_context *ctx, + struct vrend_resource *src_res, + struct vrend_resource *dst_res, + const struct vrend_blit_info *info); +void vrend_blitter_fini(void); #endif diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index eecf186..8ad3112 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -44,6 +44,7 @@ #include "vrend_shader.h" #include "vrend_renderer.h" +#include "vrend_blitter.h" #include "vrend_debug.h" #include "vrend_winsys.h" #include "vrend_blitter.h" diff --git a/src/vrend_renderer.h b/src/vrend_renderer.h index 4e5762b..69f17d8 100644 --- a/src/vrend_renderer.h +++ b/src/vrend_renderer.h @@ -488,13 +488,6 @@ bool vrend_format_is_bgra(enum virgl_formats format); boolean format_is_copy_compatible(enum virgl_formats src, enum virgl_formats dst, unsigned int flags); -/* blitter interface */ -void vrend_renderer_blit_gl(struct vrend_context *ctx, - struct vrend_resource *src_res, - struct vrend_resource *dst_res, - struct vrend_blit_info *info); -void vrend_blitter_fini(void); - void vrend_renderer_prepare_reset(void); void vrend_renderer_reset(void); int vrend_renderer_get_poll_fd(void);