summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-12-30 08:24:55 -0700
committerBrian Paul <[email protected]>2011-12-30 08:24:55 -0700
commitda0cc82a093eb97212e989648da638a262ed3e84 (patch)
treed3271c7872ac0f6e5e882859d561584f80a4393c /src/mesa/drivers
parentc22a95c4f2db64c61cb25f37acc38254f30850f1 (diff)
mesa: simplify Driver.TexSubImage() parameters
There's no need to pass the target, level and texObj parameters since they can be easily obtained from the texImage pointer. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/common/meta.c18
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_subimage.c31
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_texture.c45
3 files changed, 42 insertions, 52 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 5098680b6a8..785a59531d3 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3157,19 +3157,19 @@ copy_tex_sub_image(struct gl_context *ctx,
*/
_mesa_meta_begin(ctx, MESA_META_PIXEL_STORE);
if (target == GL_TEXTURE_1D) {
- ctx->Driver.TexSubImage1D(ctx, target, level, xoffset,
- width, format, type, buf,
- &ctx->Unpack, texObj, texImage);
+ ctx->Driver.TexSubImage1D(ctx, texImage,
+ xoffset, width,
+ format, type, buf, &ctx->Unpack);
}
else if (target == GL_TEXTURE_3D) {
- ctx->Driver.TexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset,
- width, height, 1, format, type, buf,
- &ctx->Unpack, texObj, texImage);
+ ctx->Driver.TexSubImage3D(ctx, texImage,
+ xoffset, yoffset, zoffset, width, height, 1,
+ format, type, buf, &ctx->Unpack);
}
else {
- ctx->Driver.TexSubImage2D(ctx, target, level, xoffset, yoffset,
- width, height, format, type, buf,
- &ctx->Unpack, texObj, texImage);
+ ctx->Driver.TexSubImage2D(ctx, texImage,
+ xoffset, yoffset, width, height,
+ format, type, buf, &ctx->Unpack);
}
_mesa_meta_end(ctx);
diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
index 662958891b7..45727479779 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
@@ -42,13 +42,11 @@
static bool
intel_blit_texsubimage(struct gl_context * ctx,
- GLenum target, GLint level,
+ struct gl_texture_image *texImage,
GLint xoffset, GLint yoffset,
GLint width, GLint height,
GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
+ const struct gl_pixelstore_attrib *packing)
{
struct intel_context *intel = intel_context(ctx);
struct intel_texture_image *intelImage = intel_texture_image(texImage);
@@ -69,7 +67,7 @@ intel_blit_texsubimage(struct gl_context * ctx,
if (intelImage->mt->region->tiling == I915_TILING_Y)
return false;
- if (target != GL_TEXTURE_2D)
+ if (texImage->TexObject->Target != GL_TEXTURE_2D)
return false;
/* On gen6, it's probably not worth swapping to the blit ring to do
@@ -83,8 +81,8 @@ intel_blit_texsubimage(struct gl_context * ctx,
DBG("BLT subimage %s target %s level %d offset %d,%d %dx%d\n",
__FUNCTION__,
- _mesa_lookup_enum_by_nr(target),
- level, xoffset, yoffset, width, height);
+ _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
+ texImage->Level, xoffset, yoffset, width, height);
pixels = _mesa_validate_pbo_teximage(ctx, 2, width, height, 1,
format, type, pixels, packing,
@@ -112,7 +110,7 @@ intel_blit_texsubimage(struct gl_context * ctx,
dstMap = temp_bo->virtual;
dstRowStride = pitch;
- intel_miptree_get_image_offset(intelImage->mt, level,
+ intel_miptree_get_image_offset(intelImage->mt, texImage->Level,
intelImage->base.Base.Face, 0,
&blit_x, &blit_y);
blit_x += xoffset;
@@ -155,26 +153,21 @@ intel_blit_texsubimage(struct gl_context * ctx,
static void
intelTexSubImage2D(struct gl_context * ctx,
- GLenum target,
- GLint level,
+ struct gl_texture_image *texImage,
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
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)
{
- if (!intel_blit_texsubimage(ctx, target, level,
+ if (!intel_blit_texsubimage(ctx, texImage,
xoffset, yoffset,
width, height,
- format, type, pixels, packing,
- texObj, texImage)) {
- _mesa_store_texsubimage2d(ctx, target, level,
+ format, type, pixels, packing)) {
+ _mesa_store_texsubimage2d(ctx, texImage,
xoffset, yoffset,
width, height,
- format, type, pixels,
- packing, texObj, texImage);
+ format, type, pixels, packing);
}
}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index 8dd2df47f7f..e9f74e81a73 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -547,13 +547,12 @@ nouveau_teximage_3d(struct gl_context *ctx, GLenum target, GLint level,
}
static void
-nouveau_texsubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level,
+nouveau_texsubimage(struct gl_context *ctx, GLint dims,
+ struct gl_texture_image *ti,
GLint xoffset, GLint yoffset, GLint zoffset,
GLint width, GLint height, GLint depth,
GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *t,
- struct gl_texture_image *ti)
+ const struct gl_pixelstore_attrib *packing)
{
struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface;
struct nouveau_teximage *nti = to_nouveau_teximage(ti);
@@ -577,50 +576,48 @@ nouveau_texsubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint lev
_mesa_unmap_teximage_pbo(ctx, packing);
}
- if (!to_nouveau_texture(t)->dirty)
- validate_teximage(ctx, t, level, xoffset, yoffset, zoffset,
+ if (!to_nouveau_texture(ti->TexObject)->dirty)
+ validate_teximage(ctx, ti->TexObject, ti->Level,
+ xoffset, yoffset, zoffset,
width, height, depth);
}
static void
-nouveau_texsubimage_3d(struct gl_context *ctx, GLenum target, GLint level,
+nouveau_texsubimage_3d(struct gl_context *ctx,
+ struct gl_texture_image *ti,
GLint xoffset, GLint yoffset, GLint zoffset,
GLint width, GLint height, GLint depth,
GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *t,
- struct gl_texture_image *ti)
+ const struct gl_pixelstore_attrib *packing)
{
- nouveau_texsubimage(ctx, 3, target, level, xoffset, yoffset, zoffset,
+ nouveau_texsubimage(ctx, 3, ti, xoffset, yoffset, zoffset,
width, height, depth, format, type, pixels,
- packing, t, ti);
+ packing);
}
static void
-nouveau_texsubimage_2d(struct gl_context *ctx, GLenum target, GLint level,
+nouveau_texsubimage_2d(struct gl_context *ctx,
+ struct gl_texture_image *ti,
GLint xoffset, GLint yoffset,
GLint width, GLint height,
GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *t,
- struct gl_texture_image *ti)
+ const struct gl_pixelstore_attrib *packing)
{
- nouveau_texsubimage(ctx, 2, target, level, xoffset, yoffset, 0,
+ nouveau_texsubimage(ctx, 2, ti, xoffset, yoffset, 0,
width, height, 1, format, type, pixels,
- packing, t, ti);
+ packing);
}
static void
-nouveau_texsubimage_1d(struct gl_context *ctx, GLenum target, GLint level,
+nouveau_texsubimage_1d(struct gl_context *ctx,
+ struct gl_texture_image *ti,
GLint xoffset, GLint width,
GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *t,
- struct gl_texture_image *ti)
+ const struct gl_pixelstore_attrib *packing)
{
- nouveau_texsubimage(ctx, 1, target, level, xoffset, 0, 0,
+ nouveau_texsubimage(ctx, 1, ti, xoffset, 0, 0,
width, 1, 1, format, type, pixels,
- packing, t, ti);
+ packing);
}
static void