Replace intel_texture_object with st_texture_object, intel_texture_image with st_text...
authorBrian <brian@i915.localnet.net>
Mon, 6 Aug 2007 19:12:24 +0000 (13:12 -0600)
committerBrian <brian@i915.localnet.net>
Mon, 6 Aug 2007 19:12:24 +0000 (13:12 -0600)
src/mesa/drivers/dri/i915pipe/intel_fbo.c
src/mesa/drivers/dri/i915pipe/intel_tex.c
src/mesa/drivers/dri/i915pipe/intel_tex.h
src/mesa/drivers/dri/i915pipe/intel_tex_copy.c
src/mesa/drivers/dri/i915pipe/intel_tex_image.c
src/mesa/drivers/dri/i915pipe/intel_tex_subimage.c
src/mesa/drivers/dri/i915pipe/intel_tex_validate.c

index 061c6bfa1fbb0ab750ae7559ca47fd28feb1edae..2f1aa00038df0ae9d8338ff6fcc54692dcd8aa71 100644 (file)
@@ -532,7 +532,7 @@ intel_render_texture(GLcontext * ctx,
    struct gl_texture_image *newImage
       = att->Texture->Image[att->CubeMapFace][att->TextureLevel];
    struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
-   struct intel_texture_image *intel_image;
+   struct st_texture_image *st_image;
    GLuint imageOffset;
 
    (void) fb;
@@ -558,26 +558,26 @@ intel_render_texture(GLcontext * ctx,
        irb->Base.RefCount);
 
    /* point the renderbufer's region to the texture image region */
-   intel_image = intel_texture_image(newImage);
-   if (irb->region != intel_image->mt->region) {
+   st_image = st_texture_image(newImage);
+   if (irb->region != st_image->mt->region) {
       if (irb->region)
         intel->pipe->region_release(intel->pipe, &irb->region);
-      pipe_region_reference(&irb->region, intel_image->mt->region);
+      pipe_region_reference(&irb->region, st_image->mt->region);
    }
 
    /* compute offset of the particular 2D image within the texture region */
-   imageOffset = st_miptree_image_offset(intel_image->mt,
+   imageOffset = st_miptree_image_offset(st_image->mt,
                                             att->CubeMapFace,
                                             att->TextureLevel);
 
    if (att->Texture->Target == GL_TEXTURE_3D) {
-      const GLuint *offsets = st_miptree_depth_offsets(intel_image->mt,
+      const GLuint *offsets = st_miptree_depth_offsets(st_image->mt,
                                                           att->TextureLevel);
       imageOffset += offsets[att->Zoffset];
    }
 
    /* store that offset in the region */
-   intel_image->mt->region->draw_offset = imageOffset;
+   st_image->mt->region->draw_offset = imageOffset;
 
    /* update drawing region, etc */
    intel_draw_buffer(ctx, fb);
index c2f5727e6b413790b1579bdea2a9d763c65ab43e..94583cba9740d10f9d499eb48e2f3953bbf0bdd7 100644 (file)
@@ -10,12 +10,12 @@ intelIsTextureResident(GLcontext * ctx, struct gl_texture_object *texObj)
 {
 #if 0
    struct intel_context *intel = intel_context(ctx);
-   struct intel_texture_object *intelObj = intel_texture_object(texObj);
+   struct st_texture_object *stObj = st_texture_object(texObj);
 
    return
-      intelObj->mt &&
-      intelObj->mt->region &&
-      intel_is_region_resident(intel, intelObj->mt->region);
+      stObj->mt &&
+      stObj->mt->region &&
+      intel_is_region_resident(intel, stObj->mt->region);
 #endif
    return 1;
 }
@@ -27,14 +27,14 @@ intelNewTextureImage(GLcontext * ctx)
 {
    DBG("%s\n", __FUNCTION__);
    (void) ctx;
-   return (struct gl_texture_image *) CALLOC_STRUCT(intel_texture_image);
+   return (struct gl_texture_image *) CALLOC_STRUCT(st_texture_image);
 }
 
 
 static struct gl_texture_object *
 intelNewTextureObject(GLcontext * ctx, GLuint name, GLenum target)
 {
-   struct intel_texture_object *obj = CALLOC_STRUCT(intel_texture_object);
+   struct st_texture_object *obj = CALLOC_STRUCT(st_texture_object);
 
    DBG("%s\n", __FUNCTION__);
    _mesa_initialize_texture_object(&obj->base, name, target);
@@ -47,10 +47,10 @@ intelDeleteTextureObject(GLcontext *ctx,
                         struct gl_texture_object *texObj)
 {
    struct intel_context *intel = intel_context(ctx);
-   struct intel_texture_object *intelObj = intel_texture_object(texObj);
+   struct st_texture_object *stObj = st_texture_object(texObj);
 
-   if (intelObj->mt)
-      st_miptree_release(intel->pipe, &intelObj->mt);
+   if (stObj->mt)
+      st_miptree_release(intel->pipe, &stObj->mt);
 
    _mesa_delete_texture_object(ctx, texObj);
 }
@@ -60,12 +60,12 @@ static void
 intelFreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
 {
    struct intel_context *intel = intel_context(ctx);
-   struct intel_texture_image *intelImage = intel_texture_image(texImage);
+   struct st_texture_image *stImage = st_texture_image(texImage);
 
    DBG("%s\n", __FUNCTION__);
 
-   if (intelImage->mt) {
-      st_miptree_release(intel->pipe, &intelImage->mt);
+   if (stImage->mt) {
+      st_miptree_release(intel->pipe, &stImage->mt);
    }
 
    if (texImage->Data) {
index d90a80ffa9fb67963b387cb99b1e7e4a1cbf9c0d..7a1cc919749f79c0b4da708cfbf9b3e1e530df4a 100644 (file)
@@ -32,7 +32,7 @@
 #include "intel_context.h"
 #include "texmem.h"
 
-struct intel_texture_object
+struct st_texture_object
 {
    struct gl_texture_object base;       /* The "parent" object */
 
@@ -58,7 +58,7 @@ struct intel_texture_object
 
 
 
-struct intel_texture_image
+struct st_texture_image
 {
    struct gl_texture_image base;
 
@@ -67,8 +67,8 @@ struct intel_texture_image
    GLuint level;
    GLuint face;
 
-   /* If intelImage->mt != NULL, image data is stored here.
-    * Else if intelImage->base.Data != NULL, image is stored there.
+   /* If stImage->mt != NULL, image data is stored here.
+    * Else if stImage->base.Data != NULL, image is stored there.
     * Else there is no image data.
     */
    struct pipe_mipmap_tree *mt;
@@ -187,25 +187,25 @@ GLuint intel_finalize_mipmap_tree(GLcontext *ctx,
 
 #if 0
 void intel_tex_map_images(struct pipe_context *pipe,
-                          struct intel_texture_object *intelObj);
+                          struct st_texture_object *stObj);
 
 void intel_tex_unmap_images(struct pipe_context *pipe,
-                            struct intel_texture_object *intelObj);
+                            struct st_texture_object *stObj);
 #endif
 
 int intel_compressed_num_bytes(GLuint mesaFormat);
 
 
-static INLINE struct intel_texture_object *
-intel_texture_object(struct gl_texture_object *obj)
+static INLINE struct st_texture_object *
+st_texture_object(struct gl_texture_object *obj)
 {
-   return (struct intel_texture_object *) obj;
+   return (struct st_texture_object *) obj;
 }
 
-static INLINE struct intel_texture_image *
-intel_texture_image(struct gl_texture_image *img)
+static INLINE struct st_texture_image *
+st_texture_image(struct gl_texture_image *img)
 {
-   return (struct intel_texture_image *) img;
+   return (struct st_texture_image *) img;
 }
 
 
index 88cdee4583885c63f955c07f57d846972b5178ba..b62aaaeebb240a5a3806c2c807183385c7e74543 100644 (file)
@@ -84,7 +84,7 @@ get_teximage_source(struct intel_context *intel, GLenum internalFormat)
 
 static GLboolean
 do_copy_texsubimage(struct intel_context *intel,
-                    struct intel_texture_image *intelImage,
+                    struct st_texture_image *intelImage,
                     GLenum internalFormat,
                     GLint dstx, GLint dsty,
                     GLint x, GLint y, GLsizei width, GLsizei height)
@@ -186,7 +186,7 @@ intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level,
                           &ctx->DefaultPacking, texObj, texImage);
 
    if (!do_copy_texsubimage(intel_context(ctx),
-                            intel_texture_image(texImage),
+                            st_texture_image(texImage),
                             internalFormat, 0, 0, x, y, width, 1))
       goto fail;
 
@@ -223,7 +223,7 @@ intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level,
 
 
    if (!do_copy_texsubimage(intel_context(ctx),
-                            intel_texture_image(texImage),
+                            st_texture_image(texImage),
                             internalFormat, 0, 0, x, y, width, height))
       goto fail;
 
@@ -256,7 +256,7 @@ intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level,
     */
 
    if (!do_copy_texsubimage(intel_context(ctx),
-                            intel_texture_image(texImage),
+                            st_texture_image(texImage),
                             internalFormat, xoffset, 0, x, y, width, 1)) {
 #if 0
       _swrast_copy_texsubimage1d(ctx, target, level, xoffset, x, y, width);
@@ -285,7 +285,7 @@ intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
     */
 
    if (!do_copy_texsubimage(intel_context(ctx),
-                            intel_texture_image(texImage),
+                            st_texture_image(texImage),
                             internalFormat,
                             xoffset, yoffset, x, y, width, height)) {
 #if 0
index ea7b26b7f1e781db149aaf64c6021e6a42ed3970..2825df37f6e8f9d4eb9d7cdba7d7100fe6cbd12e 100644 (file)
@@ -61,9 +61,9 @@ logbase2(int n)
  * saving is worth it.
  */
 static void
-guess_and_alloc_mipmap_tree(struct intel_context *intel,
-                            struct intel_texture_object *intelObj,
-                            struct intel_texture_image *intelImage)
+guess_and_alloc_mipmap_tree(struct pipe_context *pipe,
+                            struct st_texture_object *intelObj,
+                            struct st_texture_image *intelImage)
 {
    GLuint firstLevel;
    GLuint lastLevel;
@@ -125,7 +125,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel,
    assert(!intelObj->mt);
    if (intelImage->base.IsCompressed)
       comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat);
-   intelObj->mt = st_miptree_create(intel->pipe,
+   intelObj->mt = st_miptree_create(pipe,
                                        intelObj->base.Target,
                                        intelImage->base.InternalFormat,
                                        firstLevel,
@@ -190,7 +190,7 @@ check_pbo_format(GLint internalFormat,
  */
 static GLboolean
 try_pbo_upload(struct intel_context *intel,
-               struct intel_texture_image *intelImage,
+               struct st_texture_image *intelImage,
                const struct gl_pixelstore_attrib *unpack,
                GLint internalFormat,
                GLint width, GLint height,
@@ -250,7 +250,7 @@ try_pbo_upload(struct intel_context *intel,
 
 static GLboolean
 try_pbo_zcopy(struct intel_context *intel,
-              struct intel_texture_image *intelImage,
+              struct st_texture_image *intelImage,
               const struct gl_pixelstore_attrib *unpack,
               GLint internalFormat,
               GLint width, GLint height,
@@ -277,8 +277,8 @@ intelTexImage(GLcontext * ctx,
               struct gl_texture_image *texImage, GLsizei imageSize, int compressed)
 {
    struct intel_context *intel = intel_context(ctx);
-   struct intel_texture_object *intelObj = intel_texture_object(texObj);
-   struct intel_texture_image *intelImage = intel_texture_image(texImage);
+   struct st_texture_object *intelObj = st_texture_object(texObj);
+   struct st_texture_image *intelImage = st_texture_image(texImage);
    GLint postConvWidth = width;
    GLint postConvHeight = height;
    GLint texelBytes, sizeInBytes;
@@ -352,7 +352,7 @@ intelTexImage(GLcontext * ctx,
    }
 
    if (!intelObj->mt) {
-      guess_and_alloc_mipmap_tree(intel, intelObj, intelImage);
+      guess_and_alloc_mipmap_tree(intel->pipe, intelObj, intelImage);
       if (!intelObj->mt) {
         DBG("guess_and_alloc_mipmap_tree: failed\n");
       }
@@ -572,7 +572,7 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
                    struct gl_texture_image *texImage, int compressed)
 {
    struct intel_context *intel = intel_context(ctx);
-   struct intel_texture_image *intelImage = intel_texture_image(texImage);
+   struct st_texture_image *intelImage = st_texture_image(texImage);
 
    /* Map */
    if (intelImage->mt) {
@@ -647,18 +647,18 @@ intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
    struct intel_context *intel = (struct intel_context*)
       ((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate;
    struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname);
-   struct intel_texture_object *intelObj = intel_texture_object(tObj);
+   struct st_texture_object *stObj = st_texture_object(tObj);
 
-   if (!intelObj)
+   if (!stObj)
       return;
 
-   if (intelObj->mt)
-      st_miptree_release(intel->pipe, &intelObj->mt);
+   if (stObj->mt)
+      st_miptree_release(intel->pipe, &stObj->mt);
 
-   intelObj->imageOverride = GL_TRUE;
-   intelObj->depthOverride = depth;
-   intelObj->pitchOverride = pitch;
+   stObj->imageOverride = GL_TRUE;
+   stObj->depthOverride = depth;
+   stObj->pitchOverride = pitch;
 
    if (offset)
-      intelObj->textureOffset = offset;
+      stObj->textureOffset = offset;
 }
index 27b56e907d67f025e99abae54ee6d0ce5a71cdf0..c5aab96ea7f6f52a8d091e14d6c215f16eacab46 100644 (file)
@@ -52,7 +52,7 @@ intelTexSubimage(GLcontext * ctx,
                  struct gl_texture_image *texImage)
 {
    struct intel_context *intel = intel_context(ctx);
-   struct intel_texture_image *intelImage = intel_texture_image(texImage);
+   struct st_texture_image *intelImage = st_texture_image(texImage);
    GLuint dstRowStride;
 
    DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
index 2083a2434d8fc135bdb766e925fa3d249fc1b455..d0631a88f19bdf3e73969f3bab2afb599ca76e4a 100644 (file)
@@ -14,7 +14,7 @@
  * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL.
  */
 static void
-intel_calculate_first_last_level(struct intel_texture_object *intelObj)
+intel_calculate_first_last_level(struct st_texture_object *intelObj)
 {
    struct gl_texture_object *tObj = &intelObj->base;
    const struct gl_texture_image *const baseImage =
@@ -64,8 +64,8 @@ intel_calculate_first_last_level(struct intel_texture_object *intelObj)
 
 static void
 copy_image_data_to_tree(struct pipe_context *pipe,
-                        struct intel_texture_object *intelObj,
-                        struct intel_texture_image *intelImage)
+                        struct st_texture_object *intelObj,
+                        struct st_texture_image *intelImage)
 {
    if (intelImage->mt) {
       /* Copy potentially with the blitter:
@@ -106,13 +106,13 @@ intel_finalize_mipmap_tree(GLcontext *ctx,
                            GLboolean *needFlush)
 {
    struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
-   struct intel_texture_object *intelObj = intel_texture_object(tObj);
+   struct st_texture_object *intelObj = st_texture_object(tObj);
    int comp_byte = 0;
    int cpp;
 
    GLuint face, i;
    GLuint nr_faces = 0;
-   struct intel_texture_image *firstImage;
+   struct st_texture_image *firstImage;
 
    *needFlush = GL_FALSE;
 
@@ -124,7 +124,7 @@ intel_finalize_mipmap_tree(GLcontext *ctx,
     */
    intel_calculate_first_last_level(intelObj);
    firstImage =
-      intel_texture_image(intelObj->base.Image[0][intelObj->firstLevel]);
+      st_texture_image(intelObj->base.Image[0][intelObj->firstLevel]);
 
    /* Fallback case:
     */
@@ -201,8 +201,8 @@ intel_finalize_mipmap_tree(GLcontext *ctx,
    nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
    for (face = 0; face < nr_faces; face++) {
       for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) {
-         struct intel_texture_image *intelImage =
-            intel_texture_image(intelObj->base.Image[face][i]);
+         struct st_texture_image *intelImage =
+            st_texture_image(intelObj->base.Image[face][i]);
 
          /* Need to import images in main memory or held in other trees.
           */
@@ -225,7 +225,7 @@ intel_finalize_mipmap_tree(GLcontext *ctx,
 #if 0 /* unused? */
 void
 intel_tex_map_images(struct pipe_context *pipe,
-                     struct intel_texture_object *intelObj)
+                     struct st_texture_object *intelObj)
 {
    GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
    GLuint face, i;
@@ -234,8 +234,8 @@ intel_tex_map_images(struct pipe_context *pipe,
 
    for (face = 0; face < nr_faces; face++) {
       for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) {
-         struct intel_texture_image *intelImage =
-            intel_texture_image(intelObj->base.Image[face][i]);
+         struct st_texture_image *intelImage =
+            st_texture_image(intelObj->base.Image[face][i]);
 
          if (intelImage->mt) {
             intelImage->base.Data =
@@ -257,15 +257,15 @@ intel_tex_map_images(struct pipe_context *pipe,
 
 void
 intel_tex_unmap_images(struct pipe_context *pipe,
-                       struct intel_texture_object *intelObj)
+                       struct st_texture_object *intelObj)
 {
    GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
    GLuint face, i;
 
    for (face = 0; face < nr_faces; face++) {
       for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) {
-         struct intel_texture_image *intelImage =
-            intel_texture_image(intelObj->base.Image[face][i]);
+         struct st_texture_image *intelImage =
+            st_texture_image(intelObj->base.Image[face][i]);
 
          if (intelImage->mt) {
             st_miptree_image_unmap(pipe, intelImage->mt);