i965: refactor intel_image_target_texture_2d
authorGurchetan Singh <gurchetansingh@chromium.org>
Thu, 7 Nov 2019 02:02:37 +0000 (18:02 -0800)
committerGurchetan Singh <gurchetansingh@chromium.org>
Mon, 13 Jan 2020 22:57:32 +0000 (14:57 -0800)
intel_image_target_texture_tex_storage can reuse much of this
code.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/drivers/dri/i965/intel_tex_image.c

index bcc0853018be46b409d1d6d5e36dc51a5f26ea1f..34491aa36efa51cc12f19dca9d776a721233a96d 100644 (file)
@@ -602,10 +602,11 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
 }
 
 static void
-intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
-                             struct gl_texture_object *texObj,
-                             struct gl_texture_image *texImage,
-                             GLeglImageOES image_handle)
+intel_image_target_texture(struct gl_context *ctx, GLenum target,
+                           struct gl_texture_object *texObj,
+                           struct gl_texture_image *texImage,
+                           GLeglImageOES image_handle,
+                           bool storage)
 {
    struct brw_context *brw = brw_context(ctx);
    struct intel_mipmap_tree *mt;
@@ -652,6 +653,16 @@ intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
    intel_miptree_release(&mt);
 }
 
+static void
+intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
+                              struct gl_texture_object *texObj,
+                              struct gl_texture_image *texImage,
+                              GLeglImageOES image_handle)
+{
+   intel_image_target_texture(ctx, target, texObj, texImage, image_handle,
+                              false);
+}
+
 static bool
 intel_gettexsubimage_blorp(struct brw_context *brw,
                            struct gl_texture_image *tex_image,