Merge branch 'gallium-docs'
[mesa.git] / src / mesa / state_tracker / st_texture.c
index bd6ee5d71c6a506edc53593c8dcfc2e144a781ba..8a3e4cd3ac3d3807e6b67f0b83ee5e3c7d14e720 100644 (file)
@@ -105,7 +105,6 @@ st_texture_create(struct st_context *st,
    pt.width0 = width0;
    pt.height0 = height0;
    pt.depth0 = depth0;
-   util_format_get_block(format, &pt.block);
    pt.tex_usage = usage;
 
    newtex = screen->texture_create(screen, &pt);
@@ -243,8 +242,9 @@ st_surface_data(struct pipe_context *pipe,
    struct pipe_screen *screen = pipe->screen;
    void *map = screen->transfer_map(screen, dst);
 
+   assert(dst->texture);
    util_copy_rect(map,
-                  &dst->block,
+                  dst->texture->format,
                   dst->stride,
                   dstx, dsty, 
                   width, height, 
@@ -406,7 +406,7 @@ st_bind_texture_surface(struct pipe_surface *ps, int target, int level,
    }
 
    /* map pipe format to base format for now */
-   if (pf_get_component_bits(format, PIPE_FORMAT_COMP_A) > 0)
+   if (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 3) > 0)
       internalFormat = GL_RGBA;
    else
       internalFormat = GL_RGB;