[Mesa-dev,08/27] mesa/st: factor out st_AllocTextureStorage into a helper

Submitted by Andres Rodriguez on July 12, 2017, 10:45 p.m.

Details

Message ID 20170712224532.1307-9-andresx7@gmail.com
State New
Headers show
Series "Initial support for EXT_external_objects v3" ( rev: 3 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Andres Rodriguez July 12, 2017, 10:45 p.m.
Plumbing for using memory objects as texture storage.

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
---
 src/mesa/state_tracker/st_cb_texture.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index c6a5e63..8d532d3 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -2647,16 +2647,11 @@  st_finalize_texture(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)
+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];
@@ -2733,6 +2728,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,