summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/dd.h33
-rw-r--r--src/mesa/main/teximage.c31
-rw-r--r--src/mesa/main/texstore.c69
-rw-r--r--src/mesa/main/texstore.h27
4 files changed, 34 insertions, 126 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 07106ac3684..1582a8c81ec 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -279,33 +279,14 @@ struct dd_function_table {
GLsizei imageSize, const GLvoid *data);
/**
- * Called by glCompressedTexSubImage1D().
+ * Called by glCompressedTexSubImage[123]D().
*/
- void (*CompressedTexSubImage1D)(struct gl_context *ctx,
- struct gl_texture_image *texImage,
- GLint xoffset, GLsizei width,
- GLenum format,
- GLsizei imageSize, const GLvoid *data);
-
- /**
- * Called by glCompressedTexSubImage2D().
- */
- void (*CompressedTexSubImage2D)(struct gl_context *ctx,
- struct gl_texture_image *texImage,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLint height,
- GLenum format,
- GLsizei imageSize, const GLvoid *data);
-
- /**
- * Called by glCompressedTexSubImage3D().
- */
- void (*CompressedTexSubImage3D)(struct gl_context *ctx,
- struct gl_texture_image *texImage,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLint height, GLint depth,
- GLenum format,
- GLsizei imageSize, const GLvoid *data);
+ void (*CompressedTexSubImage)(struct gl_context *ctx, GLuint dims,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLint height, GLint depth,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data);
/**
* Called by glGetCompressedTexImage.
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 290a4e454dc..b16baaf914c 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -3633,33 +3633,10 @@ compressed_tex_sub_image(GLuint dims, GLenum target, GLint level,
/* error was recorded */
}
else if (width > 0 && height > 0 && depth > 0) {
- switch (dims) {
- case 1:
- if (ctx->Driver.CompressedTexSubImage1D) {
- ctx->Driver.CompressedTexSubImage1D(ctx, texImage,
- xoffset, width,
- format, imageSize, data);
- }
- break;
- case 2:
- if (ctx->Driver.CompressedTexSubImage2D) {
- ctx->Driver.CompressedTexSubImage2D(ctx, texImage,
- xoffset, yoffset,
- width, height,
- format, imageSize, data);
- }
- break;
- case 3:
- if (ctx->Driver.CompressedTexSubImage3D) {
- ctx->Driver.CompressedTexSubImage3D(ctx, texImage,
- xoffset, yoffset, zoffset,
- width, height, depth,
- format, imageSize, data);
- }
- break;
- default:
- ;
- }
+ ctx->Driver.CompressedTexSubImage(ctx, dims, texImage,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, imageSize, data);
check_gen_mipmap(ctx, target, texObj, level);
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 37ba082a475..1ced8aac98d 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -4342,43 +4342,24 @@ _mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims,
return;
}
- _mesa_store_compressed_texsubimage2d(ctx, texImage,
- 0, 0,
- width, height,
- texImage->TexFormat,
- imageSize, data);
+ _mesa_store_compressed_texsubimage(ctx, dims, texImage,
+ 0, 0, 0,
+ width, height, depth,
+ texImage->TexFormat,
+ imageSize, data);
}
/**
- * Fallback for Driver.CompressedTexSubImage1D()
+ * Fallback for Driver.CompressedTexSubImage()
*/
void
-_mesa_store_compressed_texsubimage1d(struct gl_context *ctx,
- struct gl_texture_image *texImage,
- GLint xoffset, GLsizei width,
- GLenum format,
- GLsizei imageSize, const GLvoid *data)
-{
- /* there are no compressed 1D texture formats yet */
- (void) ctx;
- (void) xoffset; (void) width;
- (void) format;
- (void) imageSize; (void) data;
- (void) texImage;
-}
-
-
-/**
- * Fallback for Driver.CompressedTexSubImage2D()
- */
-void
-_mesa_store_compressed_texsubimage2d(struct gl_context *ctx,
- struct gl_texture_image *texImage,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format,
- GLsizei imageSize, const GLvoid *data)
+_mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data)
{
GLint bytesPerRow, dstRowStride, srcRowStride;
GLint i, rows;
@@ -4387,6 +4368,11 @@ _mesa_store_compressed_texsubimage2d(struct gl_context *ctx,
const gl_format texFormat = texImage->TexFormat;
GLuint bw, bh;
+ if (dims != 2) {
+ _mesa_problem(ctx, "Unexpected 1D/3D compressed texsubimage call");
+ return;
+ }
+
_mesa_get_format_block_size(texFormat, &bw, &bh);
/* these should have been caught sooner */
@@ -4430,24 +4416,3 @@ _mesa_store_compressed_texsubimage2d(struct gl_context *ctx,
_mesa_unmap_teximage_pbo(ctx, &ctx->Unpack);
}
-
-
-/**
- * Fallback for Driver.CompressedTexSubImage3D()
- */
-void
-_mesa_store_compressed_texsubimage3d(struct gl_context *ctx,
- struct gl_texture_image *texImage,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format,
- GLsizei imageSize, const GLvoid *data)
-{
- /* there are no compressed 3D texture formats yet */
- (void) ctx;
- (void) xoffset; (void) yoffset; (void) zoffset;
- (void) width; (void) height; (void) depth;
- (void) format;
- (void) imageSize; (void) data;
- (void) texImage;
-}
diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h
index 68dc4b47960..5a1c014231c 100644
--- a/src/mesa/main/texstore.h
+++ b/src/mesa/main/texstore.h
@@ -118,27 +118,12 @@ _mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims,
extern void
-_mesa_store_compressed_texsubimage1d(struct gl_context *ctx,
- struct gl_texture_image *texImage,
- GLint xoffset, GLsizei width,
- GLenum format,
- GLsizei imageSize, const GLvoid *data);
-
-extern void
-_mesa_store_compressed_texsubimage2d(struct gl_context *ctx,
- struct gl_texture_image *texImage,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format,
- GLsizei imageSize, const GLvoid *data);
-
-extern void
-_mesa_store_compressed_texsubimage3d(struct gl_context *ctx,
- struct gl_texture_image *texImage,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format,
- GLsizei imageSize, const GLvoid *data);
+_mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data);
#endif