diff options
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_image.c | 43 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_texture.c | 42 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_texture.c | 50 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_texture.h | 23 |
4 files changed, 63 insertions, 95 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 107d3147279..32f2e85515e 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -202,16 +202,16 @@ try_pbo_upload(struct gl_context *ctx, static void intelTexImage(struct gl_context * ctx, GLint dims, - GLenum target, GLint level, + struct gl_texture_image *texImage, GLint internalFormat, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const void *pixels, const struct gl_pixelstore_attrib *unpack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage, GLsizei imageSize) + GLsizei imageSize) { DBG("%s target %s level %d %dx%dx%d\n", __FUNCTION__, - _mesa_lookup_enum_by_nr(target), level, width, height, depth); + _mesa_lookup_enum_by_nr(texImage->TexObject->Target), + texImage->Level, width, height, depth); /* Attempt to use the blitter for PBO image uploads. */ @@ -224,59 +224,52 @@ intelTexImage(struct gl_context * ctx, DBG("%s: upload image %dx%dx%d pixels %p\n", __FUNCTION__, width, height, depth, pixels); - _mesa_store_teximage3d(ctx, target, level, internalFormat, + _mesa_store_teximage3d(ctx, texImage, internalFormat, width, height, depth, 0, - format, type, pixels, - unpack, texObj, texImage); + format, type, pixels, unpack); } static void intelTexImage3D(struct gl_context * ctx, - GLenum target, GLint level, + struct gl_texture_image *texImage, GLint internalFormat, GLint width, GLint height, GLint depth, GLint border, GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *unpack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *unpack) { - intelTexImage(ctx, 3, target, level, + intelTexImage(ctx, 3, texImage, internalFormat, width, height, depth, - format, type, pixels, unpack, texObj, texImage, 0); + format, type, pixels, unpack, 0); } static void intelTexImage2D(struct gl_context * ctx, - GLenum target, GLint level, + struct gl_texture_image *texImage, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *unpack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *unpack) { - intelTexImage(ctx, 2, target, level, + intelTexImage(ctx, 2, texImage, internalFormat, width, height, 1, - format, type, pixels, unpack, texObj, texImage, 0); + format, type, pixels, unpack, 0); } static void intelTexImage1D(struct gl_context * ctx, - GLenum target, GLint level, + struct gl_texture_image *texImage, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *unpack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *unpack) { - intelTexImage(ctx, 1, target, level, + intelTexImage(ctx, 1, texImage, internalFormat, width, 1, 1, - format, type, pixels, unpack, texObj, texImage, 0); + format, type, pixels, unpack, 0); } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index e9f74e81a73..0fb80ffd9cd 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -452,14 +452,15 @@ get_teximage_placement(struct gl_texture_image *ti) } static void -nouveau_teximage(struct gl_context *ctx, GLint dims, GLenum target, GLint level, +nouveau_teximage(struct gl_context *ctx, GLint dims, + struct gl_texture_image *ti, GLint internalFormat, GLint width, GLint height, GLint depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *t, - struct gl_texture_image *ti) + const struct gl_pixelstore_attrib *packing) { + struct gl_texture_object *t = ti->TexObject; + const GLuint level = ti->Level; struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface; struct nouveau_teximage *nti = to_nouveau_teximage(ti); int ret; @@ -505,45 +506,42 @@ nouveau_teximage(struct gl_context *ctx, GLint dims, GLenum target, GLint level, } static void -nouveau_teximage_1d(struct gl_context *ctx, GLenum target, GLint level, +nouveau_teximage_1d(struct gl_context *ctx, + struct gl_texture_image *ti, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *t, - struct gl_texture_image *ti) + const struct gl_pixelstore_attrib *packing) { - nouveau_teximage(ctx, 1, target, level, internalFormat, + nouveau_teximage(ctx, 1, ti, internalFormat, width, 1, 1, border, format, type, pixels, - packing, t, ti); + packing); } static void -nouveau_teximage_2d(struct gl_context *ctx, GLenum target, GLint level, +nouveau_teximage_2d(struct gl_context *ctx, + struct gl_texture_image *ti, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *t, - struct gl_texture_image *ti) + const struct gl_pixelstore_attrib *packing) { - nouveau_teximage(ctx, 2, target, level, internalFormat, + nouveau_teximage(ctx, 2, ti, internalFormat, width, height, 1, border, format, type, pixels, - packing, t, ti); + packing); } static void -nouveau_teximage_3d(struct gl_context *ctx, GLenum target, GLint level, +nouveau_teximage_3d(struct gl_context *ctx, + struct gl_texture_image *ti, GLint internalFormat, GLint width, GLint height, GLint depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *t, - struct gl_texture_image *ti) + const struct gl_pixelstore_attrib *packing) { - nouveau_teximage(ctx, 3, target, level, internalFormat, + nouveau_teximage(ctx, 3, ti, internalFormat, width, height, depth, border, format, type, pixels, - packing, t, ti); + packing); } static void diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 71eff75cc04..78fb1b5c7d1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -578,58 +578,56 @@ static void teximage_assign_miptree(radeonContextPtr rmesa, */ static void radeon_teximage( struct gl_context *ctx, int dims, - GLenum target, GLint level, + struct gl_texture_image *texImage, GLint internalFormat, GLint width, GLint height, GLint depth, GLsizei imageSize, GLenum format, GLenum type, const GLvoid * pixels, const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage, int compressed) { - _mesa_store_teximage3d(ctx, target, level, internalFormat, + _mesa_store_teximage3d(ctx, texImage, internalFormat, width, height, depth, 0, format, type, pixels, - packing, texObj, texImage); + packing); } -void radeonTexImage1D(struct gl_context * ctx, GLenum target, GLint level, +static void +radeonTexImage1D(struct gl_context * ctx, + struct gl_texture_image *texImage, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *packing) { - radeon_teximage(ctx, 1, target, level, internalFormat, width, 1, 1, - 0, format, type, pixels, packing, texObj, texImage, 0); + radeon_teximage(ctx, 1, texImage, internalFormat, width, 1, 1, + 0, format, type, pixels, packing, 0); } -void radeonTexImage2D(struct gl_context * ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLenum format, GLenum type, const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) +static void +radeonTexImage2D(struct gl_context * ctx, + struct gl_texture_image *texImage, + GLint internalFormat, + GLint width, GLint height, GLint border, + GLenum format, GLenum type, const GLvoid * pixels, + const struct gl_pixelstore_attrib *packing) { - radeon_teximage(ctx, 2, target, level, internalFormat, width, height, 1, - 0, format, type, pixels, packing, texObj, texImage, 0); + radeon_teximage(ctx, 2, texImage, internalFormat, width, height, 1, + 0, format, type, pixels, packing, 0); } -void radeonTexImage3D(struct gl_context * ctx, GLenum target, GLint level, +static void +radeonTexImage3D(struct gl_context * ctx, + struct gl_texture_image *texImage, GLint internalFormat, GLint width, GLint height, GLint depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) + const struct gl_pixelstore_attrib *packing) { - radeon_teximage(ctx, 3, target, level, internalFormat, width, height, depth, - 0, format, type, pixels, packing, texObj, texImage, 0); + radeon_teximage(ctx, 3, texImage, internalFormat, width, height, depth, + 0, format, type, pixels, packing, 0); } unsigned radeonIsFormatRenderable(gl_format mesa_format) diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.h b/src/mesa/drivers/dri/radeon/radeon_texture.h index f1af109707f..ebe16c05f99 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.h +++ b/src/mesa/drivers/dri/radeon/radeon_texture.h @@ -65,34 +65,13 @@ gl_format radeonChooseTextureFormat(struct gl_context * ctx, GLenum format, GLenum type, GLboolean fbo); -void radeonTexImage1D(struct gl_context * ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint border, - GLenum format, GLenum type, const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); -void radeonTexImage2D(struct gl_context * ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLenum format, GLenum type, const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); void radeonCompressedTexImage2D(struct gl_context * ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, GLsizei imageSize, const GLvoid * data, struct gl_texture_object *texObj, struct gl_texture_image *texImage); -void radeonTexImage3D(struct gl_context * ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint depth, - GLint border, - GLenum format, GLenum type, const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); + void radeonTexSubImage1D(struct gl_context * ctx, GLenum target, GLint level, GLint xoffset, GLsizei width, |