i965/vec4: Add the ability for attributes to be interleaved.
[mesa.git] / src / mesa / swrast / s_copypix.c
index cf419c328d65e570b0a351e2c54917c713e367dc..d001734766c2634ca79bb78432a0ce8a4536cc52 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  7.1
  *
  * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
@@ -136,10 +136,10 @@ copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
    INIT_SPAN(span, GL_BITMAP);
    _swrast_span_default_attribs(ctx, &span);
    span.arrayMask = SPAN_RGBA;
-   span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */
+   span.arrayAttribs = VARYING_BIT_COL0; /* we'll fill in COL0 attrib values */
 
    if (overlapping) {
-      tmpImage = (GLfloat *) malloc(width * height * sizeof(GLfloat) * 4);
+      tmpImage = malloc(width * height * sizeof(GLfloat) * 4);
       if (!tmpImage) {
          _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
          return;
@@ -161,7 +161,7 @@ copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
    ASSERT(width < SWRAST_MAX_WIDTH);
 
    for (row = 0; row < height; row++, sy += stepy, dy += stepy) {
-      GLvoid *rgba = span.array->attribs[FRAG_ATTRIB_COL0];
+      GLvoid *rgba = span.array->attribs[VARYING_SLOT_COL0];
 
       /* Get row/span of source pixels */
       if (overlapping) {
@@ -286,7 +286,7 @@ copy_depth_pixels( struct gl_context *ctx, GLint srcx, GLint srcy,
 
    if (overlapping) {
       GLint ssy = sy;
-      tmpImage = (GLfloat *) malloc(width * height * sizeof(GLfloat));
+      tmpImage = malloc(width * height * sizeof(GLfloat));
       if (!tmpImage) {
          _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
          return;
@@ -303,7 +303,7 @@ copy_depth_pixels( struct gl_context *ctx, GLint srcx, GLint srcy,
       p = NULL;
    }
 
-   depth = (GLfloat *) malloc(width * sizeof(GLfloat));
+   depth = malloc(width * sizeof(GLfloat));
    if (!depth) {
       _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels()");
       goto end;
@@ -383,7 +383,7 @@ copy_stencil_pixels( struct gl_context *ctx, GLint srcx, GLint srcy,
 
    if (overlapping) {
       GLint ssy = sy;
-      tmpImage = (GLubyte *) malloc(width * height * sizeof(GLubyte));
+      tmpImage = malloc(width * height * sizeof(GLubyte));
       if (!tmpImage) {
          _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
          return;
@@ -400,7 +400,7 @@ copy_stencil_pixels( struct gl_context *ctx, GLint srcx, GLint srcy,
       p = NULL;
    }
 
-   stencil = (GLubyte *) malloc(width * sizeof(GLubyte));
+   stencil = malloc(width * sizeof(GLubyte));
    if (!stencil) {
       _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels()");
       goto end;