Compare commits

..

34 Commits

Author SHA1 Message Date
Julien Cristau
34beaefe1c Prepare changelog for upload. 2007-08-09 16:00:58 +02:00
Julien Cristau
10b828f193 New upstream release. 2007-08-09 11:56:00 +02:00
Julien Cristau
43e6260ed0 Merge tag 'mesa_7_0_1' into debian-experimental 2007-08-09 11:25:42 +02:00
Brian
ae16a51e95 added GLU bug fixes 2007-08-03 13:39:09 -06:00
Brian
4398d67546 update 7.0.1 release info/date 2007-08-03 13:32:47 -06:00
Brian
c93738687c remove -rc2 2007-08-03 13:32:28 -06:00
Brian
799492e606 add OSMESA_LIB_NAME 2007-08-03 10:08:16 -06:00
Brian
f33ff071bb added -lm 2007-08-03 07:24:33 -06:00
Brian
99e854743c added bluegene-osmesa 2007-08-02 14:24:05 -06:00
Brian
6f79062d91 OSmesa on BlueGene (Alexander Neundorf) 2007-08-02 14:22:52 -06:00
Brian
2f682c3995 fix stencil value masking bug 11805, and fix sizeof() bug 2007-08-02 09:08:53 -06:00
Brian
067370e68f fix invalid pointer usage in bezierPatchDeleteList(), bug 11807 2007-08-02 08:40:58 -06:00
Brian
2aa439a6a4 fix double free()s (bug 11808) 2007-08-02 08:38:10 -06:00
Brian
b477182dc3 s/MAX_TEXTURE_LEVELS/SIS_MAX_TEXTURE_LEVELS/ and add assertion (bug 11806) 2007-08-02 08:35:27 -06:00
Michel Dänzer
a8964ca89e i915tex: Better attempt to release miptree when overriding texture image.
The previous approach could lead to crashes in FBO code that dereferences the
miptree struct pointer unconditionally.
2007-08-02 12:14:03 +02:00
Brian
4f0e92d07c Merge branch 'mesa_7_0_branch' of git+ssh://brianp@git.freedesktop.org/git/mesa/mesa into mesa_7_0_branch 2007-08-01 17:03:09 -06:00
Brian
577f4e8a5f Obsolete 2007-08-01 11:45:47 -06:00
Brian
0586d9fe56 fix error code test limit (bug 11795) 2007-08-01 11:27:47 -06:00
Michel Dänzer
1f0d9bf05e i915tex: Missing piece of SetTexOffset hook implementation for I830 generation. 2007-08-01 17:46:32 +02:00
Michel Dänzer
8bcae2a527 i915tex: Implement SetTexOffset hook.
Only build tested for I830 generation.
2007-08-01 17:46:31 +02:00
Michel Dänzer
35ca9aae91 r300: Implement SetTexOffset hook. 2007-08-01 17:46:30 +02:00
Michel Dänzer
6cdd2bf8d7 Add interfaces for overriding texture images with driver specific 'offsets'.
To be used by AIGLX for GLX_EXT_texture_from_pixmap without several
additional data copies.
2007-08-01 17:46:29 +02:00
Brian
ce7d175adb fix mem leak (bug 11793) 2007-08-01 08:42:13 -06:00
Brian
1904fd095f fix mem leak (bug 11791) 2007-08-01 08:42:09 -06:00
Brian
897d0ac5cc fix some FreeBSD issues 2007-07-31 14:57:54 -06:00
Brian
e262d0182f fix failure caused by undeclared variable (bug 11783) 2007-07-31 09:43:40 -06:00
Brian
aa5b748c10 glGetAttribLocation always returned 1 (bug 11774) 2007-07-31 09:29:31 -06:00
Julien Cristau
c6728df4a3 Merge tag 'mesa_7_0_1_rc2' into debian-experimental 2007-07-31 04:00:13 +02:00
Brian
3c182c5bc8 Added sunos5-v9-cc-g++ config (Roland Egger) 2007-07-30 09:00:09 -06:00
Brian
1b5677847b _mesa_pack_bitmap() fix from trunk 2007-07-30 08:13:05 -06:00
Brian
1be59a9dbe dlist polygon stipple fix from trunk 2007-07-30 08:12:29 -06:00
Brian
55c2178ad4 fix bug 11754 2007-07-29 18:28:09 -06:00
Jan Dvorak
3e3d392e1c fix glPointParameteriv bug 11754 2007-07-29 18:26:55 -06:00
Brian
756a7a4e4b minor tweaks 2007-07-27 11:44:55 -06:00
39 changed files with 350 additions and 133 deletions

View File

@@ -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* \

29
configs/bluegene-osmesa Normal file
View File

@@ -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

View File

@@ -1,42 +0,0 @@
# MinGW config include file updated for Mesa 7.0
#
# Updated : by Heromyth, on 2007-7-21
# Email : zxpmyth@yahoo.com.cn
# 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

View File

@@ -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

View File

@@ -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)

32
configs/sunos5-v9-cc-g++ Normal file
View File

@@ -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

7
debian/changelog vendored
View File

@@ -1,3 +1,10 @@
mesa (7.0.1-1) unstable; urgency=low
* New upstream release.
* Upload to unstable.
-- Julien Cristau <jcristau@debian.org> Thu, 09 Aug 2007 11:56:16 +0200
mesa (7.0.1~rc2-1) experimental; urgency=low
[ David Nusinow ]

View File

@@ -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>

View File

@@ -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.

View File

@@ -8,7 +8,7 @@
<body bgcolor="#eeeeee">
<H1>Mesa 7.0.1 Release Notes / (date), 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,10 +46,13 @@ 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>
<h2>Change</h2>
<h2>Changes</h2>
<ul>
<li>The libOSMesa library version has been reverted to 6.5.3 (soname=6)
in order to avoid application linking issues. Otherwise, applications

View File

@@ -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);
};
/**

View File

@@ -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)

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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++) {

View File

@@ -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>

View File

@@ -51,6 +51,7 @@ pool_create(struct _DriBufferPool *pool,
return NULL;
if ((alignment > pageSize) && (alignment % pageSize)) {
free(buf);
return NULL;
}

View File

@@ -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 );

View File

@@ -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);
};

View File

@@ -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 */

View File

@@ -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)

View File

@@ -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]);

View File

@@ -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));
{

View File

@@ -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]);

View File

@@ -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;
};

View File

@@ -776,7 +776,8 @@ static const struct __DriverAPIRec intelAPI = {
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL,
.CopySubBuffer = intelCopySubBuffer
.CopySubBuffer = intelCopySubBuffer,
.setTexOffset = intelSetTexOffset,
};

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -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 */

View File

@@ -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,

View File

@@ -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,

View File

@@ -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];

View File

@@ -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 = {

View File

@@ -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 );
}

View File

@@ -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));

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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 */