mesa/st: convert the non-optional egl image to direct calls
authorDave Airlie <airlied@redhat.com>
Tue, 7 Dec 2021 02:50:13 +0000 (12:50 +1000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 8 Dec 2021 19:06:48 +0000 (19:06 +0000)
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14100>

src/mesa/main/dd.h
src/mesa/main/fbobject.c
src/mesa/main/teximage.c
src/mesa/state_tracker/st_cb_eglimage.c
src/mesa/state_tracker/st_cb_eglimage.h

index 2844d76..af54e02 100644 (file)
@@ -334,25 +334,6 @@ struct dd_function_table {
    /*@}*/
 
    /**
-    * \name GL_OES_EGL_image interface
-    */
-   void (*EGLImageTargetTexture2D)(struct gl_context *ctx, GLenum target,
-                                  struct gl_texture_object *texObj,
-                                  struct gl_texture_image *texImage,
-                                  GLeglImageOES image_handle);
-   void (*EGLImageTargetRenderbufferStorage)(struct gl_context *ctx,
-                                            struct gl_renderbuffer *rb,
-                                            void *image_handle);
-
-   /**
-    * \name GL_EXT_EGL_image_storage interface
-    */
-   void (*EGLImageTargetTexStorage)(struct gl_context *ctx, GLenum target,
-                                    struct gl_texture_object *texObj,
-                                    struct gl_texture_image *texImage,
-                                    GLeglImageOES image_handle);
-
-   /**
     * \name GL_ARB_texture_multisample
     */
    void (*GetSamplePosition)(struct gl_context *ctx,
index 1227e36..2125893 100644 (file)
@@ -52,6 +52,8 @@
 #include "texobj.h"
 
 #include "state_tracker/st_cb_fbo.h"
+#include "state_tracker/st_cb_eglimage.h"
+
 /**
  * Notes:
  *
@@ -2754,7 +2756,7 @@ _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
 
    FLUSH_VERTICES(ctx, _NEW_BUFFERS, 0);
 
-   ctx->Driver.EGLImageTargetRenderbufferStorage(ctx, rb, image);
+   st_egl_image_target_renderbuffer_storage(ctx, rb, image);
 }
 
 
index a219f74..dffae30 100644 (file)
@@ -60,6 +60,7 @@
 #include "state_tracker/st_cb_texture.h"
 #include "state_tracker/st_format.h"
 #include "state_tracker/st_gen_mipmap.h"
+#include "state_tracker/st_cb_eglimage.h"
 
 /**
  * Returns a corresponding internal floating point format for a given base
@@ -3452,11 +3453,11 @@ egl_image_target_texture(struct gl_context *ctx,
       texObj->External = GL_TRUE;
 
       if (tex_storage) {
-         ctx->Driver.EGLImageTargetTexStorage(ctx, target, texObj, texImage,
-                                              image);
+         st_egl_image_target_tex_storage(ctx, target, texObj, texImage,
+                                         image);
       } else {
-         ctx->Driver.EGLImageTargetTexture2D(ctx, target, texObj, texImage,
-                                             image);
+         st_egl_image_target_texture_2d(ctx, target, texObj, texImage,
+                                        image);
       }
 
       _mesa_dirty_texobj(ctx, texObj);
index a89316a..ec7dcad 100644 (file)
@@ -226,10 +226,10 @@ st_pipe_format_to_base_format(enum pipe_format format)
    return base_format;
 }
 
-static void
+void
 st_egl_image_target_renderbuffer_storage(struct gl_context *ctx,
-                                        struct gl_renderbuffer *rb,
-                                        GLeglImageOES image_handle)
+                                         struct gl_renderbuffer *rb,
+                                         GLeglImageOES image_handle)
 {
    struct st_renderbuffer *strb = st_renderbuffer(rb);
    struct st_egl_image stimg;
@@ -395,11 +395,11 @@ st_bind_egl_image(struct gl_context *ctx,
    _mesa_dirty_texobj(ctx, texObj);
 }
 
-static void
+void
 st_egl_image_target_texture_2d(struct gl_context *ctx, GLenum target,
-                              struct gl_texture_object *texObj,
-                              struct gl_texture_image *texImage,
-                              GLeglImageOES image_handle)
+                               struct gl_texture_object *texObj,
+                               struct gl_texture_image *texImage,
+                               GLeglImageOES image_handle)
 {
    struct st_egl_image stimg;
    bool native_supported;
@@ -415,7 +415,7 @@ st_egl_image_target_texture_2d(struct gl_context *ctx, GLenum target,
    pipe_resource_reference(&stimg.texture, NULL);
 }
 
-static void
+void
 st_egl_image_target_tex_storage(struct gl_context *ctx, GLenum target,
                                 struct gl_texture_object *texObj,
                                 struct gl_texture_image *texImage,
@@ -447,10 +447,6 @@ void
 st_init_eglimage_functions(struct dd_function_table *functions,
                            bool has_egl_image_validate)
 {
-   functions->EGLImageTargetTexture2D = st_egl_image_target_texture_2d;
-   functions->EGLImageTargetTexStorage = st_egl_image_target_tex_storage;
-   functions->EGLImageTargetRenderbufferStorage = st_egl_image_target_renderbuffer_storage;
-
    if (has_egl_image_validate)
       functions->ValidateEGLImage = st_validate_egl_image;
 }
index 9bdffa5..4a28690 100644 (file)
@@ -35,4 +35,15 @@ extern void
 st_init_eglimage_functions(struct dd_function_table *functions,
                            bool has_egl_image_validate);
 
+void st_egl_image_target_texture_2d(struct gl_context *ctx, GLenum target,
+                                    struct gl_texture_object *texObj,
+                                    struct gl_texture_image *texImage,
+                                    GLeglImageOES image_handle);
+void st_egl_image_target_tex_storage(struct gl_context *ctx, GLenum target,
+                                     struct gl_texture_object *texObj,
+                                     struct gl_texture_image *texImage,
+                                     GLeglImageOES image_handle);
+void st_egl_image_target_renderbuffer_storage(struct gl_context *ctx,
+                                              struct gl_renderbuffer *rb,
+                                              GLeglImageOES image_handle);
 #endif /* ST_CB_EGLIMAGE_H */