Remove internal_format field from struct pipe_texture.
authorMichel Dänzer <michel@tungstengraphics.com>
Tue, 11 Dec 2007 18:02:26 +0000 (19:02 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Tue, 11 Dec 2007 18:10:56 +0000 (19:10 +0100)
It's state tracker specific / not really necessary anyway.

src/mesa/pipe/p_state.h
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_texture.c
src/mesa/state_tracker/st_texture.h

index 109913b040cd76e4d5352e96b402d6afd82eb443..4e42838f1dbce61f2e5dc7219c0c3a9ff9c151f2 100644 (file)
@@ -264,10 +264,9 @@ struct pipe_texture
 { 
    /* Effectively the key:
     */
-   unsigned target;            /* XXX convert to PIPE_TEXTURE_x */
-   unsigned internal_format;   /* XXX convert to PIPE_FORMAT_x */
-
+   unsigned target;            /**< PIPE_TEXTURE_x */
    enum pipe_format format;    /**< PIPE_FORMAT_x */
+
    unsigned first_level;
    unsigned last_level;
 
index 5d4c443c01a5a3012fce1f434223c71f6b0bf989..0bc48b70396a974fefc3e08b541a574adbc332d5 100644 (file)
@@ -469,8 +469,8 @@ make_texture(struct st_context *st,
    assert(pipeFormat);
    cpp = st_sizeof_format(pipeFormat);
 
-   pt = st_texture_create(st, PIPE_TEXTURE_2D, pipeFormat, baseFormat, 0, 0,
-                         width, height, 1, 0);
+   pt = st_texture_create(st, PIPE_TEXTURE_2D, pipeFormat, 0, 0, width, height,
+                         1, 0);
    if (!pt)
       return NULL;
 
@@ -987,7 +987,6 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
    struct pipe_context *pipe = ctx->st->pipe;
    struct pipe_surface *surface;
    uint format = 0, cpp, comp;
-   GLenum internal_format;
    ubyte *dest;
    struct pipe_texture *pt;
    int row, col;
@@ -995,13 +994,11 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
    /* find a texture format we know */
    if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_I8, PIPE_TEXTURE )) {
       format = PIPE_FORMAT_U_I8;
-      internal_format = GL_INTENSITY8;
       cpp = 1;
       comp = 0;
    }
    else if (pipe->is_format_supported( pipe, PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_TEXTURE )) {
       format = PIPE_FORMAT_A8R8G8B8_UNORM;
-      internal_format = GL_RGBA8;
       cpp = 4;
       comp = 3; /* alpha channel */ /*XXX little-endian dependency */
    }
@@ -1013,8 +1010,8 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
    /**
     * Create a texture.
     */
-   pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, internal_format,
-                         0, 0, width, height, 1, 0);
+   pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, 0, 0, width, height,
+                         1, 0);
    if (!pt)
       return NULL;
 
@@ -1237,8 +1234,8 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
    psRead = rbRead->surface;
    format = psRead->format;
 
-   pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format,
-                         rbRead->Base.InternalFormat, 0, 0, width, height, 1, 0);
+   pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, 0, 0, width, height,
+                         1, 0);
    if (!pt)
       return;
 
index 39dd21dc590e74dca42ecd96c05d8489703d6c07..e813bdb47afc5ae5d177d55877723b2b7b3b5710 100644 (file)
@@ -366,7 +366,6 @@ guess_and_alloc_texture(struct st_context *st,
    stObj->pt = st_texture_create(st,
                                  gl_target_to_pipe(stObj->base.Target),
                                  st_mesa_format_to_pipe_format(stImage->base.TexFormat->MesaFormat),
-                                stImage->base.InternalFormat,
                                  firstLevel,
                                  lastLevel,
                                  width,
@@ -1481,7 +1480,8 @@ st_finalize_texture(GLcontext *ctx,
     */
    if (stObj->pt &&
        (stObj->pt->target != gl_target_to_pipe(stObj->base.Target) ||
-       stObj->pt->internal_format != firstImage->base.InternalFormat ||
+       stObj->pt->format !=
+       st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat) ||
        stObj->pt->first_level != stObj->firstLevel ||
        stObj->pt->last_level != stObj->lastLevel ||
        stObj->pt->width[0] != firstImage->base.Width ||
@@ -1499,7 +1499,6 @@ st_finalize_texture(GLcontext *ctx,
       stObj->pt = st_texture_create(ctx->st,
                                     gl_target_to_pipe(stObj->base.Target),
                                     st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat),
-                                   firstImage->base.InternalFormat,
                                     stObj->firstLevel,
                                     stObj->lastLevel,
                                     firstImage->base.Width,
index 1ec451487367a7a8878d9cee63e28d3502e4ded0..c7d28eeca20bc6349f249f8203b5064bf5d7bf6f 100644 (file)
@@ -63,7 +63,6 @@ struct pipe_texture *
 st_texture_create(struct st_context *st,
                   unsigned target,
                  unsigned format,
-                 GLenum internal_format,
                  GLuint first_level,
                  GLuint last_level,
                  GLuint width0,
@@ -77,7 +76,7 @@ st_texture_create(struct st_context *st,
 
    DBG("%s target %s format %s level %d..%d\n", __FUNCTION__,
        _mesa_lookup_enum_by_nr(target),
-       _mesa_lookup_enum_by_nr(internal_format), first_level, last_level);
+       _mesa_lookup_enum_by_nr(format), first_level, last_level);
 
    if (!pt)
       return NULL;
@@ -86,7 +85,6 @@ st_texture_create(struct st_context *st,
 
    pt->target = target;
    pt->format = format;
-   pt->internal_format = internal_format;
    pt->first_level = first_level;
    pt->last_level = last_level;
    pt->width[0] = width0;
@@ -119,7 +117,7 @@ st_texture_match_image(struct pipe_texture *pt,
    if (image->Border) 
       return GL_FALSE;
 
-   if (image->InternalFormat != pt->internal_format ||
+   if (st_mesa_format_to_pipe_format(image->TexFormat->MesaFormat) != pt->format ||
        image->IsCompressed != pt->compressed)
       return GL_FALSE;
 
index 2be53abf3ae0b921eccc1df9d6a44b7eb16be318..7524c219e06e0633601e1e7c5d0a363cba839fd1 100644 (file)
@@ -39,7 +39,6 @@ extern struct pipe_texture *
 st_texture_create(struct st_context *st,
                   unsigned target,
                  unsigned format,
-                  GLenum internal_format,
                   GLuint first_level,
                   GLuint last_level,
                   GLuint width0,