summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorAndres Rodriguez <[email protected]>2017-07-12 18:45:13 -0400
committerTimothy Arceri <[email protected]>2017-08-06 12:42:06 +1000
commit999653e398bf1020eb517d7927fa75360cf7c399 (patch)
tree14b96ffca8759fe012f90793b8ad812aee132130 /src/mesa/state_tracker
parentd0aac1b0aaef483c4bb8601e941438dfdb37b93f (diff)
mesa/st: factor out st_AllocTextureStorage into a helper
Plumbing for using memory objects as texture storage. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index f1eb548bb87..96dd0c1c7a6 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -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,