From 70c4b81e88e18e354e8dfaf47e5455e463b207d8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 21 May 2009 21:49:57 -0600 Subject: mesa: add missing glGet*() case for GL_VERTEX_ARRAY_BINDING_APPLE --- src/mesa/main/get.c | 12 ++++++++++++ src/mesa/main/get_gen.py | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 0937fd053c..1ed6fc3383 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1867,6 +1867,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) CHECK_EXT1(ARB_framebuffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Const.MaxSamples); break; + case GL_VERTEX_ARRAY_BINDING_APPLE: + CHECK_EXT1(APPLE_vertex_array_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Name); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname); } @@ -3677,6 +3681,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) CHECK_EXT1(ARB_framebuffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Const.MaxSamples); break; + case GL_VERTEX_ARRAY_BINDING_APPLE: + CHECK_EXT1(APPLE_vertex_array_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Array.ArrayObj->Name); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname); } @@ -5487,6 +5495,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) CHECK_EXT1(ARB_framebuffer_object, "GetIntegerv"); params[0] = ctx->Const.MaxSamples; break; + case GL_VERTEX_ARRAY_BINDING_APPLE: + CHECK_EXT1(APPLE_vertex_array_object, "GetIntegerv"); + params[0] = ctx->Array.ArrayObj->Name; + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname); } diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index fa695c48f1..00dcb19335 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -1003,7 +1003,10 @@ StateVars = [ # GL_ARB_framebuffer_object ( "GL_MAX_SAMPLES", GLint, ["ctx->Const.MaxSamples"], "", - ["ARB_framebuffer_object"] ) + ["ARB_framebuffer_object"] ), + + ( "GL_VERTEX_ARRAY_BINDING_APPLE", GLint, ["ctx->Array.ArrayObj->Name"], "", + ["APPLE_vertex_array_object"] ), ] -- cgit v1.2.3 From 42b747e57d4487ee4f0049ab6835b56f22890e97 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 May 2009 07:14:16 -0600 Subject: mesa: added comment --- src/mesa/main/get_gen.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 00dcb19335..43ee5fff10 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -1005,6 +1005,7 @@ StateVars = [ ( "GL_MAX_SAMPLES", GLint, ["ctx->Const.MaxSamples"], "", ["ARB_framebuffer_object"] ), + # GL_APPLE_vertex_array_object ( "GL_VERTEX_ARRAY_BINDING_APPLE", GLint, ["ctx->Array.ArrayObj->Name"], "", ["APPLE_vertex_array_object"] ), ] -- cgit v1.2.3 From 995456f9305593005f8466520314ee087f3d422a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 May 2009 09:35:02 -0600 Subject: mesa: allow GL_BITMAP type in _mesa_image_image_stride() It's possible to hand a GL_COLOR_INDEX/GL_BITMAP image to glTexImage3D() which gets converted to RGBA via the glPixelMap tables. This fixes a failure with piglit/fdo10370 with Gallium. --- src/mesa/main/image.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index ddae456fa1..332febf91f 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -755,12 +756,20 @@ _mesa_image_image_stride( const struct gl_pixelstore_attrib *packing, GLint width, GLint height, GLenum format, GLenum type ) { + GLint bytesPerRow, bytesPerImage, remainder; + ASSERT(packing); - ASSERT(type != GL_BITMAP); - { + if (type == GL_BITMAP) { + if (packing->RowLength == 0) { + bytesPerRow = (width + 7) / 8; + } + else { + bytesPerRow = (packing->RowLength + 7) / 8; + } + } + else { const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type); - GLint bytesPerRow, bytesPerImage, remainder; if (bytesPerPixel <= 0) return -1; /* error */ @@ -770,17 +779,18 @@ _mesa_image_image_stride( const struct gl_pixelstore_attrib *packing, else { bytesPerRow = bytesPerPixel * packing->RowLength; } - remainder = bytesPerRow % packing->Alignment; - if (remainder > 0) - bytesPerRow += (packing->Alignment - remainder); + } - if (packing->ImageHeight == 0) - bytesPerImage = bytesPerRow * height; - else - bytesPerImage = bytesPerRow * packing->ImageHeight; + remainder = bytesPerRow % packing->Alignment; + if (remainder > 0) + bytesPerRow += (packing->Alignment - remainder); - return bytesPerImage; - } + if (packing->ImageHeight == 0) + bytesPerImage = bytesPerRow * height; + else + bytesPerImage = bytesPerRow * packing->ImageHeight; + + return bytesPerImage; } -- cgit v1.2.3