mesa/st: factor out st_AllocTextureStorage into a helper
authorAndres Rodriguez <andresx7@gmail.com>
Wed, 12 Jul 2017 22:45:13 +0000 (18:45 -0400)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 6 Aug 2017 02:42:06 +0000 (12:42 +1000)
Plumbing for using memory objects as texture storage.

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_cb_texture.c

index f1eb548bb87e61ec03b9644526d5fb6db18212e8..96dd0c1c7a6c8509ddfc47be2621642ecfdbe8b2 100644 (file)
@@ -2647,18 +2647,16 @@ st_finalize_texture(struct gl_context *ctx,
    return GL_TRUE;
 }
 
-
 /**
- * Called via ctx->Driver.AllocTextureStorage() to allocate texture memory
- * for a whole mipmap stack.
+ * Allocate texture memory for a whole mipmap stack.
  * Note: for multisample textures if the requested sample count is not
  * supported, we search for the next higher supported sample count.
  */
 static GLboolean
-st_AllocTextureStorage(struct gl_context *ctx,
-                       struct gl_texture_object *texObj,
-                       GLsizei levels, GLsizei width,
-                       GLsizei height, GLsizei depth)
+st_texture_storage(struct gl_context *ctx,
+                   struct gl_texture_object *texObj,
+                   GLsizei levels, GLsizei width,
+                   GLsizei height, GLsizei depth)
 {
    const GLuint numFaces = _mesa_num_tex_faces(texObj->Target);
    struct gl_texture_image *texImage = texObj->Image[0][0];
@@ -2739,6 +2737,20 @@ st_AllocTextureStorage(struct gl_context *ctx,
    return GL_TRUE;
 }
 
+/**
+ * Called via ctx->Driver.AllocTextureStorage() to allocate texture memory
+ * for a whole mipmap stack.
+ */
+static GLboolean
+st_AllocTextureStorage(struct gl_context *ctx,
+                       struct gl_texture_object *texObj,
+                       GLsizei levels, GLsizei width,
+                       GLsizei height, GLsizei depth)
+{
+   return st_texture_storage(ctx, texObj, levels,
+                             width, height, depth);
+}
+
 
 static GLboolean
 st_TestProxyTexImage(struct gl_context *ctx, GLenum target,