summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Cristau <[email protected]>2007-08-09 11:25:42 +0200
committerJulien Cristau <[email protected]>2007-08-09 11:25:42 +0200
commit43e6260ed061f915b2c631643c2a303015f2f044 (patch)
treeb34d680b6850bafeabc57a688413cb8bbee34c32
parentc6728df4a3d8d5bc04626e57f6c0ec40d60ab1c7 (diff)
parentae16a51e95f8d0e4e354f28885c13a3bbe66b270 (diff)
Merge tag 'mesa_7_0_1' into debian-experimental
-rw-r--r--Makefile12
-rw-r--r--configs/bluegene-osmesa29
-rw-r--r--configs/config.mgw42
-rw-r--r--configs/freebsd2
-rw-r--r--configs/freebsd-dri2
-rw-r--r--configs/sunos5-v9-cc-g++32
-rw-r--r--docs/download.html2
-rw-r--r--docs/news.html7
-rw-r--r--docs/relnotes-7.0.1.html6
-rw-r--r--include/GL/internal/dri_interface.h12
-rw-r--r--src/glu/sgi/libnurbs/interface/bezierPatch.cc7
-rw-r--r--src/glu/sgi/libnurbs/interface/insurfeval.cc4
-rw-r--r--src/glu/sgi/libutil/error.c2
-rw-r--r--src/glut/glx/glut_dstr.c1
-rw-r--r--src/glut/glx/glut_event.c2
-rw-r--r--src/mesa/drivers/dri/common/dri_drmpool.c1
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c3
-rw-r--r--src/mesa/drivers/dri/common/dri_util.h6
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_reg.h1
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_texstate.c41
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_vtbl.c12
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_texstate.c49
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_vtbl.c6
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_context.h4
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_screen.c3
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex.h3
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_image.c24
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h2
-rw-r--r--src/mesa/drivers/dri/r300/r300_tex.h4
-rw-r--r--src/mesa/drivers/dri/r300/r300_texmem.c3
-rw-r--r--src/mesa/drivers/dri/r300/r300_texstate.c73
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c4
-rw-r--r--src/mesa/drivers/dri/sis/sis_tex.c4
-rw-r--r--src/mesa/main/dlist.c24
-rw-r--r--src/mesa/main/image.c27
-rw-r--r--src/mesa/main/points.c11
-rw-r--r--src/mesa/shader/slang/slang_codegen.c3
-rw-r--r--src/mesa/shader/slang/slang_link.c4
38 files changed, 342 insertions, 132 deletions
diff --git a/Makefile b/Makefile
index bdb62ae6d4f..3cab262bf44 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
# Top-level Mesa makefile
+SHELL = /bin/bash
+
TOP = .
SUBDIRS = src progs
@@ -67,6 +69,7 @@ aix-64-static \
aix-gcc \
aix-static \
beos \
+bluegene-osmesa \
darwin \
darwin-static \
darwin-static-x86ppc \
@@ -151,6 +154,7 @@ sunos5-v8 \
sunos5-v8-static \
sunos5-v9 \
sunos5-v9-static \
+sunos5-v9-cc-g++ \
ultrix-gcc:
@ if [ -e configs/current ] ; then \
echo "Please run 'make realclean' before changing configs" ; \
@@ -162,10 +166,10 @@ ultrix-gcc:
# Rules for making release tarballs
-DIRECTORY = Mesa-7.0.1-rc2
-LIB_NAME = MesaLib-7.0.1-rc2
-DEMO_NAME = MesaDemos-7.0.1-rc2
-GLUT_NAME = MesaGLUT-7.0.1-rc2
+DIRECTORY = Mesa-7.0.1
+LIB_NAME = MesaLib-7.0.1
+DEMO_NAME = MesaDemos-7.0.1
+GLUT_NAME = MesaGLUT-7.0.1
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
diff --git a/configs/bluegene-osmesa b/configs/bluegene-osmesa
new file mode 100644
index 00000000000..02c69e6c67e
--- /dev/null
+++ b/configs/bluegene-osmesa
@@ -0,0 +1,29 @@
+# Configuration for building only libOSMesa on BlueGene, no Xlib driver
+# This doesn't really have a lot of dependencies, so it should be usable
+# on other (gcc-based) systems too.
+# It uses static linking and disables multithreading.
+
+include $(TOP)/configs/default
+
+CONFIG_NAME = bluegene-osmesa
+
+# Compiler and flags
+CC = /bgl/BlueLight/ppcfloor/blrts-gnu/bin/powerpc-bgl-blrts-gnu-gcc
+CXX = /bgl/BlueLight/ppcfloor/blrts-gnu/bin/powerpc-bgl-blrts-gnu-g++
+CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
+CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURC
+
+MKLIB_OPTIONS = -static
+
+OSMESA_LIB_NAME = libOSMesa.a
+
+# Directories
+SRC_DIRS = mesa glu
+DRIVER_DIRS = osmesa
+PROGRAM_DIRS = osdemos
+
+
+# Dependencies
+OSMESA_LIB_DEPS = -lm
+GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
+APP_LIB_DEPS = -lOSMesa -lGLU -lm
diff --git a/configs/config.mgw b/configs/config.mgw
deleted file mode 100644
index b961eb965cb..00000000000
--- a/configs/config.mgw
+++ /dev/null
@@ -1,42 +0,0 @@
-# MinGW config include file updated for Mesa 7.0
-#
-# Updated : by Heromyth, on 2007-7-21
-# Email : [email protected]
-# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
-# The others havn't been tested yet.
-# 2) The generated DLLs are *not* compatible with the ones built
-# with the other compilers like VC8, especially for GLUT.
-# 3) Although more tests are needed, it can be used individually!
-
-# The generated DLLs by MingW with STDCALL are not totally compatible
-# with the ones linked by Microsoft's compilers.
-#
-# xxx_USING_STDCALL = 1 Compiling MESA with __stdcall. This is default!
-#
-# xxx_USING_STDCALL = 0 Compiling MESA without __stdcall. I like this:)
-#
-
-# In fact, GL_USING_STDCALL and GLUT_USING_STDCALL can be
-# different. For example:
-#
-# GL_USING_STDCALL = 0
-# GLUT_USING_STDCALL = 1
-#
-# Suggested setting:
-#
-# ALL_USING_STDCALL = 1
-#
-# That's default!
-#
-
-
-ALL_USING_STDCALL = 1
-
-
-ifeq ($(ALL_USING_STDCALL),1)
- GL_USING_STDCALL = 1
- GLUT_USING_STDCALL = 1
-else
- GL_USING_STDCALL = 0
- GLUT_USING_STDCALL = 0
-endif
diff --git a/configs/freebsd b/configs/freebsd
index db7dd3b78a0..447faf9f4cf 100644
--- a/configs/freebsd
+++ b/configs/freebsd
@@ -13,7 +13,7 @@ OPT_FLAGS = -O2
PIC_FLAGS = -fPIC
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DUSE_XSHM \
- -DHZ=100 -DHAVE_POSIX_MEMALIGN
+ -DHZ=100
X11_INCLUDES = -I/usr/X11R6/include
diff --git a/configs/freebsd-dri b/configs/freebsd-dri
index 402883d1de0..5a9310a04ed 100644
--- a/configs/freebsd-dri
+++ b/configs/freebsd-dri
@@ -15,7 +15,7 @@ EXPAT_INCLUDES = -I/usr/local/include
X11_INCLUDES = -I/usr/X11R6/include
DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
- -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
+ -DHAVE_ALIAS
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) -Wmissing-prototypes -std=c99 -Wundef -ffast-math \
$(ASM_FLAGS) $(X11_INCLUDES) $(DEFINES)
diff --git a/configs/sunos5-v9-cc-g++ b/configs/sunos5-v9-cc-g++
new file mode 100644
index 00000000000..37b775cc08e
--- /dev/null
+++ b/configs/sunos5-v9-cc-g++
@@ -0,0 +1,32 @@
+# Configuration for SunOS 5, SPARC V9 and cc/g++ (for C and C++ sources)
+
+include $(TOP)/configs/default
+
+CONFIG_NAME = sunos5-v9-cc-g++
+
+MKLIB_OPTIONS = -cplusplus
+
+LIB_DIR = lib64
+
+# Compiler and flags
+CC = cc
+CXX = g++
+
+CXX_WARN_FLAGS = -Wall
+CXX_PIC_FLAGS = -fPIC
+CXX_OPT_FLAGS = -O3 -m64 -mcpu=ultrasparc -mv8plus -mvis -g -fomit-frame-pointer -pipe
+CXX_ARCH_FLAGS = -m64
+
+
+CXXFLAGS = $(CXX_WARN_FLAGS) $(CXX_OPT_FLAGS) $(CXX_PIC_FLAGS) $(CXX_ARCH_FLAGS) $(DEFINES) \
+ -I/usr/openwin/include
+
+CFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS
+#CXXFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS
+GLUT_CFLAGS = -DSOLARIS_2_4_BUG
+
+GL_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -lX11 -lXext -lXmu -lXi -lm -lpthread
+GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCstd -lCrun
+GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
+GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11
+APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
diff --git a/docs/download.html b/docs/download.html
index 90f566351e8..5c3989ef8c8 100644
--- a/docs/download.html
+++ b/docs/download.html
@@ -9,7 +9,7 @@
<H1>Downloading</H1>
<p>
-Last stable release: <b>7.0</b>
+Last stable release: <b>7.0.1</b>
</p>
<p>
diff --git a/docs/news.html b/docs/news.html
index 58aca318587..1f66d4e7cf1 100644
--- a/docs/news.html
+++ b/docs/news.html
@@ -11,6 +11,13 @@
<H1>News</H1>
+<h2>August 3, 2007</h2>
+<p>
+<a href="relnotes-7.0.html">Mesa 7.0.1</a> is released.
+This is a bug-fix release.
+</p>
+
+
<h2>June 22, 2007</h2>
<p>
<a href="relnotes-7.0.html">Mesa 7.0</a> is released.
diff --git a/docs/relnotes-7.0.1.html b/docs/relnotes-7.0.1.html
index 70899ff9da7..47ee162ec28 100644
--- a/docs/relnotes-7.0.1.html
+++ b/docs/relnotes-7.0.1.html
@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
-<H1>Mesa 7.0.1 Release Notes / July ??, 2007</H1>
+<H1>Mesa 7.0.1 Release Notes / August 3, 2007</H1>
<p>
Mesa 7.0.1 is a stable release with bug fixes since version 7.0.
@@ -22,6 +22,7 @@ Mesa 7.0.1 is a stable release with bug fixes since version 7.0.
<h2>New features</h2>
<ul>
+<li>Added a bluegene-osmesa build config
</ul>
<h2>Bug fixes</h2>
@@ -45,6 +46,9 @@ Mesa 7.0.1 is a stable release with bug fixes since version 7.0.
the terminating zero (bug 11588)
<li>glXChooseFBConfig() in Xlib driver didn't handle GLX_STEREO flag properly
<li>Fixed a GLSL function call bug (#11731)
+<li>glPointParameteriv(GL_DISTANCE_ATTENUATION_EXT) didn't work (bug 11754)
+<li>glGetAttribLocation() always returned 1 (bug 11774)
+<li>Fixed a few memory-related bugs in GLU library
</ul>
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index a3de2c6aab3..8d24e311f84 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -361,6 +361,18 @@ struct __DRIscreenRec {
void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
int render_type,
void *sharedPrivate, __DRIcontext *pctx);
+
+ /**
+ * Method to override base texture image with a driver specific 'offset'.
+ * The depth passed in allows e.g. to ignore the alpha channel of texture
+ * images where the non-alpha components don't occupy a whole texel.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ *
+ * \since Internal API version 20070121.
+ */
+ void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
+ unsigned long long offset, GLint depth, GLuint pitch);
};
/**
diff --git a/src/glu/sgi/libnurbs/interface/bezierPatch.cc b/src/glu/sgi/libnurbs/interface/bezierPatch.cc
index 836ae94e0a6..5b7bda1a001 100644
--- a/src/glu/sgi/libnurbs/interface/bezierPatch.cc
+++ b/src/glu/sgi/libnurbs/interface/bezierPatch.cc
@@ -111,8 +111,11 @@ void bezierPatchDelete(bezierPatch *b)
void bezierPatchDeleteList(bezierPatch *b)
{
bezierPatch *temp;
- for(temp = b; temp != NULL; temp = temp->next)
- bezierPatchDelete(temp);
+ while (b != NULL) {
+ temp = b;
+ b = b->next;
+ bezierPatchDelete(temp);
+ }
}
bezierPatch* bezierPatchInsert(bezierPatch *list, bezierPatch *b)
diff --git a/src/glu/sgi/libnurbs/interface/insurfeval.cc b/src/glu/sgi/libnurbs/interface/insurfeval.cc
index b314699c7af..e4ee3ef6a29 100644
--- a/src/glu/sgi/libnurbs/interface/insurfeval.cc
+++ b/src/glu/sgi/libnurbs/interface/insurfeval.cc
@@ -1533,8 +1533,8 @@ void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_va
}
//clean up
free(leftXYZ);
- free(leftXYZ);
- free(rightNormal);
+ free(rightXYZ);
+ free(leftNormal);
free(rightNormal);
}
diff --git a/src/glu/sgi/libutil/error.c b/src/glu/sgi/libutil/error.c
index 3d1ce9b2101..c2000569427 100644
--- a/src/glu/sgi/libutil/error.c
+++ b/src/glu/sgi/libutil/error.c
@@ -82,7 +82,7 @@ gluErrorString(GLenum errorCode)
if ((errorCode >= GLU_NURBS_ERROR1) && (errorCode <= GLU_NURBS_ERROR37)) {
return (const GLubyte *) __gluNURBSErrorString(errorCode - (GLU_NURBS_ERROR1 - 1));
}
- if ((errorCode >= GLU_TESS_ERROR1) && (errorCode <= GLU_TESS_ERROR8)) {
+ if ((errorCode >= GLU_TESS_ERROR1) && (errorCode <= GLU_TESS_ERROR6)) {
return (const GLubyte *) __gluTessErrorString(errorCode - (GLU_TESS_ERROR1 - 1));
}
return (const GLubyte *) 0;
diff --git a/src/glut/glx/glut_dstr.c b/src/glut/glx/glut_dstr.c
index ec9386f3e50..2513af45394 100644
--- a/src/glut/glx/glut_dstr.c
+++ b/src/glut/glx/glut_dstr.c
@@ -291,6 +291,7 @@ loadVisuals(int *nitems_return)
fbmodes = (FrameBufferMode *) malloc(n * sizeof(FrameBufferMode));
if (fbmodes == NULL) {
*nitems_return = -1;
+ free(vlist);
return NULL;
}
for (i = 0; i < n; i++) {
diff --git a/src/glut/glx/glut_event.c b/src/glut/glx/glut_event.c
index 4e67da674ed..0a96e8cf71d 100644
--- a/src/glut/glx/glut_event.c
+++ b/src/glut/glx/glut_event.c
@@ -24,7 +24,7 @@
# ifdef __sgi
# include <bstring.h> /* prototype for bzero used by FD_ZERO */
# endif
-# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE)
+# if (defined(__FreeBSD__) || defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE)
# include <sys/select.h> /* select system call interface */
# ifdef luna
# include <sysent.h>
diff --git a/src/mesa/drivers/dri/common/dri_drmpool.c b/src/mesa/drivers/dri/common/dri_drmpool.c
index 878a148b397..592ac105428 100644
--- a/src/mesa/drivers/dri/common/dri_drmpool.c
+++ b/src/mesa/drivers/dri/common/dri_drmpool.c
@@ -51,6 +51,7 @@ pool_create(struct _DriBufferPool *pool,
return NULL;
if ((alignment > pageSize) && (alignment % pageSize)) {
+ free(buf);
return NULL;
}
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 25d32894dc8..c30e66f1722 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -997,6 +997,9 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
psc->getMSC = driGetMSC;
psc->createNewContext = driCreateNewContext;
+ if (internal_api_version >= 20070121)
+ psc->setTexOffset = psp->DriverAPI.setTexOffset;
+
if ( (psp->DriverAPI.InitDriver != NULL)
&& !(*psp->DriverAPI.InitDriver)(psp) ) {
_mesa_free( psp );
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index 8639535abb2..539d28d1149 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -189,6 +189,12 @@ struct __DriverAPIRec {
/*@}*/
void (*CopySubBuffer)(__DRIdrawablePrivate *driDrawPriv,
int x, int y, int w, int h);
+
+ /**
+ * See corresponding field in \c __DRIscreenRec.
+ */
+ void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
+ unsigned long long offset, GLint depth, GLuint pitch);
};
diff --git a/src/mesa/drivers/dri/i915tex/i830_reg.h b/src/mesa/drivers/dri/i915tex/i830_reg.h
index 24ac5245005..41280bca7ce 100644
--- a/src/mesa/drivers/dri/i915tex/i830_reg.h
+++ b/src/mesa/drivers/dri/i915tex/i830_reg.h
@@ -575,6 +575,7 @@
#define MT_16BIT_DIB_RGB565_8888 (7<<3)
#define MT_32BIT_ARGB8888 (0<<3) /* SURFACE_32BIT */
#define MT_32BIT_ABGR8888 (1<<3)
+#define MT_32BIT_XRGB8888 (2<<3) /* XXX: Guess from i915_reg.h */
#define MT_32BIT_BUMP_XLDVDU_8888 (6<<3)
#define MT_32BIT_DIB_8888 (7<<3)
#define MT_411_YUV411 (0<<3) /* SURFACE_411 */
diff --git a/src/mesa/drivers/dri/i915tex/i830_texstate.c b/src/mesa/drivers/dri/i915tex/i830_texstate.c
index e3f34e3944a..0d3f053226f 100644
--- a/src/mesa/drivers/dri/i915tex/i830_texstate.c
+++ b/src/mesa/drivers/dri/i915tex/i830_texstate.c
@@ -117,7 +117,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
struct intel_texture_object *intelObj = intel_texture_object(tObj);
struct gl_texture_image *firstImage;
- GLuint *state = i830->state.Tex[unit];
+ GLuint *state = i830->state.Tex[unit], format, pitch;
memset(state, 0, sizeof(state));
@@ -128,7 +128,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
i830->state.tex_buffer[unit] = NULL;
}
- if (!intel_finalize_mipmap_tree(intel, unit))
+ if (!intelObj->imageOverride && !intel_finalize_mipmap_tree(intel, unit))
return GL_FALSE;
/* Get first image here, since intelObj->firstLevel will get set in
@@ -136,11 +136,34 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
*/
firstImage = tObj->Image[0][intelObj->firstLevel];
- i830->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->buffer);
- i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0,
- intelObj->
- firstLevel);
+ if (intelObj->imageOverride) {
+ i830->state.tex_buffer[unit] = NULL;
+ i830->state.tex_offset[unit] = intelObj->textureOffset;
+ switch (intelObj->depthOverride) {
+ case 32:
+ format = MAPSURF_32BIT | MT_32BIT_ARGB8888;
+ break;
+ case 24:
+ default:
+ format = MAPSURF_32BIT | MT_32BIT_XRGB8888;
+ break;
+ case 16:
+ format = MAPSURF_16BIT | MT_16BIT_RGB565;
+ break;
+ }
+
+ pitch = intelObj->pitchOverride;
+ } else {
+ i830->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->
+ buffer);
+ i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt,
+ 0, intelObj->
+ firstLevel);
+
+ format = translate_texture_format(firstImage->TexFormat->MesaFormat);
+ pitch = intelObj->mt->pitch * intelObj->mt->cpp;
+ }
state[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 |
(LOAD_TEXTURE_MAP0 << unit) | 4);
@@ -151,12 +174,10 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
state[I830_TEXREG_TM0S1] =
(((firstImage->Height - 1) << TM0S1_HEIGHT_SHIFT) |
- ((firstImage->Width - 1) << TM0S1_WIDTH_SHIFT) |
- translate_texture_format(firstImage->TexFormat->MesaFormat));
+ ((firstImage->Width - 1) << TM0S1_WIDTH_SHIFT) | format);
state[I830_TEXREG_TM0S2] =
- (((((intelObj->mt->pitch * intelObj->mt->cpp) / 4) -
- 1) << TM0S2_PITCH_SHIFT) | TM0S2_CUBE_FACE_ENA_MASK);
+ ((((pitch / 4) - 1) << TM0S2_PITCH_SHIFT) | TM0S2_CUBE_FACE_ENA_MASK);
{
if (tObj->Target == GL_TEXTURE_CUBE_MAP)
diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
index dd0670dec37..e432648ada0 100644
--- a/src/mesa/drivers/dri/i915tex/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
@@ -490,11 +490,13 @@ i830_emit_state(struct intel_context *intel)
DRM_BO_MASK_MEM | DRM_BO_FLAG_READ,
state->tex_offset[i] | TM0S0_USE_FENCE);
}
- else {
- assert(i == 0);
- assert(state == &i830->meta);
- OUT_BATCH(0);
- }
+ else if (state == &i830->meta) {
+ assert(i == 0);
+ OUT_BATCH(0);
+ }
+ else {
+ OUT_BATCH(state->tex_offset[i]);
+ }
OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S1]);
OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S2]);
diff --git a/src/mesa/drivers/dri/i915tex/i915_texstate.c b/src/mesa/drivers/dri/i915tex/i915_texstate.c
index e0ecdfde24a..3d68187cf88 100644
--- a/src/mesa/drivers/dri/i915tex/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915tex/i915_texstate.c
@@ -122,7 +122,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
struct intel_texture_object *intelObj = intel_texture_object(tObj);
struct gl_texture_image *firstImage;
- GLuint *state = i915->state.Tex[unit];
+ GLuint *state = i915->state.Tex[unit], format, pitch;
memset(state, 0, sizeof(state));
@@ -133,7 +133,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
i915->state.tex_buffer[unit] = NULL;
}
- if (!intel_finalize_mipmap_tree(intel, unit))
+ if (!intelObj->imageOverride && !intel_finalize_mipmap_tree(intel, unit))
return GL_FALSE;
/* Get first image here, since intelObj->firstLevel will get set in
@@ -141,24 +141,45 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
*/
firstImage = tObj->Image[0][intelObj->firstLevel];
- i915->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->buffer);
- i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0,
- intelObj->
- firstLevel);
+ if (intelObj->imageOverride) {
+ i915->state.tex_buffer[unit] = NULL;
+ i915->state.tex_offset[unit] = intelObj->textureOffset;
+
+ switch (intelObj->depthOverride) {
+ case 32:
+ format = MAPSURF_32BIT | MT_32BIT_ARGB8888;
+ break;
+ case 24:
+ default:
+ format = MAPSURF_32BIT | MT_32BIT_XRGB8888;
+ break;
+ case 16:
+ format = MAPSURF_16BIT | MT_16BIT_RGB565;
+ break;
+ }
+
+ pitch = intelObj->pitchOverride;
+ } else {
+ i915->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->
+ buffer);
+ i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt,
+ 0, intelObj->
+ firstLevel);
+
+ format = translate_texture_format(firstImage->TexFormat->MesaFormat);
+ pitch = intelObj->mt->pitch * intelObj->mt->cpp;
+ }
state[I915_TEXREG_MS3] =
(((firstImage->Height - 1) << MS3_HEIGHT_SHIFT) |
- ((firstImage->Width - 1) << MS3_WIDTH_SHIFT) |
- translate_texture_format(firstImage->TexFormat->MesaFormat) |
+ ((firstImage->Width - 1) << MS3_WIDTH_SHIFT) | format |
MS3_USE_FENCE_REGS);
state[I915_TEXREG_MS4] =
- (((((intelObj->mt->pitch * intelObj->mt->cpp) / 4) -
- 1) << MS4_PITCH_SHIFT) | MS4_CUBE_FACE_ENA_MASK |
- ((((intelObj->lastLevel -
- intelObj->firstLevel) *
- 4)) << MS4_MAX_LOD_SHIFT) | ((firstImage->Depth -
- 1) << MS4_VOLUME_DEPTH_SHIFT));
+ ((((pitch / 4) - 1) << MS4_PITCH_SHIFT) | MS4_CUBE_FACE_ENA_MASK |
+ ((((intelObj->lastLevel - intelObj->firstLevel) * 4)) <<
+ MS4_MAX_LOD_SHIFT) | ((firstImage->Depth - 1) <<
+ MS4_VOLUME_DEPTH_SHIFT));
{
diff --git a/src/mesa/drivers/dri/i915tex/i915_vtbl.c b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
index 264cf0fd9f4..ad333b490b7 100644
--- a/src/mesa/drivers/dri/i915tex/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
@@ -382,11 +382,13 @@ i915_emit_state(struct intel_context *intel)
DRM_BO_MASK_MEM | DRM_BO_FLAG_READ,
state->tex_offset[i]);
}
- else {
+ else if (state == &i915->meta) {
assert(i == 0);
- assert(state == &i915->meta);
OUT_BATCH(0);
}
+ else {
+ OUT_BATCH(state->tex_offset[i]);
+ }
OUT_BATCH(state->Tex[i][I915_TEXREG_MS3]);
OUT_BATCH(state->Tex[i][I915_TEXREG_MS4]);
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h
index 44c20af7f80..bcbbb127b12 100644
--- a/src/mesa/drivers/dri/i915tex/intel_context.h
+++ b/src/mesa/drivers/dri/i915tex/intel_context.h
@@ -92,6 +92,10 @@ struct intel_texture_object
* regions will be copied to this region and the old storage freed.
*/
struct intel_mipmap_tree *mt;
+
+ GLboolean imageOverride;
+ GLint depthOverride;
+ GLuint pitchOverride;
};
diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.c b/src/mesa/drivers/dri/i915tex/intel_screen.c
index dd01161b5bb..5e6df81950b 100644
--- a/src/mesa/drivers/dri/i915tex/intel_screen.c
+++ b/src/mesa/drivers/dri/i915tex/intel_screen.c
@@ -776,7 +776,8 @@ static const struct __DriverAPIRec intelAPI = {
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL,
- .CopySubBuffer = intelCopySubBuffer
+ .CopySubBuffer = intelCopySubBuffer,
+ .setTexOffset = intelSetTexOffset,
};
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex.h b/src/mesa/drivers/dri/i915tex/intel_tex.h
index 6e9938fe534..b77d7a1d8af 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex.h
+++ b/src/mesa/drivers/dri/i915tex/intel_tex.h
@@ -135,6 +135,9 @@ void intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
const struct gl_texture_object *texObj,
const struct gl_texture_image *texImage);
+void intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
+ unsigned long long offset, GLint depth, GLuint pitch);
+
GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit);
void intel_tex_map_images(struct intel_context *intel,
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_image.c b/src/mesa/drivers/dri/i915tex/intel_tex_image.c
index 42679ef9db7..f790b1e6f73 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_image.c
@@ -385,7 +385,6 @@ intelTexImage(GLcontext * ctx,
}
}
-
assert(!intelImage->mt);
if (intelObj->mt &&
@@ -667,3 +666,26 @@ intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
texObj, texImage, 1);
}
+
+void
+intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
+ unsigned long long offset, GLint depth, GLuint pitch)
+{
+ 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);
+
+ if (!intelObj)
+ return;
+
+ if (intelObj->mt)
+ intel_miptree_release(intel, &intelObj->mt);
+
+ intelObj->imageOverride = GL_TRUE;
+ intelObj->depthOverride = depth;
+ intelObj->pitchOverride = pitch;
+
+ if (offset)
+ intelObj->textureOffset = offset;
+}
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index 13b943f75fc..41498678331 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -191,6 +191,8 @@ struct r300_tex_obj {
drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS];
/* Six, for the cube faces */
+ GLboolean image_override; /* Image overridden by GLX_EXT_tfp */
+
GLuint pitch; /* this isn't sent to hardware just used in calculations */
/* hardware register values */
/* Note that R200 has 8 registers per texture and R300 only 7 */
diff --git a/src/mesa/drivers/dri/r300/r300_tex.h b/src/mesa/drivers/dri/r300/r300_tex.h
index 74fa08e97d9..f67a8e6ba65 100644
--- a/src/mesa/drivers/dri/r300/r300_tex.h
+++ b/src/mesa/drivers/dri/r300/r300_tex.h
@@ -35,6 +35,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __r300_TEX_H__
#define __r300_TEX_H__
+extern void r300SetTexOffset(__DRIcontext *pDRICtx, GLint texname,
+ unsigned long long offset, GLint depth,
+ GLuint pitch);
+
extern void r300UpdateTextureState(GLcontext * ctx);
extern int r300UploadTexImages(r300ContextPtr rmesa, r300TexObjPtr t,
diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c
index 60e7dc967b1..e2e8355d275 100644
--- a/src/mesa/drivers/dri/r300/r300_texmem.c
+++ b/src/mesa/drivers/dri/r300/r300_texmem.c
@@ -508,6 +508,9 @@ int r300UploadTexImages(r300ContextPtr rmesa, r300TexObjPtr t, GLuint face)
{
const int numLevels = t->base.lastLevel - t->base.firstLevel + 1;
+ if (t->image_override)
+ return 0;
+
if (RADEON_DEBUG & (DEBUG_TEXTURE | DEBUG_IOCTL)) {
fprintf(stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__,
(void *)rmesa->radeon.glCtx, (void *)t->base.tObj,
diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c
index 705502ebf2b..8203189b7f4 100644
--- a/src/mesa/drivers/dri/r300/r300_texstate.c
+++ b/src/mesa/drivers/dri/r300/r300_texstate.c
@@ -40,6 +40,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "context.h"
#include "macros.h"
#include "texformat.h"
+#include "teximage.h"
+#include "texobj.h"
#include "enums.h"
#include "r300_context.h"
@@ -66,7 +68,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* identically. -- paulus
*/
-static const struct {
+static const struct tx_table {
GLuint format, filter, flag;
} tx_table_be[] = {
/* *INDENT-OFF* */
@@ -109,15 +111,13 @@ static const struct {
/* *INDENT-ON* */
};
-static const struct {
- GLuint format, filter, flag;
-} tx_table_le[] = {
+static const struct tx_table tx_table_le[] = {
/* *INDENT-OFF* */
_ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)),
_ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)),
_ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)),
_ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)),
- _ASSIGN(RGB888, 0xffffffff),
+ _ASSIGN(RGB888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)),
_ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)),
_ASSIGN(RGB565_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)),
_ASSIGN(ARGB4444, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)),
@@ -178,7 +178,7 @@ static void r300SetTexImages(r300ContextPtr rmesa,
/* Set the hardware texture format
*/
- if (VALID_FORMAT(baseImage->TexFormat->MesaFormat)) {
+ if (!t->image_override && VALID_FORMAT(baseImage->TexFormat->MesaFormat)) {
if (_mesa_little_endian()) {
t->format =
tx_table_le[baseImage->TexFormat->MesaFormat].
@@ -194,7 +194,7 @@ static void r300SetTexImages(r300ContextPtr rmesa,
tx_table_be[baseImage->TexFormat->MesaFormat].
filter;
}
- } else {
+ } else if (!t->image_override) {
_mesa_problem(NULL, "unexpected texture format in %s",
__FUNCTION__);
return;
@@ -382,9 +382,10 @@ static void r300SetTexImages(r300ContextPtr rmesa,
t->pitch = ((tObj->Image[0][t->base.firstLevel]->Width *
texelBytes) + 63) & ~(63);
t->size |= R300_TX_SIZE_TXPITCH_EN;
- t->pitch_reg =
- (((tObj->Image[0][t->base.firstLevel]->Width) +
- align) & ~align) - 1;
+ if (!t->image_override)
+ t->pitch_reg =
+ (((tObj->Image[0][t->base.firstLevel]->Width) +
+ align) & ~align) - 1;
} else {
t->pitch =
((tObj->Image[0][t->base.firstLevel]->Width *
@@ -411,9 +412,10 @@ static GLboolean r300EnableTexture2D(GLcontext * ctx, int unit)
if (t->base.dirty_images[0]) {
R300_FIREVERTICES(rmesa);
+
r300SetTexImages(rmesa, tObj);
r300UploadTexImages(rmesa, (r300TexObjPtr) tObj->DriverData, 0);
- if (!t->base.memBlock)
+ if (!t->base.memBlock && !t->image_override)
return GL_FALSE;
}
@@ -492,9 +494,11 @@ static GLboolean r300EnableTextureRect(GLcontext * ctx, int unit)
if (t->base.dirty_images[0]) {
R300_FIREVERTICES(rmesa);
+
r300SetTexImages(rmesa, tObj);
r300UploadTexImages(rmesa, (r300TexObjPtr) tObj->DriverData, 0);
- if (!t->base.memBlock && !rmesa->prefer_gart_client_texturing)
+ if (!t->base.memBlock && !t->image_override &&
+ !rmesa->prefer_gart_client_texturing)
return GL_FALSE;
}
@@ -534,6 +538,51 @@ static GLboolean r300UpdateTexture(GLcontext * ctx, int unit)
return !t->border_fallback;
}
+void r300SetTexOffset(__DRIcontext *pDRICtx, GLint texname,
+ unsigned long long offset, GLint depth, GLuint pitch)
+{
+ r300ContextPtr rmesa =
+ (r300ContextPtr)((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate;
+ struct gl_texture_object *tObj =
+ _mesa_lookup_texture(rmesa->radeon.glCtx, texname);
+ r300TexObjPtr t;
+ int idx;
+
+ if (!tObj)
+ return;
+
+ t = (r300TexObjPtr) tObj->DriverData;
+
+ t->image_override = GL_TRUE;
+
+ if (!offset)
+ return;
+
+ t->offset = offset;
+ t->pitch_reg = pitch;
+
+ switch (depth) {
+ case 32:
+ idx = 2;
+ t->pitch_reg /= 4;
+ break;
+ case 24:
+ default:
+ idx = 4;
+ t->pitch_reg /= 4;
+ break;
+ case 16:
+ idx = 5;
+ t->pitch_reg /= 2;
+ break;
+ }
+
+ t->pitch_reg--;
+
+ t->format = tx_table_le[idx].format;
+ t->filter |= tx_table_le[idx].filter;
+}
+
static GLboolean r300UpdateTextureUnit(GLcontext * ctx, int unit)
{
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index b476864d035..aa7fb633dd1 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -56,6 +56,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
#include "r300_context.h"
#include "r300_fragprog.h"
+#include "r300_tex.h"
#include "radeon_span.h"
#endif
@@ -952,6 +953,9 @@ static struct __DriverAPIRec radeonAPI = {
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL,
.CopySubBuffer = radeonCopySubBuffer,
+#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
+ .setTexOffset = r300SetTexOffset,
+#endif
};
#else
static const struct __DriverAPIRec r200API = {
diff --git a/src/mesa/drivers/dri/sis/sis_tex.c b/src/mesa/drivers/dri/sis/sis_tex.c
index be87f16e298..8fd7b26ba55 100644
--- a/src/mesa/drivers/dri/sis/sis_tex.c
+++ b/src/mesa/drivers/dri/sis/sis_tex.c
@@ -130,6 +130,8 @@ sisAllocTexImage( sisContextPtr smesa, sisTexObjPtr t, int level,
static void
sisFreeTexImage( sisContextPtr smesa, sisTexObjPtr t, int level )
{
+ assert(level >= 0);
+ assert(level < SIS_MAX_TEXTURE_LEVELS);
if (t->image[level].Data == NULL)
return;
@@ -213,7 +215,7 @@ sisDeleteTexture( GLcontext * ctx, struct gl_texture_object *texObj )
*/
return;
}
- for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
+ for (i = 0; i < SIS_MAX_TEXTURE_LEVELS; i++) {
sisFreeTexImage( smesa, t, i );
}
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index c8c68214ce8..7813c7ab135 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 7.0.1
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul 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"),
@@ -2716,21 +2716,20 @@ save_PolygonMode(GLenum face, GLenum mode)
}
-/*
- * Polygon stipple must have been upacked already!
- */
static void GLAPIENTRY
save_PolygonStipple(const GLubyte * pattern)
{
GET_CURRENT_CONTEXT(ctx);
+ GLvoid *image = unpack_image(2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP,
+ pattern, &ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_STIPPLE, 1);
if (n) {
- void *data;
- n[1].data = _mesa_malloc(32 * 4);
- data = n[1].data; /* This needed for Acorn compiler */
- MEMCPY(data, pattern, 32 * 4);
+ n[1].data = image;
+ }
+ else if (image) {
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
CALL_PolygonStipple(ctx->Exec, ((GLubyte *) pattern));
@@ -6169,7 +6168,12 @@ execute_list(GLcontext *ctx, GLuint list)
CALL_PolygonMode(ctx->Exec, (n[1].e, n[2].e));
break;
case OPCODE_POLYGON_STIPPLE:
- CALL_PolygonStipple(ctx->Exec, ((GLubyte *) n[1].data));
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_PolygonStipple(ctx->Exec, ((GLubyte *) n[1].data));
+ ctx->Unpack = save; /* restore */
+ }
break;
case OPCODE_POLYGON_OFFSET:
CALL_PolygonOffset(ctx->Exec, (n[1].f, n[2].f));
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index e5b9ce82800..803f4785c0a 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 7.1
+ * Version: 7.0.1
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
@@ -850,7 +850,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
return NULL;
}
- if (packing->SkipPixels == 0) {
+ if ((packing->SkipPixels & 7) == 0) {
_mesa_memcpy( dst, src, width_in_bytes );
if (packing->LsbFirst) {
flip_bytes( dst, width_in_bytes );
@@ -942,7 +942,7 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
if (!dst)
return;
- if (packing->SkipPixels == 0) {
+ if ((packing->SkipPixels & 7) == 0) {
_mesa_memcpy( dst, src, width_in_bytes );
if (packing->LsbFirst) {
flip_bytes( dst, width_in_bytes );
@@ -961,20 +961,20 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
if (*s & srcMask) {
*d |= dstMask;
}
- if (srcMask == 128) {
- srcMask = 1;
+ if (srcMask == 1) {
+ srcMask = 128;
s++;
}
else {
- srcMask = srcMask << 1;
+ srcMask = srcMask >> 1;
}
- if (dstMask == 1) {
- dstMask = 128;
+ if (dstMask == 128) {
+ dstMask = 1;
d++;
*d = 0;
}
else {
- dstMask = dstMask >> 1;
+ dstMask = dstMask << 1;
}
}
}
@@ -3733,7 +3733,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
switch (dstType) {
case GL_UNSIGNED_BYTE:
- if (sizeof(GLstencil) == 8) {
+ if (sizeof(GLstencil) == 1) {
_mesa_memcpy( dest, source, n );
}
else {
@@ -3745,14 +3745,11 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
}
break;
case GL_BYTE:
- if (sizeof(GLstencil) == 8) {
- _mesa_memcpy( dest, source, n );
- }
- else {
+ {
GLbyte *dst = (GLbyte *) dest;
GLuint i;
for (i=0;i<n;i++) {
- dst[i] = (GLbyte) source[i];
+ dst[i] = (GLbyte) (source[i] & 0x7f);
}
}
break;
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 8674c7299c5..408b68a7430 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -5,7 +5,7 @@
/*
* Mesa 3-D graphics library
- * Version: 7.0
+ * Version: 7.0.1
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
@@ -85,8 +85,13 @@ _mesa_PointParameteriNV( GLenum pname, GLint param )
void GLAPIENTRY
_mesa_PointParameterivNV( GLenum pname, const GLint *params )
{
- const GLfloat value = (GLfloat) params[0];
- _mesa_PointParameterfvEXT(pname, &value);
+ GLfloat p[3];
+ p[0] = (GLfloat) params[0];
+ if (pname == GL_DISTANCE_ATTENUATION_EXT) {
+ p[1] = (GLfloat) params[1];
+ p[2] = (GLfloat) params[2];
+ }
+ _mesa_PointParameterfvEXT(pname, p);
}
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 8b2bdd74b59..675dd831805 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -2056,7 +2056,8 @@ _slang_gen_declaration(slang_assemble_ctx *A, slang_operation *oper)
}
/* XXX make copy of this initializer? */
rhs = _slang_gen_operation(A, &oper->children[0]);
- assert(rhs);
+ if (!rhs)
+ return NULL; /* must have found an error */
init = new_node2(IR_MOVE, var, rhs);
/*assert(rhs->Opcode != IR_SEQ);*/
n = new_seq(varDecl, init);
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index d6d1c7523e5..7b0868e80e5 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -329,8 +329,10 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
* glVertex/position.
*/
for (attr = 1; attr < MAX_VERTEX_ATTRIBS; attr++) {
- if (((1 << attr) & usedAttributes) == 0)
+ if (((1 << attr) & usedAttributes) == 0) {
+ usedAttributes |= (1 << attr);
break;
+ }
}
if (attr == MAX_VERTEX_ATTRIBS) {
/* too many! XXX record error log */