[Mesa-dev] [PATCH 1/7] mesa: make _mesa_compressed_texture_sub_image() static
Timothy Arceri
tarceri at itsqueeze.com
Fri May 12 04:12:55 UTC 2017
---
src/mesa/main/teximage.c | 69 +++++++++++++++++++++---------------------------
src/mesa/main/teximage.h | 12 ---------
2 files changed, 30 insertions(+), 51 deletions(-)
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 1a00d25..2486704 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -4492,31 +4492,28 @@ _mesa_CompressedTexImage3D(GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
teximage(ctx, GL_TRUE, 3, target, level, internalFormat,
width, height, depth, border, GL_NONE, GL_NONE, imageSize, data);
}
/**
* Common helper for glCompressedTexSubImage1/2/3D() and
* glCompressedTextureSubImage1/2/3D().
*/
-void
-_mesa_compressed_texture_sub_image(struct gl_context *ctx, GLuint dims,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset,
- GLsizei width, GLsizei height,
- GLsizei depth,
- GLenum format, GLsizei imageSize,
- const GLvoid *data)
+static void
+compressed_texture_sub_image(struct gl_context *ctx, GLuint dims,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage,
+ GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth, GLenum format,
+ GLsizei imageSize, const GLvoid *data)
{
FLUSH_VERTICES(ctx, 0);
_mesa_lock_texture(ctx, texObj);
{
if (width > 0 && height > 0 && depth > 0) {
ctx->Driver.CompressedTexSubImage(ctx, dims, texImage,
xoffset, yoffset, zoffset,
width, height, depth,
format, imageSize, data);
@@ -4555,23 +4552,23 @@ _mesa_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset,
level, xoffset, 0, 0,
width, 1, 1,
format, imageSize, data,
"glCompressedTexSubImage1D")) {
return;
}
texImage = _mesa_select_tex_image(texObj, target, level);
assert(texImage);
- _mesa_compressed_texture_sub_image(ctx, 1, texObj, texImage, target, level,
- xoffset, 0, 0, width, 1, 1,
- format, imageSize, data);
+ compressed_texture_sub_image(ctx, 1, texObj, texImage, target, level,
+ xoffset, 0, 0, width, 1, 1, format, imageSize,
+ data);
}
void GLAPIENTRY
_mesa_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset,
GLsizei width, GLenum format,
GLsizei imageSize, const GLvoid *data)
{
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
@@ -4591,24 +4588,23 @@ _mesa_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset,
level, xoffset, 0, 0,
width, 1, 1,
format, imageSize, data,
"glCompressedTextureSubImage1D")) {
return;
}
texImage = _mesa_select_tex_image(texObj, texObj->Target, level);
assert(texImage);
- _mesa_compressed_texture_sub_image(ctx, 1, texObj, texImage,
- texObj->Target, level,
- xoffset, 0, 0, width, 1, 1,
- format, imageSize, data);
+ compressed_texture_sub_image(ctx, 1, texObj, texImage, texObj->Target,
+ level, xoffset, 0, 0, width, 1, 1, format,
+ imageSize, data);
}
void GLAPIENTRY
_mesa_CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize,
const GLvoid *data)
{
struct gl_texture_object *texObj;
@@ -4630,23 +4626,23 @@ _mesa_CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
width, height, 1,
format, imageSize, data,
"glCompressedTexSubImage2D")) {
return;
}
texImage = _mesa_select_tex_image(texObj, target, level);
assert(texImage);
- _mesa_compressed_texture_sub_image(ctx, 2, texObj, texImage, target, level,
- xoffset, yoffset, 0, width, height, 1,
- format, imageSize, data);
+ compressed_texture_sub_image(ctx, 2, texObj, texImage, target, level,
+ xoffset, yoffset, 0, width, height, 1,
+ format, imageSize, data);
}
void GLAPIENTRY
_mesa_CompressedTextureSubImage2D(GLuint texture, GLint level, GLint xoffset,
GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize,
const GLvoid *data)
{
struct gl_texture_object *texObj;
@@ -4668,24 +4664,23 @@ _mesa_CompressedTextureSubImage2D(GLuint texture, GLint level, GLint xoffset,
level, xoffset, yoffset, 0,
width, height, 1,
format, imageSize, data,
"glCompressedTextureSubImage2D")) {
return;
}
texImage = _mesa_select_tex_image(texObj, texObj->Target, level);
assert(texImage);
- _mesa_compressed_texture_sub_image(ctx, 2, texObj, texImage,
- texObj->Target, level,
- xoffset, yoffset, 0, width, height, 1,
- format, imageSize, data);
+ compressed_texture_sub_image(ctx, 2, texObj, texImage, texObj->Target,
+ level, xoffset, yoffset, 0, width, height, 1,
+ format, imageSize, data);
}
void GLAPIENTRY
_mesa_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLsizei width,
GLsizei height, GLsizei depth, GLenum format,
GLsizei imageSize, const GLvoid *data)
{
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
@@ -4706,24 +4701,23 @@ _mesa_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset,
width, height, depth,
format, imageSize, data,
"glCompressedTexSubImage3D")) {
return;
}
texImage = _mesa_select_tex_image(texObj, target, level);
assert(texImage);
- _mesa_compressed_texture_sub_image(ctx, 3, texObj, texImage, target, level,
- xoffset, yoffset, zoffset,
- width, height, depth,
- format, imageSize, data);
+ compressed_texture_sub_image(ctx, 3, texObj, texImage, target, level,
+ xoffset, yoffset, zoffset, width, height,
+ depth, format, imageSize, data);
}
void GLAPIENTRY
_mesa_CompressedTextureSubImage3D(GLuint texture, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLsizei width,
GLsizei height, GLsizei depth,
GLenum format, GLsizei imageSize,
const GLvoid *data)
{
struct gl_texture_object *texObj;
@@ -4763,44 +4757,41 @@ _mesa_CompressedTextureSubImage3D(GLuint texture, GLint level, GLint xoffset,
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCompressedTextureSubImage3D(cube map incomplete)");
return;
}
/* Copy in each face. */
for (i = 0; i < 6; ++i) {
texImage = texObj->Image[i][level];
assert(texImage);
- _mesa_compressed_texture_sub_image(ctx, 3, texObj, texImage,
- texObj->Target, level,
- xoffset, yoffset, zoffset,
- width, height, 1,
- format, imageSize, pixels);
+ compressed_texture_sub_image(ctx, 3, texObj, texImage,
+ texObj->Target, level, xoffset, yoffset,
+ zoffset, width, height, 1, format,
+ imageSize, pixels);
/* Compressed images don't have a client format */
image_stride = _mesa_format_image_size(texImage->TexFormat,
texImage->Width,
texImage->Height, 1);
pixels += image_stride;
imageSize -= image_stride;
}
}
else {
texImage = _mesa_select_tex_image(texObj, texObj->Target, level);
assert(texImage);
- _mesa_compressed_texture_sub_image(ctx, 3, texObj, texImage,
- texObj->Target, level,
- xoffset, yoffset, zoffset,
- width, height, depth,
- format, imageSize, data);
+ compressed_texture_sub_image(ctx, 3, texObj, texImage, texObj->Target,
+ level, xoffset, yoffset, zoffset, width,
+ height, depth, format, imageSize, data);
}
}
static mesa_format
get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
{
if (ctx->API == API_OPENGL_COMPAT) {
switch (internalFormat) {
case GL_ALPHA8:
return MESA_FORMAT_A_UNORM8;
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 53c2f59..5becd29 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -220,32 +220,20 @@ extern void
_mesa_texture_sub_image(struct gl_context *ctx, GLuint dims,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLenum type, const GLvoid *pixels,
bool dsa);
extern void
-_mesa_compressed_texture_sub_image(struct gl_context *ctx, GLuint dims,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint zoffset,
- GLsizei width, GLsizei height,
- GLsizei depth,
- GLenum format, GLsizei imageSize,
- const GLvoid *data);
-
-extern void
_mesa_copy_texture_sub_image(struct gl_context *ctx, GLuint dims,
struct gl_texture_object *texObj,
GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLint x, GLint y,
GLsizei width, GLsizei height,
const char *caller);
bool
_mesa_is_cube_map_texture(GLenum target);
--
2.9.3
More information about the mesa-dev
mailing list