Compare commits
43 Commits
mesa-7.0.1
...
mesa-7.0.1
Author | SHA1 | Date | |
---|---|---|---|
|
369cda3752 | ||
|
846078d06f | ||
|
b18500d56e | ||
|
7d92c50490 | ||
|
d69a596193 | ||
|
8aa4ae638e | ||
|
3069f34841 | ||
|
b3788a0e4f | ||
|
582bc029ab | ||
|
e9e3099433 | ||
|
4fc561cc7b | ||
|
ad3e3a0b99 | ||
|
bfb8c849cb | ||
|
09dd25b5d1 | ||
|
c48efb1dbe | ||
|
5408acb6b7 | ||
|
15481160f9 | ||
|
00ccff03a5 | ||
|
21594921b1 | ||
|
42c91eebc9 | ||
|
88273e08b4 | ||
|
08f7fb45ef | ||
|
75ebda3ce6 | ||
|
53ff15fcbf | ||
|
72adb70ee2 | ||
|
960d41fcfe | ||
|
0c4e35b070 | ||
|
c53f1cb813 | ||
|
f6696cc15e | ||
|
fef9a41fe4 | ||
|
e279a0a076 | ||
|
88c8aaed96 | ||
|
62cbbd7226 | ||
|
f7cbe7fcee | ||
|
d8e4ff9079 | ||
|
510ff27eda | ||
|
5abf055100 | ||
|
4bb5721f6b | ||
|
c41ab70d3a | ||
|
a05e403bf2 | ||
|
2f57e0f71d | ||
|
95a2eb9767 | ||
|
55175daed7 |
4
Makefile
4
Makefile
@@ -1,7 +1,5 @@
|
||||
# Top-level Mesa makefile
|
||||
|
||||
SHELL = /bin/bash
|
||||
|
||||
TOP = .
|
||||
|
||||
SUBDIRS = src progs
|
||||
@@ -156,7 +154,7 @@ sunos5-v9 \
|
||||
sunos5-v9-static \
|
||||
sunos5-v9-cc-g++ \
|
||||
ultrix-gcc:
|
||||
@ if [ -e configs/current ] ; then \
|
||||
@ if test -f configs/current || test -L configs/current ; then \
|
||||
echo "Please run 'make realclean' before changing configs" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
|
9
debian/changelog
vendored
9
debian/changelog
vendored
@@ -1,3 +1,12 @@
|
||||
mesa (7.0.1-2) unstable; urgency=low
|
||||
|
||||
* Update to latest git (from mesa_7_0_branch)
|
||||
+ adds support for some new intel chipsets (i915 and i915_tex dri drivers)
|
||||
(closes: #437333)
|
||||
+ broken inline asm in dri drivers fixed (closes: #423739)
|
||||
|
||||
-- Julien Cristau <jcristau@debian.org> Tue, 28 Aug 2007 12:11:30 +0200
|
||||
|
||||
mesa (7.0.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
<h2>August 3, 2007</h2>
|
||||
<p>
|
||||
<a href="relnotes-7.0.html">Mesa 7.0.1</a> is released.
|
||||
<a href="relnotes-7.0.1.html">Mesa 7.0.1</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
|
@@ -17,6 +17,15 @@ Mesa 7.0.1 is a stable release with bug fixes since version 7.0.
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
db55141a44b902fcc61d9265b7862c06 MesaLib-7.0.1.tar.gz
|
||||
c056abd763e899114bf745c9eedbf9ad MesaLib-7.0.1.tar.bz2
|
||||
ecc2637547fae2b38271ae362d013afa MesaLib-7.0.1.zip
|
||||
b85a4a5be4e829f4a1165e4514b13183 MesaDemos-7.0.1.tar.gz
|
||||
3b66b3268df12ca8a6c4e0c4c457912c MesaDemos-7.0.1.tar.bz2
|
||||
b1c18006f16e44e80fea66774c59b391 MesaDemos-7.0.1.zip
|
||||
b87a69986839ae43ce12fc8e3dc1ebb4 MesaGLUT-7.0.1.tar.gz
|
||||
25f30d0c1651997b4412366ba0572f7f MesaGLUT-7.0.1.tar.bz2
|
||||
676ee6682a6ce78a5540554fd975c03e MesaGLUT-7.0.1.zip
|
||||
</pre>
|
||||
|
||||
|
||||
|
72
docs/relnotes-7.0.2.html
Normal file
72
docs/relnotes-7.0.2.html
Normal file
@@ -0,0 +1,72 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
|
||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.0.2 Release Notes / (TBD) 2007</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.0.2 is a stable release with bug fixes since version 7.0.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<ul>
|
||||
</ul>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<ul>
|
||||
<li>Fixed a vertex buffer wrapping issue (bug 9962)
|
||||
<li>Added mutex protection around texture object reference counters
|
||||
<li>Added checking/support for additional chips in the i915/i945 family
|
||||
(see 11978)
|
||||
<li>Fixed a blending/banding issue (bug 11931)
|
||||
<li>Fixed a GLU matrix inversion bug (#6748)
|
||||
<li>Fixed problem with large glDrawArrays calls and indirect rendering (bug 12141)
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>To Do (someday) items</h2>
|
||||
<ul>
|
||||
<li>Switch to freeglut
|
||||
<li>Fix linux-glide target/driver.
|
||||
<li>Improved lambda and derivative calculation for frag progs.
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Driver Status</h2>
|
||||
|
||||
<pre>
|
||||
Driver Status
|
||||
---------------------- ----------------------
|
||||
DRI drivers varies with the driver
|
||||
XMesa/GLX (on Xlib) implements OpenGL 2.1
|
||||
OSMesa (off-screen) implements OpenGL 2.1
|
||||
Windows/Win32 implements OpenGL 2.1
|
||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
|
||||
SVGA unsupported
|
||||
Wind River UGL unsupported
|
||||
DJGPP unsupported
|
||||
GGI unsupported
|
||||
BeOS unsupported
|
||||
Allegro unsupported
|
||||
D3D unsupported
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -20,6 +20,7 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
</p>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="relnotes-7.0.2.html">7.0.2 release notes</A>
|
||||
<LI><A HREF="relnotes-7.0.1.html">7.0.1 release notes</A>
|
||||
<LI><A HREF="relnotes-7.0.html">7.0 release notes</A>
|
||||
<LI><A HREF="relnotes-6.5.3.html">6.5.3 release notes</A>
|
||||
|
@@ -44,22 +44,17 @@
|
||||
#define GLAPIENTRYP GLAPIENTRY *
|
||||
#endif
|
||||
|
||||
#ifdef GLAPI
|
||||
#undef GLAPI
|
||||
#endif
|
||||
|
||||
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
|
||||
# define GLAPI __declspec(dllexport)
|
||||
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
|
||||
# define GLAPI __declspec(dllimport)
|
||||
# else /* for use with static link lib build of Win32 edition only */
|
||||
# define GLAPI extern
|
||||
# endif /* _STATIC_MESA support */
|
||||
|
||||
|
||||
#ifndef GLAPI
|
||||
#define GLAPI
|
||||
#endif
|
||||
#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
|
||||
# undef GLAPI
|
||||
# define GLAPI __declspec(dllexport)
|
||||
#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL)
|
||||
/* tag specifying we're building for DLL runtime support */
|
||||
# undef GLAPI
|
||||
# define GLAPI __declspec(dllimport)
|
||||
#elif !defined(GLAPI)
|
||||
/* for use with static link lib build of Win32 edition only */
|
||||
# define GLAPI extern
|
||||
#endif /* _STATIC_MESA support */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@@ -168,74 +168,57 @@ static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4],
|
||||
}
|
||||
|
||||
/*
|
||||
** inverse = invert(src)
|
||||
** New, faster implementation by Shan Hao Bo, April 2006.
|
||||
** Invert 4x4 matrix.
|
||||
** Contributed by David Moore (See Mesa bug #6748)
|
||||
*/
|
||||
static int __gluInvertMatrixd(const GLdouble src[16], GLdouble inverse[16])
|
||||
static int __gluInvertMatrixd(const GLdouble m[16], GLdouble inv[16])
|
||||
{
|
||||
int i, j, k;
|
||||
double t;
|
||||
GLdouble temp[4][4];
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
for (j=0; j<4; j++) {
|
||||
temp[i][j] = src[i*4+j];
|
||||
}
|
||||
}
|
||||
__gluMakeIdentityd(inverse);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (temp[i][i] == 0.0f) {
|
||||
/*
|
||||
** Look for non-zero element in column
|
||||
*/
|
||||
for (j = i + 1; j < 4; j++) {
|
||||
if (temp[j][i] != 0.0f) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j != 4) {
|
||||
/*
|
||||
** Swap rows.
|
||||
*/
|
||||
for (k = 0; k < 4; k++) {
|
||||
t = temp[i][k];
|
||||
temp[i][k] = temp[j][k];
|
||||
temp[j][k] = t;
|
||||
|
||||
t = inverse[i*4+k];
|
||||
inverse[i*4+k] = inverse[j*4+k];
|
||||
inverse[j*4+k] = t;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*
|
||||
** No non-zero pivot. The matrix is singular,
|
||||
which shouldn't
|
||||
** happen. This means the user gave us a bad
|
||||
matrix.
|
||||
*/
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
t = 1.0f / temp[i][i];
|
||||
for (k = 0; k < 4; k++) {
|
||||
temp[i][k] *= t;
|
||||
inverse[i*4+k] *= t;
|
||||
}
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (j != i) {
|
||||
t = temp[j][i];
|
||||
for (k = 0; k < 4; k++) {
|
||||
temp[j][k] -= temp[i][k]*t;
|
||||
inverse[j*4+k] -= inverse[i*4+k]*t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return GL_TRUE;
|
||||
double det;
|
||||
int i;
|
||||
|
||||
inv[0] = m[5]*m[10]*m[15] - m[5]*m[11]*m[14] - m[9]*m[6]*m[15]
|
||||
+ m[9]*m[7]*m[14] + m[13]*m[6]*m[11] - m[13]*m[7]*m[10];
|
||||
inv[4] = -m[4]*m[10]*m[15] + m[4]*m[11]*m[14] + m[8]*m[6]*m[15]
|
||||
- m[8]*m[7]*m[14] - m[12]*m[6]*m[11] + m[12]*m[7]*m[10];
|
||||
inv[8] = m[4]*m[9]*m[15] - m[4]*m[11]*m[13] - m[8]*m[5]*m[15]
|
||||
+ m[8]*m[7]*m[13] + m[12]*m[5]*m[11] - m[12]*m[7]*m[9];
|
||||
inv[12] = -m[4]*m[9]*m[14] + m[4]*m[10]*m[13] + m[8]*m[5]*m[14]
|
||||
- m[8]*m[6]*m[13] - m[12]*m[5]*m[10] + m[12]*m[6]*m[9];
|
||||
inv[1] = -m[1]*m[10]*m[15] + m[1]*m[11]*m[14] + m[9]*m[2]*m[15]
|
||||
- m[9]*m[3]*m[14] - m[13]*m[2]*m[11] + m[13]*m[3]*m[10];
|
||||
inv[5] = m[0]*m[10]*m[15] - m[0]*m[11]*m[14] - m[8]*m[2]*m[15]
|
||||
+ m[8]*m[3]*m[14] + m[12]*m[2]*m[11] - m[12]*m[3]*m[10];
|
||||
inv[9] = -m[0]*m[9]*m[15] + m[0]*m[11]*m[13] + m[8]*m[1]*m[15]
|
||||
- m[8]*m[3]*m[13] - m[12]*m[1]*m[11] + m[12]*m[3]*m[9];
|
||||
inv[13] = m[0]*m[9]*m[14] - m[0]*m[10]*m[13] - m[8]*m[1]*m[14]
|
||||
+ m[8]*m[2]*m[13] + m[12]*m[1]*m[10] - m[12]*m[2]*m[9];
|
||||
inv[2] = m[1]*m[6]*m[15] - m[1]*m[7]*m[14] - m[5]*m[2]*m[15]
|
||||
+ m[5]*m[3]*m[14] + m[13]*m[2]*m[7] - m[13]*m[3]*m[6];
|
||||
inv[6] = -m[0]*m[6]*m[15] + m[0]*m[7]*m[14] + m[4]*m[2]*m[15]
|
||||
- m[4]*m[3]*m[14] - m[12]*m[2]*m[7] + m[12]*m[3]*m[6];
|
||||
inv[10] = m[0]*m[5]*m[15] - m[0]*m[7]*m[13] - m[4]*m[1]*m[15]
|
||||
+ m[4]*m[3]*m[13] + m[12]*m[1]*m[7] - m[12]*m[3]*m[5];
|
||||
inv[14] = -m[0]*m[5]*m[14] + m[0]*m[6]*m[13] + m[4]*m[1]*m[14]
|
||||
- m[4]*m[2]*m[13] - m[12]*m[1]*m[6] + m[12]*m[2]*m[5];
|
||||
inv[3] = -m[1]*m[6]*m[11] + m[1]*m[7]*m[10] + m[5]*m[2]*m[11]
|
||||
- m[5]*m[3]*m[10] - m[9]*m[2]*m[7] + m[9]*m[3]*m[6];
|
||||
inv[7] = m[0]*m[6]*m[11] - m[0]*m[7]*m[10] - m[4]*m[2]*m[11]
|
||||
+ m[4]*m[3]*m[10] + m[8]*m[2]*m[7] - m[8]*m[3]*m[6];
|
||||
inv[11] = -m[0]*m[5]*m[11] + m[0]*m[7]*m[9] + m[4]*m[1]*m[11]
|
||||
- m[4]*m[3]*m[9] - m[8]*m[1]*m[7] + m[8]*m[3]*m[5];
|
||||
inv[15] = m[0]*m[5]*m[10] - m[0]*m[6]*m[9] - m[4]*m[1]*m[10]
|
||||
+ m[4]*m[2]*m[9] + m[8]*m[1]*m[6] - m[8]*m[2]*m[5];
|
||||
|
||||
det = m[0]*inv[0] + m[1]*inv[4] + m[2]*inv[8] + m[3]*inv[12];
|
||||
if (det == 0)
|
||||
return GL_FALSE;
|
||||
|
||||
det = 1.0 / det;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
inv[i] *= det;
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16],
|
||||
|
@@ -672,8 +672,11 @@ filter_modes( __GLcontextModes ** server_modes,
|
||||
if ( do_delete && (m->visualID != 0) ) {
|
||||
do_delete = GL_FALSE;
|
||||
|
||||
fprintf(stderr, "libGL warning: 3D driver claims to not support "
|
||||
"visual 0x%02x\n", m->visualID);
|
||||
/* don't warn for this visual (Novell #247471 / X.Org #6689) */
|
||||
if (m->visualRating != GLX_NON_CONFORMANT_CONFIG) {
|
||||
fprintf(stderr, "libGL warning: 3D driver claims to not "
|
||||
"support visual 0x%02x\n", m->visualID);
|
||||
}
|
||||
}
|
||||
|
||||
if ( do_delete ) {
|
||||
|
@@ -527,7 +527,7 @@ static GLubyte *
|
||||
emit_DrawArrays_header_old( __GLXcontext * gc,
|
||||
struct array_state_vector * arrays,
|
||||
size_t * elements_per_request,
|
||||
size_t * total_requests,
|
||||
unsigned int * total_requests,
|
||||
GLenum mode, GLsizei count )
|
||||
{
|
||||
size_t command_size;
|
||||
@@ -640,7 +640,7 @@ emit_DrawArrays_old( GLenum mode, GLint first, GLsizei count )
|
||||
|
||||
GLubyte * pc;
|
||||
size_t elements_per_request;
|
||||
size_t total_requests = 0;
|
||||
unsigned total_requests = 0;
|
||||
unsigned i;
|
||||
size_t total_sent = 0;
|
||||
|
||||
@@ -770,9 +770,10 @@ emit_DrawElements_old( GLenum mode, GLsizei count, GLenum type,
|
||||
|
||||
GLubyte * pc;
|
||||
size_t elements_per_request;
|
||||
size_t total_requests = 0;
|
||||
unsigned total_requests = 0;
|
||||
unsigned i;
|
||||
unsigned req;
|
||||
unsigned req_element=0;
|
||||
|
||||
|
||||
pc = emit_DrawArrays_header_old( gc, arrays, & elements_per_request,
|
||||
@@ -790,7 +791,7 @@ emit_DrawElements_old( GLenum mode, GLsizei count, GLenum type,
|
||||
|
||||
switch( type ) {
|
||||
case GL_UNSIGNED_INT: {
|
||||
const GLuint * ui_ptr = (const GLuint *) indices;
|
||||
const GLuint * ui_ptr = (const GLuint *) indices + req_element;
|
||||
|
||||
for ( i = 0 ; i < elements_per_request ; i++ ) {
|
||||
const GLint index = (GLint) *(ui_ptr++);
|
||||
@@ -799,7 +800,7 @@ emit_DrawElements_old( GLenum mode, GLsizei count, GLenum type,
|
||||
break;
|
||||
}
|
||||
case GL_UNSIGNED_SHORT: {
|
||||
const GLushort * us_ptr = (const GLushort *) indices;
|
||||
const GLushort * us_ptr = (const GLushort *) indices + req_element;
|
||||
|
||||
for ( i = 0 ; i < elements_per_request ; i++ ) {
|
||||
const GLint index = (GLint) *(us_ptr++);
|
||||
@@ -808,7 +809,7 @@ emit_DrawElements_old( GLenum mode, GLsizei count, GLenum type,
|
||||
break;
|
||||
}
|
||||
case GL_UNSIGNED_BYTE: {
|
||||
const GLubyte * ub_ptr = (const GLubyte *) indices;
|
||||
const GLubyte * ub_ptr = (const GLubyte *) indices + req_element;
|
||||
|
||||
for ( i = 0 ; i < elements_per_request ; i++ ) {
|
||||
const GLint index = (GLint) *(ub_ptr++);
|
||||
@@ -826,6 +827,7 @@ emit_DrawElements_old( GLenum mode, GLsizei count, GLenum type,
|
||||
}
|
||||
|
||||
count -= elements_per_request;
|
||||
req_element += elements_per_request;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -114,7 +114,7 @@
|
||||
do { \
|
||||
GLuint p = *(volatile GLuint *) GET_PTR(_x, _y); \
|
||||
__asm__ __volatile__( "bswap %0; rorl $8, %0" \
|
||||
: "=r" (p) : "r" (p) ); \
|
||||
: "=r" (p) : "0" (p) ); \
|
||||
((GLuint *)rgba)[0] = p; \
|
||||
} while (0)
|
||||
# elif defined( MESA_BIG_ENDIAN )
|
||||
|
@@ -288,8 +288,8 @@ i810InitDriver(__DRIscreenPrivate *sPriv)
|
||||
i810Screen->depth.handle,
|
||||
i810Screen->depth.size,
|
||||
(drmAddress *)&i810Screen->depth.map) != 0) {
|
||||
FREE(i810Screen);
|
||||
drmUnmap(i810Screen->back.map, i810Screen->back.size);
|
||||
FREE(i810Screen);
|
||||
sPriv->private = NULL;
|
||||
__driUtilMessage("i810InitDriver: drmMap (2) failed");
|
||||
return GL_FALSE;
|
||||
|
@@ -491,12 +491,19 @@ static void i915SetTexImages( i915ContextPtr i915,
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
if (i915->intel.intelScreen->deviceID == PCI_CHIP_I945_G ||
|
||||
i915->intel.intelScreen->deviceID == PCI_CHIP_I945_GM)
|
||||
i945LayoutTextureImages( i915, tObj );
|
||||
else
|
||||
i915LayoutTextureImages( i915, tObj );
|
||||
switch (i915->intel.intelScreen->deviceID) {
|
||||
case PCI_CHIP_I945_G:
|
||||
case PCI_CHIP_I945_GM:
|
||||
case PCI_CHIP_I945_GME:
|
||||
case PCI_CHIP_G33_G:
|
||||
case PCI_CHIP_Q33_G:
|
||||
case PCI_CHIP_Q35_G:
|
||||
i945LayoutTextureImages( i915, tObj );
|
||||
break;
|
||||
default:
|
||||
i915LayoutTextureImages( i915, tObj );
|
||||
break;
|
||||
}
|
||||
|
||||
t->Setup[I915_TEXREG_MS3] =
|
||||
(((tObj->Image[0][t->intel.base.firstLevel]->Height - 1) << MS3_HEIGHT_SHIFT) |
|
||||
|
@@ -123,6 +123,14 @@ const GLubyte *intelGetString( GLcontext *ctx, GLenum name )
|
||||
chipset = "Intel(R) 945G"; break;
|
||||
case PCI_CHIP_I945_GM:
|
||||
chipset = "Intel(R) 945GM"; break;
|
||||
case PCI_CHIP_I945_GME:
|
||||
chipset = "Intel(R) 945GME"; break;
|
||||
case PCI_CHIP_G33_G:
|
||||
chipset = "Intel(R) G33"; break;
|
||||
case PCI_CHIP_Q35_G:
|
||||
chipset = "Intel(R) Q35"; break;
|
||||
case PCI_CHIP_Q33_G:
|
||||
chipset = "Intel(R) Q33"; break;
|
||||
default:
|
||||
chipset = "Unknown Intel Chipset"; break;
|
||||
}
|
||||
|
@@ -454,6 +454,10 @@ extern int INTEL_DEBUG;
|
||||
#define PCI_CHIP_I915_GM 0x2592
|
||||
#define PCI_CHIP_I945_G 0x2772
|
||||
#define PCI_CHIP_I945_GM 0x27A2
|
||||
#define PCI_CHIP_I945_GME 0x27AE
|
||||
#define PCI_CHIP_G33_G 0x29C2
|
||||
#define PCI_CHIP_Q35_G 0x29B2
|
||||
#define PCI_CHIP_Q33_G 0x29D2
|
||||
|
||||
|
||||
/* ================================================================
|
||||
|
@@ -514,6 +514,10 @@ static GLboolean intelCreateContext( const __GLcontextModes *mesaVis,
|
||||
case PCI_CHIP_I915_GM:
|
||||
case PCI_CHIP_I945_G:
|
||||
case PCI_CHIP_I945_GM:
|
||||
case PCI_CHIP_I945_GME:
|
||||
case PCI_CHIP_G33_G:
|
||||
case PCI_CHIP_Q35_G:
|
||||
case PCI_CHIP_Q33_G:
|
||||
return i915CreateContext( mesaVis, driContextPriv,
|
||||
sharedContextPrivate );
|
||||
|
||||
|
@@ -677,7 +677,11 @@ static void intelUploadTexImage( intelContextPtr intel,
|
||||
/* Time for another vtbl entry:
|
||||
*/
|
||||
else if (intel->intelScreen->deviceID == PCI_CHIP_I945_G ||
|
||||
intel->intelScreen->deviceID == PCI_CHIP_I945_GM) {
|
||||
intel->intelScreen->deviceID == PCI_CHIP_I945_GM ||
|
||||
intel->intelScreen->deviceID == PCI_CHIP_I945_GME ||
|
||||
intel->intelScreen->deviceID == PCI_CHIP_G33_G ||
|
||||
intel->intelScreen->deviceID == PCI_CHIP_Q33_G ||
|
||||
intel->intelScreen->deviceID == PCI_CHIP_Q35_G) {
|
||||
GLuint row_len = image->Width * image->TexFormat->TexelBytes;
|
||||
GLubyte *dst = (GLubyte *)(t->BufAddr + offset);
|
||||
GLubyte *src = (GLubyte *)image->Data;
|
||||
|
@@ -519,6 +519,16 @@ i830_emit_state(struct intel_context *intel)
|
||||
static void
|
||||
i830_destroy_context(struct intel_context *intel)
|
||||
{
|
||||
GLuint i;
|
||||
struct i830_context *i830 = i830_context(&intel->ctx);
|
||||
|
||||
for (i = 0; i < I830_TEX_UNITS; i++) {
|
||||
if (i830->state.tex_buffer[i] != NULL) {
|
||||
driBOUnReference(i830->state.tex_buffer[i]);
|
||||
i830->state.tex_buffer[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
_tnl_free_vertices(&intel->ctx);
|
||||
}
|
||||
|
||||
|
@@ -430,6 +430,16 @@ i915_emit_state(struct intel_context *intel)
|
||||
static void
|
||||
i915_destroy_context(struct intel_context *intel)
|
||||
{
|
||||
GLuint i;
|
||||
struct i915_context *i915 = i915_context(&intel->ctx);
|
||||
|
||||
for (i = 0; i < I915_TEX_UNITS; i++) {
|
||||
if (i915->state.tex_buffer[i] != NULL) {
|
||||
driBOUnReference(i915->state.tex_buffer[i]);
|
||||
i915->state.tex_buffer[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
_tnl_free_vertices(&intel->ctx);
|
||||
}
|
||||
|
||||
|
@@ -130,6 +130,18 @@ intelGetString(GLcontext * ctx, GLenum name)
|
||||
case PCI_CHIP_I945_GM:
|
||||
chipset = "Intel(R) 945GM";
|
||||
break;
|
||||
case PCI_CHIP_I945_GME:
|
||||
chipset = "Intel(R) 945GME";
|
||||
break;
|
||||
case PCI_CHIP_G33_G:
|
||||
chipset = "Intel(R) G33";
|
||||
break;
|
||||
case PCI_CHIP_Q35_G:
|
||||
chipset = "Intel(R) Q35";
|
||||
break;
|
||||
case PCI_CHIP_Q33_G:
|
||||
chipset = "Intel(R) Q33";
|
||||
break;
|
||||
default:
|
||||
chipset = "Unknown Intel Chipset";
|
||||
break;
|
||||
|
@@ -385,6 +385,10 @@ extern int INTEL_DEBUG;
|
||||
#define PCI_CHIP_I915_GM 0x2592
|
||||
#define PCI_CHIP_I945_G 0x2772
|
||||
#define PCI_CHIP_I945_GM 0x27A2
|
||||
#define PCI_CHIP_I945_GME 0x27AE
|
||||
#define PCI_CHIP_G33_G 0x29C2
|
||||
#define PCI_CHIP_Q35_G 0x29B2
|
||||
#define PCI_CHIP_Q33_G 0x29D2
|
||||
|
||||
|
||||
/* ================================================================
|
||||
|
@@ -79,6 +79,10 @@ intel_miptree_create(struct intel_context *intel,
|
||||
switch (intel->intelScreen->deviceID) {
|
||||
case PCI_CHIP_I945_G:
|
||||
case PCI_CHIP_I945_GM:
|
||||
case PCI_CHIP_I945_GME:
|
||||
case PCI_CHIP_G33_G:
|
||||
case PCI_CHIP_Q33_G:
|
||||
case PCI_CHIP_Q35_G:
|
||||
ok = i945_miptree_layout(mt);
|
||||
break;
|
||||
case PCI_CHIP_I915_G:
|
||||
@@ -93,9 +97,19 @@ intel_miptree_create(struct intel_context *intel,
|
||||
break;
|
||||
}
|
||||
|
||||
if (ok)
|
||||
if (ok) {
|
||||
if (!mt->compressed) {
|
||||
/* XXX: Align pitch to multiple of 64 bytes for now to allow
|
||||
* render-to-texture to work in all cases. This should probably be
|
||||
* replaced at some point by some scheme to only do this when really
|
||||
* necessary.
|
||||
*/
|
||||
mt->pitch = ((mt->pitch * cpp + 63) & ~63) / cpp;
|
||||
}
|
||||
|
||||
mt->region = intel_region_alloc(intel->intelScreen,
|
||||
mt->cpp, mt->pitch, mt->total_height);
|
||||
}
|
||||
|
||||
if (!mt->region) {
|
||||
free(mt);
|
||||
|
@@ -752,6 +752,10 @@ intelCreateContext(const __GLcontextModes * mesaVis,
|
||||
case PCI_CHIP_I915_GM:
|
||||
case PCI_CHIP_I945_G:
|
||||
case PCI_CHIP_I945_GM:
|
||||
case PCI_CHIP_I945_GME:
|
||||
case PCI_CHIP_G33_G:
|
||||
case PCI_CHIP_Q35_G:
|
||||
case PCI_CHIP_Q33_G:
|
||||
return i915CreateContext(mesaVis, driContextPriv, sharedContextPrivate);
|
||||
|
||||
default:
|
||||
|
@@ -733,14 +733,15 @@ void viaXMesaWindowMoved(struct via_context *vmesa)
|
||||
{
|
||||
__DRIdrawablePrivate *const drawable = vmesa->driDrawable;
|
||||
__DRIdrawablePrivate *const readable = vmesa->driReadable;
|
||||
struct via_renderbuffer *const draw_buffer =
|
||||
(struct via_renderbuffer *) drawable->driverPrivate;
|
||||
struct via_renderbuffer *const read_buffer =
|
||||
(struct via_renderbuffer *) readable->driverPrivate;
|
||||
struct via_renderbuffer * draw_buffer;
|
||||
struct via_renderbuffer * read_buffer;
|
||||
GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3;
|
||||
|
||||
if (!drawable)
|
||||
return;
|
||||
|
||||
draw_buffer = (struct via_renderbuffer *) drawable->driverPrivate;
|
||||
read_buffer = (struct via_renderbuffer *) readable->driverPrivate;
|
||||
|
||||
switch (vmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
|
||||
case BUFFER_BIT_BACK_LEFT:
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 7.0.1
|
||||
* Version: 7.0.2
|
||||
*
|
||||
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -30,6 +30,55 @@
|
||||
#include "state.h"
|
||||
|
||||
|
||||
/**
|
||||
* Find the max index in the given element/index buffer
|
||||
*/
|
||||
static GLuint
|
||||
max_buffer_index(GLcontext *ctx, GLuint count, GLenum type,
|
||||
const void *indices,
|
||||
struct gl_buffer_object *elementBuf)
|
||||
{
|
||||
const GLubyte *map = NULL;
|
||||
GLuint max = 0;
|
||||
GLint i;
|
||||
|
||||
if (elementBuf->Name) {
|
||||
/* elements are in a user-defined buffer object. need to map it */
|
||||
map = ctx->Driver.MapBuffer(ctx,
|
||||
GL_ELEMENT_ARRAY_BUFFER_ARB,
|
||||
GL_READ_ONLY,
|
||||
elementBuf);
|
||||
/* Actual address is the sum of pointers */
|
||||
indices = (const GLvoid *) ADD_POINTERS(map, (const GLubyte *) indices);
|
||||
}
|
||||
|
||||
if (type == GL_UNSIGNED_INT) {
|
||||
for (i = 0; i < count; i++)
|
||||
if (((GLuint *) indices)[i] > max)
|
||||
max = ((GLuint *) indices)[i];
|
||||
}
|
||||
else if (type == GL_UNSIGNED_SHORT) {
|
||||
for (i = 0; i < count; i++)
|
||||
if (((GLushort *) indices)[i] > max)
|
||||
max = ((GLushort *) indices)[i];
|
||||
}
|
||||
else {
|
||||
ASSERT(type == GL_UNSIGNED_BYTE);
|
||||
for (i = 0; i < count; i++)
|
||||
if (((GLubyte *) indices)[i] > max)
|
||||
max = ((GLubyte *) indices)[i];
|
||||
}
|
||||
|
||||
if (map) {
|
||||
ctx->Driver.UnmapBuffer(ctx,
|
||||
GL_ELEMENT_ARRAY_BUFFER_ARB,
|
||||
ctx->Array.ElementArrayBufferObj);
|
||||
}
|
||||
|
||||
return max;
|
||||
}
|
||||
|
||||
|
||||
GLboolean
|
||||
_mesa_validate_DrawElements(GLcontext *ctx,
|
||||
GLenum mode, GLsizei count, GLenum type,
|
||||
@@ -61,20 +110,15 @@ _mesa_validate_DrawElements(GLcontext *ctx,
|
||||
|
||||
/* Always need vertex positions */
|
||||
if (!ctx->Array.ArrayObj->Vertex.Enabled
|
||||
&& !(ctx->VertexProgram._Enabled && ctx->Array.ArrayObj->VertexAttrib[0].Enabled))
|
||||
&& !(ctx->VertexProgram._Enabled
|
||||
&& ctx->Array.ArrayObj->VertexAttrib[0].Enabled))
|
||||
return GL_FALSE;
|
||||
|
||||
/* Vertex buffer object tests */
|
||||
if (ctx->Array.ElementArrayBufferObj->Name) {
|
||||
/* use indices in the buffer object */
|
||||
GLuint indexBytes;
|
||||
|
||||
/* use indices in the buffer object */
|
||||
if (!ctx->Array.ElementArrayBufferObj->Data) {
|
||||
_mesa_warning(ctx, "DrawElements with empty vertex elements buffer!");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
/* make sure count doesn't go outside buffer bounds */
|
||||
if (type == GL_UNSIGNED_INT) {
|
||||
indexBytes = count * sizeof(GLuint);
|
||||
}
|
||||
@@ -86,19 +130,11 @@ _mesa_validate_DrawElements(GLcontext *ctx,
|
||||
indexBytes = count * sizeof(GLushort);
|
||||
}
|
||||
|
||||
if ((GLubyte *) indices + indexBytes >
|
||||
ctx->Array.ElementArrayBufferObj->Data +
|
||||
ctx->Array.ElementArrayBufferObj->Size) {
|
||||
/* make sure count doesn't go outside buffer bounds */
|
||||
if (indexBytes > ctx->Array.ElementArrayBufferObj->Size) {
|
||||
_mesa_warning(ctx, "glDrawElements index out of buffer bounds");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
/* Actual address is the sum of pointers. Indices may be used below. */
|
||||
if (ctx->Const.CheckArrayBounds) {
|
||||
indices = (const GLvoid *)
|
||||
ADD_POINTERS(ctx->Array.ElementArrayBufferObj->Data,
|
||||
(const GLubyte *) indices);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* not using a VBO */
|
||||
@@ -108,24 +144,8 @@ _mesa_validate_DrawElements(GLcontext *ctx,
|
||||
|
||||
if (ctx->Const.CheckArrayBounds) {
|
||||
/* find max array index */
|
||||
GLuint max = 0;
|
||||
GLint i;
|
||||
if (type == GL_UNSIGNED_INT) {
|
||||
for (i = 0; i < count; i++)
|
||||
if (((GLuint *) indices)[i] > max)
|
||||
max = ((GLuint *) indices)[i];
|
||||
}
|
||||
else if (type == GL_UNSIGNED_SHORT) {
|
||||
for (i = 0; i < count; i++)
|
||||
if (((GLushort *) indices)[i] > max)
|
||||
max = ((GLushort *) indices)[i];
|
||||
}
|
||||
else {
|
||||
ASSERT(type == GL_UNSIGNED_BYTE);
|
||||
for (i = 0; i < count; i++)
|
||||
if (((GLubyte *) indices)[i] > max)
|
||||
max = ((GLubyte *) indices)[i];
|
||||
}
|
||||
GLuint max = max_buffer_index(ctx, count, type, indices,
|
||||
ctx->Array.ElementArrayBufferObj);
|
||||
if (max >= ctx->Array._MaxElement) {
|
||||
/* the max element is out of bounds of one or more enabled arrays */
|
||||
return GL_FALSE;
|
||||
@@ -172,41 +192,41 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
|
||||
|
||||
/* Always need vertex positions */
|
||||
if (!ctx->Array.ArrayObj->Vertex.Enabled
|
||||
&& !(ctx->VertexProgram._Enabled && ctx->Array.ArrayObj->VertexAttrib[0].Enabled))
|
||||
&& !(ctx->VertexProgram._Enabled
|
||||
&& ctx->Array.ArrayObj->VertexAttrib[0].Enabled))
|
||||
return GL_FALSE;
|
||||
|
||||
/* Vertex buffer object tests */
|
||||
if (ctx->Array.ElementArrayBufferObj->Name) {
|
||||
/* XXX re-use code from above? */
|
||||
/* use indices in the buffer object */
|
||||
GLuint indexBytes;
|
||||
|
||||
if (type == GL_UNSIGNED_INT) {
|
||||
indexBytes = count * sizeof(GLuint);
|
||||
}
|
||||
else if (type == GL_UNSIGNED_BYTE) {
|
||||
indexBytes = count * sizeof(GLubyte);
|
||||
}
|
||||
else {
|
||||
ASSERT(type == GL_UNSIGNED_SHORT);
|
||||
indexBytes = count * sizeof(GLushort);
|
||||
}
|
||||
|
||||
/* make sure count doesn't go outside buffer bounds */
|
||||
if (indexBytes > ctx->Array.ElementArrayBufferObj->Size) {
|
||||
_mesa_warning(ctx, "glDrawElements index out of buffer bounds");
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* not using VBO */
|
||||
/* not using a VBO */
|
||||
if (!indices)
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
if (ctx->Const.CheckArrayBounds) {
|
||||
/* Find max array index.
|
||||
* We don't trust the user's start and end values.
|
||||
*/
|
||||
GLuint max = 0;
|
||||
GLint i;
|
||||
if (type == GL_UNSIGNED_INT) {
|
||||
for (i = 0; i < count; i++)
|
||||
if (((GLuint *) indices)[i] > max)
|
||||
max = ((GLuint *) indices)[i];
|
||||
}
|
||||
else if (type == GL_UNSIGNED_SHORT) {
|
||||
for (i = 0; i < count; i++)
|
||||
if (((GLushort *) indices)[i] > max)
|
||||
max = ((GLushort *) indices)[i];
|
||||
}
|
||||
else {
|
||||
ASSERT(type == GL_UNSIGNED_BYTE);
|
||||
for (i = 0; i < count; i++)
|
||||
if (((GLubyte *) indices)[i] > max)
|
||||
max = ((GLubyte *) indices)[i];
|
||||
}
|
||||
GLuint max = max_buffer_index(ctx, count, type, indices,
|
||||
ctx->Array.ElementArrayBufferObj);
|
||||
if (max >= ctx->Array._MaxElement) {
|
||||
/* the max element is out of bounds of one or more enabled arrays */
|
||||
return GL_FALSE;
|
||||
@@ -241,7 +261,8 @@ _mesa_validate_DrawArrays(GLcontext *ctx,
|
||||
_mesa_update_state(ctx);
|
||||
|
||||
/* Always need vertex positions */
|
||||
if (!ctx->Array.ArrayObj->Vertex.Enabled && !ctx->Array.ArrayObj->VertexAttrib[0].Enabled)
|
||||
if (!ctx->Array.ArrayObj->Vertex.Enabled
|
||||
&& !ctx->Array.ArrayObj->VertexAttrib[0].Enabled)
|
||||
return GL_FALSE;
|
||||
|
||||
if (ctx->Const.CheckArrayBounds) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5.3
|
||||
* Version: 7.0.2
|
||||
*
|
||||
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -51,6 +51,32 @@
|
||||
#include "math/m_xform.h"
|
||||
|
||||
|
||||
/**
|
||||
* Special struct for saving/restoring texture state (GL_TEXTURE_BIT)
|
||||
*/
|
||||
struct texture_state
|
||||
{
|
||||
struct gl_texture_attrib Texture; /**< The usual context state */
|
||||
|
||||
/** to save per texture object state (wrap modes, filters, etc): */
|
||||
struct gl_texture_object Saved1D[MAX_TEXTURE_UNITS];
|
||||
struct gl_texture_object Saved2D[MAX_TEXTURE_UNITS];
|
||||
struct gl_texture_object Saved3D[MAX_TEXTURE_UNITS];
|
||||
struct gl_texture_object SavedCube[MAX_TEXTURE_UNITS];
|
||||
struct gl_texture_object SavedRect[MAX_TEXTURE_UNITS];
|
||||
|
||||
/**
|
||||
* To save references to texture objects (so they don't get accidentally
|
||||
* deleted while saved in the attribute stack).
|
||||
*/
|
||||
struct gl_texture_object *SavedRef1D[MAX_TEXTURE_UNITS];
|
||||
struct gl_texture_object *SavedRef2D[MAX_TEXTURE_UNITS];
|
||||
struct gl_texture_object *SavedRef3D[MAX_TEXTURE_UNITS];
|
||||
struct gl_texture_object *SavedRefCube[MAX_TEXTURE_UNITS];
|
||||
struct gl_texture_object *SavedRefRect[MAX_TEXTURE_UNITS];
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Allocate a new attribute state node. These nodes have a
|
||||
* "kind" value and a pointer to a struct of state data.
|
||||
@@ -335,40 +361,48 @@ _mesa_PushAttrib(GLbitfield mask)
|
||||
}
|
||||
|
||||
if (mask & GL_TEXTURE_BIT) {
|
||||
struct gl_texture_attrib *attr;
|
||||
struct texture_state *texstate = CALLOC_STRUCT( texture_state );
|
||||
GLuint u;
|
||||
|
||||
if (!texstate) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib(GL_TEXTURE_BIT)");
|
||||
goto end;
|
||||
}
|
||||
|
||||
_mesa_lock_context_textures(ctx);
|
||||
/* Bump the texture object reference counts so that they don't
|
||||
* inadvertantly get deleted.
|
||||
|
||||
/* copy/save the bulk of texture state here */
|
||||
_mesa_memcpy(&texstate->Texture, &ctx->Texture, sizeof(ctx->Texture));
|
||||
|
||||
/* Save references to the currently bound texture objects so they don't
|
||||
* accidentally get deleted while referenced in the attribute stack.
|
||||
*/
|
||||
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
|
||||
ctx->Texture.Unit[u].Current1D->RefCount++;
|
||||
ctx->Texture.Unit[u].Current2D->RefCount++;
|
||||
ctx->Texture.Unit[u].Current3D->RefCount++;
|
||||
ctx->Texture.Unit[u].CurrentCubeMap->RefCount++;
|
||||
ctx->Texture.Unit[u].CurrentRect->RefCount++;
|
||||
_mesa_reference_texobj(&texstate->SavedRef1D[u], ctx->Texture.Unit[u].Current1D);
|
||||
_mesa_reference_texobj(&texstate->SavedRef2D[u], ctx->Texture.Unit[u].Current2D);
|
||||
_mesa_reference_texobj(&texstate->SavedRef3D[u], ctx->Texture.Unit[u].Current3D);
|
||||
_mesa_reference_texobj(&texstate->SavedRefCube[u], ctx->Texture.Unit[u].CurrentCubeMap);
|
||||
_mesa_reference_texobj(&texstate->SavedRefRect[u], ctx->Texture.Unit[u].CurrentRect);
|
||||
}
|
||||
attr = MALLOC_STRUCT( gl_texture_attrib );
|
||||
MEMCPY( attr, &ctx->Texture, sizeof(struct gl_texture_attrib) );
|
||||
/* copy state of the currently bound texture objects */
|
||||
|
||||
/* copy state/contents of the currently bound texture objects */
|
||||
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
|
||||
_mesa_copy_texture_object(&attr->Unit[u].Saved1D,
|
||||
attr->Unit[u].Current1D);
|
||||
_mesa_copy_texture_object(&attr->Unit[u].Saved2D,
|
||||
attr->Unit[u].Current2D);
|
||||
_mesa_copy_texture_object(&attr->Unit[u].Saved3D,
|
||||
attr->Unit[u].Current3D);
|
||||
_mesa_copy_texture_object(&attr->Unit[u].SavedCubeMap,
|
||||
attr->Unit[u].CurrentCubeMap);
|
||||
_mesa_copy_texture_object(&attr->Unit[u].SavedRect,
|
||||
attr->Unit[u].CurrentRect);
|
||||
_mesa_copy_texture_object(&texstate->Saved1D[u],
|
||||
ctx->Texture.Unit[u].Current1D);
|
||||
_mesa_copy_texture_object(&texstate->Saved2D[u],
|
||||
ctx->Texture.Unit[u].Current2D);
|
||||
_mesa_copy_texture_object(&texstate->Saved3D[u],
|
||||
ctx->Texture.Unit[u].Current3D);
|
||||
_mesa_copy_texture_object(&texstate->SavedCube[u],
|
||||
ctx->Texture.Unit[u].CurrentCubeMap);
|
||||
_mesa_copy_texture_object(&texstate->SavedRect[u],
|
||||
ctx->Texture.Unit[u].CurrentRect);
|
||||
}
|
||||
|
||||
_mesa_unlock_context_textures(ctx);
|
||||
|
||||
newnode = new_attrib_node( GL_TEXTURE_BIT );
|
||||
newnode->data = attr;
|
||||
newnode->data = texstate;
|
||||
newnode->next = head;
|
||||
head = newnode;
|
||||
}
|
||||
@@ -404,6 +438,7 @@ _mesa_PushAttrib(GLbitfield mask)
|
||||
head = newnode;
|
||||
}
|
||||
|
||||
end:
|
||||
ctx->AttribStack[ctx->AttribStackDepth] = head;
|
||||
ctx->AttribStackDepth++;
|
||||
}
|
||||
@@ -613,14 +648,19 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pop/restore texture attribute/group state.
|
||||
*/
|
||||
static void
|
||||
pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib)
|
||||
pop_texture_group(GLcontext *ctx, struct texture_state *texstate)
|
||||
{
|
||||
GLuint u;
|
||||
|
||||
_mesa_lock_context_textures(ctx);
|
||||
|
||||
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
|
||||
const struct gl_texture_unit *unit = &texAttrib->Unit[u];
|
||||
GLuint i;
|
||||
const struct gl_texture_unit *unit = &texstate->Texture.Unit[u];
|
||||
GLuint tgt;
|
||||
|
||||
_mesa_ActiveTextureARB(GL_TEXTURE0_ARB + u);
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_1D,
|
||||
@@ -713,41 +753,44 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib)
|
||||
1 << unit->Combine.ScaleShiftA);
|
||||
}
|
||||
|
||||
/* Restore texture object state */
|
||||
for (i = 0; i < NUM_TEXTURE_TARGETS; i++) {
|
||||
GLenum target = 0;
|
||||
/* Restore texture object state for each target */
|
||||
for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
|
||||
const struct gl_texture_object *obj = NULL;
|
||||
GLfloat bordColor[4];
|
||||
GLenum target;
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
target = GL_TEXTURE_1D;
|
||||
obj = &unit->Saved1D;
|
||||
switch (tgt) {
|
||||
case TEXTURE_1D_INDEX:
|
||||
obj = &texstate->Saved1D[u];
|
||||
ASSERT(obj->Target == GL_TEXTURE_1D);
|
||||
break;
|
||||
case 1:
|
||||
target = GL_TEXTURE_2D;
|
||||
obj = &unit->Saved2D;
|
||||
case TEXTURE_2D_INDEX:
|
||||
obj = &texstate->Saved2D[u];
|
||||
ASSERT(obj->Target == GL_TEXTURE_2D);
|
||||
break;
|
||||
case 2:
|
||||
target = GL_TEXTURE_3D;
|
||||
obj = &unit->Saved3D;
|
||||
case TEXTURE_3D_INDEX:
|
||||
obj = &texstate->Saved3D[u];
|
||||
ASSERT(obj->Target == GL_TEXTURE_3D);
|
||||
break;
|
||||
case 3:
|
||||
case TEXTURE_CUBE_INDEX:
|
||||
if (!ctx->Extensions.ARB_texture_cube_map)
|
||||
continue;
|
||||
target = GL_TEXTURE_CUBE_MAP_ARB;
|
||||
obj = &unit->SavedCubeMap;
|
||||
obj = &texstate->SavedCube[u];
|
||||
ASSERT(obj->Target == GL_TEXTURE_CUBE_MAP_ARB);
|
||||
break;
|
||||
case 4:
|
||||
case TEXTURE_RECT_INDEX:
|
||||
if (!ctx->Extensions.NV_texture_rectangle)
|
||||
continue;
|
||||
target = GL_TEXTURE_RECTANGLE_NV;
|
||||
obj = &unit->SavedRect;
|
||||
obj = &texstate->SavedRect[u];
|
||||
ASSERT(obj->Target == GL_TEXTURE_RECTANGLE_NV);
|
||||
break;
|
||||
default:
|
||||
; /* silence warnings */
|
||||
_mesa_problem(ctx, "bad texture index in pop_texture_group");
|
||||
continue;
|
||||
}
|
||||
|
||||
target = obj->Target;
|
||||
|
||||
_mesa_BindTexture(target, obj->Name);
|
||||
|
||||
bordColor[0] = CHAN_TO_FLOAT(obj->BorderColor[0]);
|
||||
@@ -782,23 +825,19 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib)
|
||||
_mesa_TexParameterf(target, GL_SHADOW_AMBIENT_SGIX,
|
||||
obj->ShadowAmbient);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
_mesa_ActiveTextureARB(GL_TEXTURE0_ARB
|
||||
+ texAttrib->CurrentUnit);
|
||||
|
||||
/* "un-bump" the texture object reference counts. We did that so they
|
||||
* wouldn't inadvertantly get deleted while they were still referenced
|
||||
* inside the attribute state stack.
|
||||
*/
|
||||
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
|
||||
ctx->Texture.Unit[u].Current1D->RefCount--;
|
||||
ctx->Texture.Unit[u].Current2D->RefCount--;
|
||||
ctx->Texture.Unit[u].Current3D->RefCount--;
|
||||
ctx->Texture.Unit[u].CurrentCubeMap->RefCount--;
|
||||
ctx->Texture.Unit[u].CurrentRect->RefCount--;
|
||||
/* remove saved references to the texture objects */
|
||||
_mesa_reference_texobj(&texstate->SavedRef1D[u], NULL);
|
||||
_mesa_reference_texobj(&texstate->SavedRef2D[u], NULL);
|
||||
_mesa_reference_texobj(&texstate->SavedRef3D[u], NULL);
|
||||
_mesa_reference_texobj(&texstate->SavedRefCube[u], NULL);
|
||||
_mesa_reference_texobj(&texstate->SavedRefRect[u], NULL);
|
||||
}
|
||||
|
||||
_mesa_ActiveTextureARB(GL_TEXTURE0_ARB + texstate->Texture.CurrentUnit);
|
||||
|
||||
_mesa_unlock_context_textures(ctx);
|
||||
}
|
||||
|
||||
|
||||
@@ -1177,9 +1216,9 @@ _mesa_PopAttrib(void)
|
||||
case GL_TEXTURE_BIT:
|
||||
/* Take care of texture object reference counters */
|
||||
{
|
||||
const struct gl_texture_attrib *texture;
|
||||
texture = (const struct gl_texture_attrib *) attr->data;
|
||||
pop_texture_group(ctx, texture);
|
||||
struct texture_state *texstate
|
||||
= (struct texture_state *) attr->data;
|
||||
pop_texture_group(ctx, texstate);
|
||||
ctx->NewState |= _NEW_TEXTURE;
|
||||
}
|
||||
break;
|
||||
@@ -1401,6 +1440,41 @@ _mesa_PopClientAttrib(void)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_free_attrib_data(GLcontext *ctx)
|
||||
{
|
||||
while (ctx->AttribStackDepth > 0) {
|
||||
struct gl_attrib_node *attr, *next;
|
||||
|
||||
ctx->AttribStackDepth--;
|
||||
attr = ctx->AttribStack[ctx->AttribStackDepth];
|
||||
|
||||
while (attr) {
|
||||
if (attr->kind == GL_TEXTURE_BIT) {
|
||||
struct texture_state *texstate = (struct texture_state*)attr->data;
|
||||
GLuint u;
|
||||
/* clear references to the saved texture objects */
|
||||
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
|
||||
_mesa_reference_texobj(&texstate->SavedRef1D[u], NULL);
|
||||
_mesa_reference_texobj(&texstate->SavedRef2D[u], NULL);
|
||||
_mesa_reference_texobj(&texstate->SavedRef3D[u], NULL);
|
||||
_mesa_reference_texobj(&texstate->SavedRefCube[u], NULL);
|
||||
_mesa_reference_texobj(&texstate->SavedRefRect[u], NULL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* any other chunks of state that requires special handling? */
|
||||
}
|
||||
|
||||
next = attr->next;
|
||||
_mesa_free(attr->data);
|
||||
_mesa_free(attr);
|
||||
attr = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _mesa_init_attrib( GLcontext *ctx )
|
||||
{
|
||||
/* Renderer and client attribute stacks */
|
||||
|
@@ -58,10 +58,14 @@ _mesa_PopClientAttrib( void );
|
||||
extern void
|
||||
_mesa_init_attrib( GLcontext *ctx );
|
||||
|
||||
extern void
|
||||
_mesa_free_attrib_data( GLcontext *ctx );
|
||||
|
||||
#else
|
||||
|
||||
/** No-op */
|
||||
#define _mesa_init_attrib( c ) ((void)0)
|
||||
#define _mesa_free_attrib_data( c ) ((void)0)
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -467,17 +467,12 @@ alloc_shared_state( GLcontext *ctx )
|
||||
if (!ss->DefaultRect)
|
||||
goto cleanup;
|
||||
|
||||
/* Effectively bind the default textures to all texture units */
|
||||
ss->Default1D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
|
||||
ss->Default2D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
|
||||
ss->Default3D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
|
||||
ss->DefaultCubeMap->RefCount += MAX_TEXTURE_IMAGE_UNITS;
|
||||
ss->DefaultRect->RefCount += MAX_TEXTURE_IMAGE_UNITS;
|
||||
/* sanity check */
|
||||
assert(ss->Default1D->RefCount == 1);
|
||||
|
||||
_glthread_INIT_MUTEX(ss->TexMutex);
|
||||
ss->TextureStateStamp = 0;
|
||||
|
||||
|
||||
#if FEATURE_EXT_framebuffer_object
|
||||
ss->FrameBuffers = _mesa_NewHashTable();
|
||||
if (!ss->FrameBuffers)
|
||||
@@ -487,10 +482,9 @@ alloc_shared_state( GLcontext *ctx )
|
||||
goto cleanup;
|
||||
#endif
|
||||
|
||||
|
||||
return GL_TRUE;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
/* Ran out of memory at some point. Free everything and return NULL */
|
||||
if (ss->DisplayList)
|
||||
_mesa_DeleteHashTable(ss->DisplayList);
|
||||
@@ -634,6 +628,33 @@ delete_shader_cb(GLuint id, void *data, void *userData)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for deleting a framebuffer object. Called by _mesa_HashDeleteAll()
|
||||
*/
|
||||
static void
|
||||
delete_framebuffer_cb(GLuint id, void *data, void *userData)
|
||||
{
|
||||
struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
|
||||
/* The fact that the framebuffer is in the hashtable means its refcount
|
||||
* is one, but we're removing from the hashtable now. So clear refcount.
|
||||
*/
|
||||
/*assert(fb->RefCount == 1);*/
|
||||
fb->RefCount = 0;
|
||||
fb->Delete(fb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for deleting a renderbuffer object. Called by _mesa_HashDeleteAll()
|
||||
*/
|
||||
static void
|
||||
delete_renderbuffer_cb(GLuint id, void *data, void *userData)
|
||||
{
|
||||
struct gl_renderbuffer *rb = (struct gl_renderbuffer *) data;
|
||||
rb->RefCount = 0; /* see comment for FBOs above */
|
||||
rb->Delete(rb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Deallocate a shared state object and all children structures.
|
||||
@@ -656,20 +677,6 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
|
||||
_mesa_HashDeleteAll(ss->DisplayList, delete_displaylist_cb, ctx);
|
||||
_mesa_DeleteHashTable(ss->DisplayList);
|
||||
|
||||
/*
|
||||
* Free texture objects
|
||||
*/
|
||||
ASSERT(ctx->Driver.DeleteTexture);
|
||||
/* the default textures */
|
||||
ctx->Driver.DeleteTexture(ctx, ss->Default1D);
|
||||
ctx->Driver.DeleteTexture(ctx, ss->Default2D);
|
||||
ctx->Driver.DeleteTexture(ctx, ss->Default3D);
|
||||
ctx->Driver.DeleteTexture(ctx, ss->DefaultCubeMap);
|
||||
ctx->Driver.DeleteTexture(ctx, ss->DefaultRect);
|
||||
/* all other textures */
|
||||
_mesa_HashDeleteAll(ss->TexObjects, delete_texture_cb, ctx);
|
||||
_mesa_DeleteHashTable(ss->TexObjects);
|
||||
|
||||
#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_NV_fragment_program)
|
||||
_mesa_HashDeleteAll(ss->Programs, delete_program_cb, ctx);
|
||||
_mesa_DeleteHashTable(ss->Programs);
|
||||
@@ -701,10 +708,27 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
|
||||
#endif
|
||||
|
||||
#if FEATURE_EXT_framebuffer_object
|
||||
_mesa_HashDeleteAll(ss->FrameBuffers, delete_framebuffer_cb, ctx);
|
||||
_mesa_DeleteHashTable(ss->FrameBuffers);
|
||||
_mesa_HashDeleteAll(ss->RenderBuffers, delete_renderbuffer_cb, ctx);
|
||||
_mesa_DeleteHashTable(ss->RenderBuffers);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Free texture objects (after FBOs since some textures might have
|
||||
* been bound to FBOs).
|
||||
*/
|
||||
ASSERT(ctx->Driver.DeleteTexture);
|
||||
/* the default textures */
|
||||
ctx->Driver.DeleteTexture(ctx, ss->Default1D);
|
||||
ctx->Driver.DeleteTexture(ctx, ss->Default2D);
|
||||
ctx->Driver.DeleteTexture(ctx, ss->Default3D);
|
||||
ctx->Driver.DeleteTexture(ctx, ss->DefaultCubeMap);
|
||||
ctx->Driver.DeleteTexture(ctx, ss->DefaultRect);
|
||||
/* all other textures */
|
||||
_mesa_HashDeleteAll(ss->TexObjects, delete_texture_cb, ctx);
|
||||
_mesa_DeleteHashTable(ss->TexObjects);
|
||||
|
||||
_glthread_DESTROY_MUTEX(ss->Mutex);
|
||||
|
||||
_mesa_free(ss);
|
||||
@@ -1157,18 +1181,20 @@ _mesa_create_context(const GLvisual *visual,
|
||||
void
|
||||
_mesa_free_context_data( GLcontext *ctx )
|
||||
{
|
||||
/* if we're destroying the current context, unbind it first */
|
||||
if (ctx == _mesa_get_current_context()) {
|
||||
_mesa_make_current(NULL, NULL, NULL);
|
||||
}
|
||||
else {
|
||||
/* unreference WinSysDraw/Read buffers */
|
||||
_mesa_unreference_framebuffer(&ctx->WinSysDrawBuffer);
|
||||
_mesa_unreference_framebuffer(&ctx->WinSysReadBuffer);
|
||||
_mesa_unreference_framebuffer(&ctx->DrawBuffer);
|
||||
_mesa_unreference_framebuffer(&ctx->ReadBuffer);
|
||||
if (!_mesa_get_current_context()){
|
||||
/* No current context, but we may need one in order to delete
|
||||
* texture objs, etc. So temporarily bind the context now.
|
||||
*/
|
||||
_mesa_make_current(ctx, NULL, NULL);
|
||||
}
|
||||
|
||||
/* unreference WinSysDraw/Read buffers */
|
||||
_mesa_unreference_framebuffer(&ctx->WinSysDrawBuffer);
|
||||
_mesa_unreference_framebuffer(&ctx->WinSysReadBuffer);
|
||||
_mesa_unreference_framebuffer(&ctx->DrawBuffer);
|
||||
_mesa_unreference_framebuffer(&ctx->ReadBuffer);
|
||||
|
||||
_mesa_free_attrib_data(ctx);
|
||||
_mesa_free_lighting_data( ctx );
|
||||
_mesa_free_eval_data( ctx );
|
||||
_mesa_free_texture_data( ctx );
|
||||
@@ -1200,6 +1226,11 @@ _mesa_free_context_data( GLcontext *ctx )
|
||||
|
||||
if (ctx->Extensions.String)
|
||||
_mesa_free((void *) ctx->Extensions.String);
|
||||
|
||||
/* unbind the context if it's currently bound */
|
||||
if (ctx == _mesa_get_current_context()) {
|
||||
_mesa_make_current(NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 7.0.1
|
||||
* Version: 7.0.2
|
||||
*
|
||||
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -5737,7 +5737,7 @@ execute_list(GLcontext *ctx, GLuint list)
|
||||
if (!dlist)
|
||||
return;
|
||||
|
||||
ctx->ListState.CallStack[ctx->ListState.CallDepth++] = dlist;
|
||||
ctx->ListState.CallDepth++;
|
||||
|
||||
if (ctx->Driver.BeginCallList)
|
||||
ctx->Driver.BeginCallList(ctx, dlist);
|
||||
@@ -6629,7 +6629,7 @@ execute_list(GLcontext *ctx, GLuint list)
|
||||
if (ctx->Driver.EndCallList)
|
||||
ctx->Driver.EndCallList(ctx);
|
||||
|
||||
ctx->ListState.CallStack[ctx->ListState.CallDepth--] = NULL;
|
||||
ctx->ListState.CallDepth--;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -150,22 +150,18 @@ _mesa_remove_attachment(GLcontext *ctx, struct gl_renderbuffer_attachment *att)
|
||||
{
|
||||
if (att->Type == GL_TEXTURE) {
|
||||
ASSERT(att->Texture);
|
||||
att->Texture->RefCount--;
|
||||
if (att->Texture->RefCount == 0) {
|
||||
ctx->Driver.DeleteTexture(ctx, att->Texture);
|
||||
if (ctx->Driver.FinishRenderTexture) {
|
||||
/* tell driver we're done rendering to this texobj */
|
||||
ctx->Driver.FinishRenderTexture(ctx, att);
|
||||
}
|
||||
else {
|
||||
/* tell driver that we're done rendering to this texture. */
|
||||
if (ctx->Driver.FinishRenderTexture) {
|
||||
ctx->Driver.FinishRenderTexture(ctx, att);
|
||||
}
|
||||
}
|
||||
att->Texture = NULL;
|
||||
_mesa_reference_texobj(&att->Texture, NULL); /* unbind */
|
||||
ASSERT(!att->Texture);
|
||||
}
|
||||
if (att->Type == GL_TEXTURE || att->Type == GL_RENDERBUFFER_EXT) {
|
||||
ASSERT(att->Renderbuffer);
|
||||
ASSERT(!att->Texture);
|
||||
_mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
|
||||
_mesa_reference_renderbuffer(&att->Renderbuffer, NULL); /* unbind */
|
||||
ASSERT(!att->Renderbuffer);
|
||||
}
|
||||
att->Type = GL_NONE;
|
||||
att->Complete = GL_TRUE;
|
||||
@@ -191,8 +187,8 @@ _mesa_set_texture_attachment(GLcontext *ctx,
|
||||
/* new attachment */
|
||||
_mesa_remove_attachment(ctx, att);
|
||||
att->Type = GL_TEXTURE;
|
||||
att->Texture = texObj;
|
||||
texObj->RefCount++;
|
||||
assert(!att->Texture);
|
||||
_mesa_reference_texobj(&att->Texture, texObj);
|
||||
}
|
||||
|
||||
/* always update these fields */
|
||||
@@ -983,6 +979,7 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
|
||||
return;
|
||||
}
|
||||
_mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newFb);
|
||||
ASSERT(newFb->RefCount == 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1006,8 +1003,10 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
|
||||
if (bindDrawBuf) {
|
||||
/* check if old FB had any texture attachments */
|
||||
check_end_texture_render(ctx, ctx->DrawBuffer);
|
||||
/* check if time to delete this framebuffer */
|
||||
|
||||
/* bind new drawing buffer */
|
||||
_mesa_reference_framebuffer(&ctx->DrawBuffer, newFb);
|
||||
|
||||
if (newFb->Name != 0) {
|
||||
/* check if newly bound framebuffer has any texture attachments */
|
||||
check_begin_texture_render(ctx, newFb);
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include "fbobject.h"
|
||||
#include "framebuffer.h"
|
||||
#include "renderbuffer.h"
|
||||
#include "texobj.h"
|
||||
|
||||
|
||||
|
||||
@@ -190,17 +191,11 @@ _mesa_free_framebuffer_data(struct gl_framebuffer *fb)
|
||||
_mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
|
||||
}
|
||||
if (att->Texture) {
|
||||
/* render to texture */
|
||||
att->Texture->RefCount--;
|
||||
if (att->Texture->RefCount == 0) {
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (ctx) {
|
||||
ctx->Driver.DeleteTexture(ctx, att->Texture);
|
||||
}
|
||||
}
|
||||
_mesa_reference_texobj(&att->Texture, NULL);
|
||||
}
|
||||
ASSERT(!att->Renderbuffer);
|
||||
ASSERT(!att->Texture);
|
||||
att->Type = GL_NONE;
|
||||
att->Texture = NULL;
|
||||
}
|
||||
|
||||
/* unbind _Depth/_StencilBuffer to decr ref counts */
|
||||
|
@@ -3794,7 +3794,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n,
|
||||
GLint *dst = (GLint *) dest;
|
||||
GLuint i;
|
||||
for (i=0;i<n;i++) {
|
||||
*dst++ = (GLint) source[i];
|
||||
dst[i] = (GLint) source[i];
|
||||
}
|
||||
if (dstPacking->SwapBytes) {
|
||||
_mesa_swap4( (GLuint *) dst, n );
|
||||
|
@@ -1523,12 +1523,6 @@ struct gl_texture_unit
|
||||
|
||||
struct gl_texture_object *_Current; /**< Points to really enabled tex obj */
|
||||
|
||||
struct gl_texture_object Saved1D; /**< only used by glPush/PopAttrib */
|
||||
struct gl_texture_object Saved2D;
|
||||
struct gl_texture_object Saved3D;
|
||||
struct gl_texture_object SavedCubeMap;
|
||||
struct gl_texture_object SavedRect;
|
||||
|
||||
/* GL_SGI_texture_color_table */
|
||||
struct gl_color_table ColorTable;
|
||||
struct gl_color_table ProxyColorTable;
|
||||
@@ -2848,7 +2842,6 @@ struct mesa_display_list
|
||||
*/
|
||||
struct gl_dlist_state
|
||||
{
|
||||
struct mesa_display_list *CallStack[MAX_LIST_NESTING];
|
||||
GLuint CallDepth; /**< Current recursion calling depth */
|
||||
|
||||
struct mesa_display_list *CurrentList;
|
||||
|
@@ -156,6 +156,11 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj )
|
||||
|
||||
(void) ctx;
|
||||
|
||||
/* Set Target to an invalid value. With some assertions elsewhere
|
||||
* we can try to detect possible use of deleted textures.
|
||||
*/
|
||||
texObj->Target = 0x99;
|
||||
|
||||
_mesa_free_colortable_data(&texObj->Palette);
|
||||
|
||||
/* free the texture images */
|
||||
@@ -188,6 +193,7 @@ void
|
||||
_mesa_copy_texture_object( struct gl_texture_object *dest,
|
||||
const struct gl_texture_object *src )
|
||||
{
|
||||
dest->Target = src->Target;
|
||||
dest->Name = src->Name;
|
||||
dest->Priority = src->Priority;
|
||||
dest->BorderColor[0] = src->BorderColor[0];
|
||||
@@ -219,6 +225,92 @@ _mesa_copy_texture_object( struct gl_texture_object *dest,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the given texture object is valid by examining its Target field.
|
||||
* For debugging only.
|
||||
*/
|
||||
static GLboolean
|
||||
valid_texture_object(const struct gl_texture_object *tex)
|
||||
{
|
||||
switch (tex->Target) {
|
||||
case 0:
|
||||
case GL_TEXTURE_1D:
|
||||
case GL_TEXTURE_2D:
|
||||
case GL_TEXTURE_3D:
|
||||
case GL_TEXTURE_CUBE_MAP_ARB:
|
||||
case GL_TEXTURE_RECTANGLE_NV:
|
||||
return GL_TRUE;
|
||||
case 0x99:
|
||||
_mesa_problem(NULL, "invalid reference to a deleted texture object");
|
||||
return GL_FALSE;
|
||||
default:
|
||||
_mesa_problem(NULL, "invalid texture object Target value");
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reference (or unreference) a texture object.
|
||||
* If '*ptr', decrement *ptr's refcount (and delete if it becomes zero).
|
||||
* If 'tex' is non-null, increment its refcount.
|
||||
*/
|
||||
void
|
||||
_mesa_reference_texobj(struct gl_texture_object **ptr,
|
||||
struct gl_texture_object *tex)
|
||||
{
|
||||
assert(ptr);
|
||||
if (*ptr == tex) {
|
||||
/* no change */
|
||||
return;
|
||||
}
|
||||
|
||||
if (*ptr) {
|
||||
/* Unreference the old texture */
|
||||
GLboolean deleteFlag = GL_FALSE;
|
||||
struct gl_texture_object *oldTex = *ptr;
|
||||
|
||||
assert(valid_texture_object(oldTex));
|
||||
|
||||
_glthread_LOCK_MUTEX(oldTex->Mutex);
|
||||
ASSERT(oldTex->RefCount > 0);
|
||||
oldTex->RefCount--;
|
||||
|
||||
deleteFlag = (oldTex->RefCount == 0);
|
||||
_glthread_UNLOCK_MUTEX(oldTex->Mutex);
|
||||
|
||||
if (deleteFlag) {
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (ctx)
|
||||
ctx->Driver.DeleteTexture(ctx, oldTex);
|
||||
else
|
||||
_mesa_problem(NULL, "Unable to delete texture, no context");
|
||||
}
|
||||
|
||||
*ptr = NULL;
|
||||
}
|
||||
assert(!*ptr);
|
||||
|
||||
if (tex) {
|
||||
/* reference new texture */
|
||||
assert(valid_texture_object(tex));
|
||||
_glthread_LOCK_MUTEX(tex->Mutex);
|
||||
if (tex->RefCount == 0) {
|
||||
/* this texture's being deleted (look just above) */
|
||||
/* Not sure this can every really happen. Warn if it does. */
|
||||
_mesa_problem(NULL, "referencing deleted texture object");
|
||||
*ptr = NULL;
|
||||
}
|
||||
else {
|
||||
tex->RefCount++;
|
||||
*ptr = tex;
|
||||
}
|
||||
_glthread_UNLOCK_MUTEX(tex->Mutex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Report why a texture object is incomplete.
|
||||
*
|
||||
@@ -620,8 +712,7 @@ unbind_texobj_from_fbo(GLcontext *ctx, struct gl_texture_object *texObj)
|
||||
|
||||
/**
|
||||
* Check if the given texture object is bound to any texture image units and
|
||||
* unbind it if so.
|
||||
* XXX all RefCount accesses should be protected by a mutex.
|
||||
* unbind it if so (revert to default textures).
|
||||
*/
|
||||
static void
|
||||
unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj)
|
||||
@@ -630,34 +721,20 @@ unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj)
|
||||
|
||||
for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) {
|
||||
struct gl_texture_unit *unit = &ctx->Texture.Unit[u];
|
||||
struct gl_texture_object **curr = NULL;
|
||||
|
||||
if (texObj == unit->Current1D) {
|
||||
curr = &unit->Current1D;
|
||||
unit->Current1D = ctx->Shared->Default1D;
|
||||
_mesa_reference_texobj(&unit->Current1D, ctx->Shared->Default1D);
|
||||
}
|
||||
else if (texObj == unit->Current2D) {
|
||||
curr = &unit->Current2D;
|
||||
unit->Current2D = ctx->Shared->Default2D;
|
||||
_mesa_reference_texobj(&unit->Current2D, ctx->Shared->Default2D);
|
||||
}
|
||||
else if (texObj == unit->Current3D) {
|
||||
curr = &unit->Current3D;
|
||||
unit->Current3D = ctx->Shared->Default3D;
|
||||
_mesa_reference_texobj(&unit->Current3D, ctx->Shared->Default3D);
|
||||
}
|
||||
else if (texObj == unit->CurrentCubeMap) {
|
||||
curr = &unit->CurrentCubeMap;
|
||||
unit->CurrentCubeMap = ctx->Shared->DefaultCubeMap;
|
||||
_mesa_reference_texobj(&unit->CurrentCubeMap, ctx->Shared->DefaultCubeMap);
|
||||
}
|
||||
else if (texObj == unit->CurrentRect) {
|
||||
curr = &unit->CurrentRect;
|
||||
unit->CurrentRect = ctx->Shared->DefaultRect;
|
||||
}
|
||||
|
||||
if (curr) {
|
||||
(*curr)->RefCount++;
|
||||
texObj->RefCount--;
|
||||
if (texObj == unit->_Current)
|
||||
unit->_Current = *curr;
|
||||
_mesa_reference_texobj(&unit->CurrentRect, ctx->Shared->DefaultRect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -693,8 +770,6 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures)
|
||||
= _mesa_lookup_texture(ctx, textures[i]);
|
||||
|
||||
if (delObj) {
|
||||
GLboolean deleted;
|
||||
|
||||
_mesa_lock_texture(ctx, delObj);
|
||||
|
||||
/* Check if texture is bound to any framebuffer objects.
|
||||
@@ -704,10 +779,12 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures)
|
||||
unbind_texobj_from_fbo(ctx, delObj);
|
||||
|
||||
/* Check if this texture is currently bound to any texture units.
|
||||
* If so, unbind it and decrement the reference count.
|
||||
* If so, unbind it.
|
||||
*/
|
||||
unbind_texobj_from_texunits(ctx, delObj);
|
||||
|
||||
_mesa_unlock_texture(ctx, delObj);
|
||||
|
||||
ctx->NewState |= _NEW_TEXTURE;
|
||||
|
||||
/* The texture _name_ is now free for re-use.
|
||||
@@ -717,23 +794,10 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures)
|
||||
_mesa_HashRemove(ctx->Shared->TexObjects, delObj->Name);
|
||||
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
|
||||
|
||||
/* The actual texture object will not be freed until it's no
|
||||
* longer bound in any context.
|
||||
* XXX all RefCount accesses should be protected by a mutex.
|
||||
/* Unreference the texobj. If refcount hits zero, the texture
|
||||
* will be deleted.
|
||||
*/
|
||||
delObj->RefCount--;
|
||||
deleted = (delObj->RefCount == 0);
|
||||
_mesa_unlock_texture(ctx, delObj);
|
||||
|
||||
/* We know that refcount went to zero above, so this is
|
||||
* the only pointer left to delObj, so we don't have to
|
||||
* worry about locking any more:
|
||||
*/
|
||||
if (deleted) {
|
||||
ASSERT(delObj->Name != 0); /* Never delete default tex objs */
|
||||
ASSERT(ctx->Driver.DeleteTexture);
|
||||
(*ctx->Driver.DeleteTexture)(ctx, delObj);
|
||||
}
|
||||
_mesa_reference_texobj(&delObj, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -761,7 +825,6 @@ _mesa_BindTexture( GLenum target, GLuint texName )
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
const GLuint unit = ctx->Texture.CurrentUnit;
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
|
||||
struct gl_texture_object *oldTexObj;
|
||||
struct gl_texture_object *newTexObj = NULL;
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
@@ -769,48 +832,6 @@ _mesa_BindTexture( GLenum target, GLuint texName )
|
||||
_mesa_debug(ctx, "glBindTexture %s %d\n",
|
||||
_mesa_lookup_enum_by_nr(target), (GLint) texName);
|
||||
|
||||
/*
|
||||
* Get pointer to currently bound texture object (oldTexObj)
|
||||
*/
|
||||
switch (target) {
|
||||
case GL_TEXTURE_1D:
|
||||
oldTexObj = texUnit->Current1D;
|
||||
break;
|
||||
case GL_TEXTURE_2D:
|
||||
oldTexObj = texUnit->Current2D;
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
oldTexObj = texUnit->Current3D;
|
||||
break;
|
||||
case GL_TEXTURE_CUBE_MAP_ARB:
|
||||
if (!ctx->Extensions.ARB_texture_cube_map) {
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glBindTexture(target)" );
|
||||
return;
|
||||
}
|
||||
oldTexObj = texUnit->CurrentCubeMap;
|
||||
break;
|
||||
case GL_TEXTURE_RECTANGLE_NV:
|
||||
if (!ctx->Extensions.NV_texture_rectangle) {
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glBindTexture(target)" );
|
||||
return;
|
||||
}
|
||||
oldTexObj = texUnit->CurrentRect;
|
||||
break;
|
||||
default:
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glBindTexture(target)" );
|
||||
return;
|
||||
}
|
||||
|
||||
if (oldTexObj->Name == texName) {
|
||||
/* XXX this might be wrong. If the texobj is in use by another
|
||||
* context and a texobj parameter was changed, this might be our
|
||||
* only chance to update this context's hardware state.
|
||||
* Note that some applications re-bind the same texture a lot so we
|
||||
* want to handle that case quickly.
|
||||
*/
|
||||
return; /* rebinding the same texture- no change */
|
||||
}
|
||||
|
||||
/*
|
||||
* Get pointer to new texture object (newTexObj)
|
||||
*/
|
||||
@@ -879,28 +900,30 @@ _mesa_BindTexture( GLenum target, GLuint texName )
|
||||
newTexObj->Target = target;
|
||||
}
|
||||
|
||||
/* XXX all RefCount accesses should be protected by a mutex. */
|
||||
newTexObj->RefCount++;
|
||||
assert(valid_texture_object(newTexObj));
|
||||
|
||||
/* do the actual binding, but first flush outstanding vertices:
|
||||
*/
|
||||
/* flush before changing binding */
|
||||
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
|
||||
|
||||
/* Do the actual binding. The refcount on the previously bound
|
||||
* texture object will be decremented. It'll be deleted if the
|
||||
* count hits zero.
|
||||
*/
|
||||
switch (target) {
|
||||
case GL_TEXTURE_1D:
|
||||
texUnit->Current1D = newTexObj;
|
||||
_mesa_reference_texobj(&texUnit->Current1D, newTexObj);
|
||||
break;
|
||||
case GL_TEXTURE_2D:
|
||||
texUnit->Current2D = newTexObj;
|
||||
_mesa_reference_texobj(&texUnit->Current2D, newTexObj);
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
texUnit->Current3D = newTexObj;
|
||||
_mesa_reference_texobj(&texUnit->Current3D, newTexObj);
|
||||
break;
|
||||
case GL_TEXTURE_CUBE_MAP_ARB:
|
||||
texUnit->CurrentCubeMap = newTexObj;
|
||||
_mesa_reference_texobj(&texUnit->CurrentCubeMap, newTexObj);
|
||||
break;
|
||||
case GL_TEXTURE_RECTANGLE_NV:
|
||||
texUnit->CurrentRect = newTexObj;
|
||||
_mesa_reference_texobj(&texUnit->CurrentRect, newTexObj);
|
||||
break;
|
||||
default:
|
||||
_mesa_problem(ctx, "bad target in BindTexture");
|
||||
@@ -910,18 +933,6 @@ _mesa_BindTexture( GLenum target, GLuint texName )
|
||||
/* Pass BindTexture call to device driver */
|
||||
if (ctx->Driver.BindTexture)
|
||||
(*ctx->Driver.BindTexture)( ctx, target, newTexObj );
|
||||
|
||||
/* Decrement the reference count on the old texture and check if it's
|
||||
* time to delete it.
|
||||
*/
|
||||
/* XXX all RefCount accesses should be protected by a mutex. */
|
||||
oldTexObj->RefCount--;
|
||||
ASSERT(oldTexObj->RefCount >= 0);
|
||||
if (oldTexObj->RefCount == 0) {
|
||||
ASSERT(oldTexObj->Name != 0);
|
||||
ASSERT(ctx->Driver.DeleteTexture);
|
||||
(*ctx->Driver.DeleteTexture)( ctx, oldTexObj );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -57,6 +57,10 @@ extern void
|
||||
_mesa_copy_texture_object( struct gl_texture_object *dest,
|
||||
const struct gl_texture_object *src );
|
||||
|
||||
extern void
|
||||
_mesa_reference_texobj(struct gl_texture_object **ptr,
|
||||
struct gl_texture_object *tex);
|
||||
|
||||
extern void
|
||||
_mesa_test_texobj_completeness( const GLcontext *ctx,
|
||||
struct gl_texture_object *obj );
|
||||
|
@@ -63,31 +63,6 @@ static const struct gl_tex_env_combine_state default_combine_state = {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Copy a texture binding. Helper used by _mesa_copy_texture_state().
|
||||
*/
|
||||
static void
|
||||
copy_texture_binding(const GLcontext *ctx,
|
||||
struct gl_texture_object **dst,
|
||||
struct gl_texture_object *src)
|
||||
{
|
||||
/* only copy if names differ (per OpenGL SI) */
|
||||
if ((*dst)->Name != src->Name) {
|
||||
/* unbind/delete dest binding which we're changing */
|
||||
(*dst)->RefCount--;
|
||||
if ((*dst)->RefCount == 0) {
|
||||
/* time to delete this texture object */
|
||||
ASSERT((*dst)->Name != 0);
|
||||
ASSERT(ctx->Driver.DeleteTexture);
|
||||
/* XXX cast-away const, unfortunately */
|
||||
(*ctx->Driver.DeleteTexture)((GLcontext *) ctx, *dst);
|
||||
}
|
||||
/* make new binding, incrementing ref count */
|
||||
*dst = src;
|
||||
src->RefCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Used by glXCopyContext to copy texture state from one context to another.
|
||||
@@ -144,16 +119,16 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst )
|
||||
/* copy texture object bindings, not contents of texture objects */
|
||||
_mesa_lock_context_textures(dst);
|
||||
|
||||
copy_texture_binding(src, &dst->Texture.Unit[i].Current1D,
|
||||
src->Texture.Unit[i].Current1D);
|
||||
copy_texture_binding(src, &dst->Texture.Unit[i].Current2D,
|
||||
src->Texture.Unit[i].Current2D);
|
||||
copy_texture_binding(src, &dst->Texture.Unit[i].Current3D,
|
||||
src->Texture.Unit[i].Current3D);
|
||||
copy_texture_binding(src, &dst->Texture.Unit[i].CurrentCubeMap,
|
||||
src->Texture.Unit[i].CurrentCubeMap);
|
||||
copy_texture_binding(src, &dst->Texture.Unit[i].CurrentRect,
|
||||
src->Texture.Unit[i].CurrentRect);
|
||||
_mesa_reference_texobj(&dst->Texture.Unit[i].Current1D,
|
||||
src->Texture.Unit[i].Current1D);
|
||||
_mesa_reference_texobj(&dst->Texture.Unit[i].Current2D,
|
||||
src->Texture.Unit[i].Current2D);
|
||||
_mesa_reference_texobj(&dst->Texture.Unit[i].Current3D,
|
||||
src->Texture.Unit[i].Current3D);
|
||||
_mesa_reference_texobj(&dst->Texture.Unit[i].CurrentCubeMap,
|
||||
src->Texture.Unit[i].CurrentCubeMap);
|
||||
_mesa_reference_texobj(&dst->Texture.Unit[i].CurrentRect,
|
||||
src->Texture.Unit[i].CurrentRect);
|
||||
|
||||
_mesa_unlock_context_textures(dst);
|
||||
}
|
||||
@@ -3032,6 +3007,8 @@ alloc_proxy_textures( GLcontext *ctx )
|
||||
if (!ctx->Texture.ProxyRect)
|
||||
goto cleanup;
|
||||
|
||||
assert(ctx->Texture.Proxy1D->RefCount == 1);
|
||||
|
||||
return GL_TRUE;
|
||||
|
||||
cleanup:
|
||||
@@ -3087,11 +3064,12 @@ init_texture_unit( GLcontext *ctx, GLuint unit )
|
||||
ASSIGN_4V( texUnit->EyePlaneR, 0.0, 0.0, 0.0, 0.0 );
|
||||
ASSIGN_4V( texUnit->EyePlaneQ, 0.0, 0.0, 0.0, 0.0 );
|
||||
|
||||
texUnit->Current1D = ctx->Shared->Default1D;
|
||||
texUnit->Current2D = ctx->Shared->Default2D;
|
||||
texUnit->Current3D = ctx->Shared->Default3D;
|
||||
texUnit->CurrentCubeMap = ctx->Shared->DefaultCubeMap;
|
||||
texUnit->CurrentRect = ctx->Shared->DefaultRect;
|
||||
/* initialize current texture object ptrs to the shared default objects */
|
||||
_mesa_reference_texobj(&texUnit->Current1D, ctx->Shared->Default1D);
|
||||
_mesa_reference_texobj(&texUnit->Current2D, ctx->Shared->Default2D);
|
||||
_mesa_reference_texobj(&texUnit->Current3D, ctx->Shared->Default3D);
|
||||
_mesa_reference_texobj(&texUnit->CurrentCubeMap, ctx->Shared->DefaultCubeMap);
|
||||
_mesa_reference_texobj(&texUnit->CurrentRect, ctx->Shared->DefaultRect);
|
||||
}
|
||||
|
||||
|
||||
@@ -3106,21 +3084,20 @@ _mesa_init_texture(GLcontext *ctx)
|
||||
assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS);
|
||||
assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS);
|
||||
|
||||
/* Effectively bind the default textures to all texture units */
|
||||
ctx->Shared->Default1D->RefCount += MAX_TEXTURE_UNITS;
|
||||
ctx->Shared->Default2D->RefCount += MAX_TEXTURE_UNITS;
|
||||
ctx->Shared->Default3D->RefCount += MAX_TEXTURE_UNITS;
|
||||
ctx->Shared->DefaultCubeMap->RefCount += MAX_TEXTURE_UNITS;
|
||||
ctx->Shared->DefaultRect->RefCount += MAX_TEXTURE_UNITS;
|
||||
|
||||
/* Texture group */
|
||||
ctx->Texture.CurrentUnit = 0; /* multitexture */
|
||||
ctx->Texture._EnabledUnits = 0;
|
||||
for (i=0; i<MAX_TEXTURE_UNITS; i++)
|
||||
init_texture_unit( ctx, i );
|
||||
ctx->Texture.SharedPalette = GL_FALSE;
|
||||
_mesa_init_colortable(&ctx->Texture.Palette);
|
||||
|
||||
for (i = 0; i < MAX_TEXTURE_UNITS; i++)
|
||||
init_texture_unit( ctx, i );
|
||||
|
||||
/* After we're done initializing the context's texture state the default
|
||||
* texture objects' refcounts should be at least MAX_TEXTURE_UNITS + 1.
|
||||
*/
|
||||
assert(ctx->Shared->Default1D->RefCount >= MAX_TEXTURE_UNITS + 1);
|
||||
|
||||
_mesa_TexEnvProgramCacheInit( ctx );
|
||||
|
||||
/* Allocate proxy textures */
|
||||
@@ -3132,12 +3109,22 @@ _mesa_init_texture(GLcontext *ctx)
|
||||
|
||||
|
||||
/**
|
||||
* Free dynamically-allocted texture data attached to the given context.
|
||||
* Free dynamically-allocated texture data attached to the given context.
|
||||
*/
|
||||
void
|
||||
_mesa_free_texture_data(GLcontext *ctx)
|
||||
{
|
||||
GLuint i;
|
||||
GLuint u;
|
||||
|
||||
/* unreference current textures */
|
||||
for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) {
|
||||
struct gl_texture_unit *unit = ctx->Texture.Unit + u;
|
||||
_mesa_reference_texobj(&unit->Current1D, NULL);
|
||||
_mesa_reference_texobj(&unit->Current2D, NULL);
|
||||
_mesa_reference_texobj(&unit->Current3D, NULL);
|
||||
_mesa_reference_texobj(&unit->CurrentCubeMap, NULL);
|
||||
_mesa_reference_texobj(&unit->CurrentRect, NULL);
|
||||
}
|
||||
|
||||
/* Free proxy texture objects */
|
||||
(ctx->Driver.DeleteTexture)(ctx, ctx->Texture.Proxy1D );
|
||||
@@ -3146,8 +3133,8 @@ _mesa_free_texture_data(GLcontext *ctx)
|
||||
(ctx->Driver.DeleteTexture)(ctx, ctx->Texture.ProxyCubeMap );
|
||||
(ctx->Driver.DeleteTexture)(ctx, ctx->Texture.ProxyRect );
|
||||
|
||||
for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++)
|
||||
_mesa_free_colortable_data( &ctx->Texture.Unit[i].ColorTable );
|
||||
for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++)
|
||||
_mesa_free_colortable_data( &ctx->Texture.Unit[u].ColorTable );
|
||||
|
||||
_mesa_TexEnvProgramCacheDestroy( ctx );
|
||||
}
|
||||
|
@@ -440,7 +440,7 @@ _mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle)
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glPassTexCoordATI(coord)");
|
||||
return;
|
||||
}
|
||||
if ((swizzle < GL_SWIZZLE_STR_ATI) && (swizzle > GL_SWIZZLE_STQ_DQ_ATI)) {
|
||||
if (!(swizzle >= GL_SWIZZLE_STR_ATI) && (swizzle <= GL_SWIZZLE_STQ_DQ_ATI)) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glPassTexCoordATI(swizzle)");
|
||||
return;
|
||||
}
|
||||
@@ -513,7 +513,7 @@ _mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle)
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glSampleMapATI(interp)");
|
||||
return;
|
||||
}
|
||||
if ((swizzle < GL_SWIZZLE_STR_ATI) && (swizzle > GL_SWIZZLE_STQ_DQ_ATI)) {
|
||||
if (!(swizzle >= GL_SWIZZLE_STR_ATI) && (swizzle <= GL_SWIZZLE_STQ_DQ_ATI)) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glSampleMapATI(swizzle)");
|
||||
return;
|
||||
}
|
||||
|
@@ -378,7 +378,7 @@ _mesa_attach_shader(GLcontext *ctx, GLuint program, GLuint shader)
|
||||
struct gl_shader_program *shProg
|
||||
= _mesa_lookup_shader_program(ctx, program);
|
||||
struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
|
||||
const GLuint n = shProg->NumShaders;
|
||||
GLuint n;
|
||||
GLuint i;
|
||||
|
||||
if (!shProg || !sh) {
|
||||
@@ -387,6 +387,8 @@ _mesa_attach_shader(GLcontext *ctx, GLuint program, GLuint shader)
|
||||
return;
|
||||
}
|
||||
|
||||
n = shProg->NumShaders;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (shProg->Shaders[i] == sh) {
|
||||
/* already attached */
|
||||
@@ -548,7 +550,7 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader)
|
||||
{
|
||||
struct gl_shader_program *shProg
|
||||
= _mesa_lookup_shader_program(ctx, program);
|
||||
const GLuint n = shProg->NumShaders;
|
||||
GLuint n;
|
||||
GLuint i, j;
|
||||
|
||||
if (!shProg) {
|
||||
@@ -557,6 +559,8 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader)
|
||||
return;
|
||||
}
|
||||
|
||||
n = shProg->NumShaders;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (shProg->Shaders[i]->Name == shader) {
|
||||
/* found it */
|
||||
|
@@ -217,9 +217,9 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
||||
}
|
||||
else {
|
||||
/* even size */
|
||||
xmin = (GLint) vert->win[0] - iRadius + 1;
|
||||
xmin = (GLint) vert->win[0] - iRadius;
|
||||
xmax = xmin + iSize - 1;
|
||||
ymin = (GLint) vert->win[1] - iRadius + 1;
|
||||
ymin = (GLint) vert->win[1] - iRadius;
|
||||
ymax = ymin + iSize - 1;
|
||||
}
|
||||
#endif /*SMOOTH*/
|
||||
|
@@ -129,6 +129,13 @@ static GLuint attr_size( const struct gl_client_array *array )
|
||||
*/
|
||||
static GLboolean check_flush( struct copy_context *copy )
|
||||
{
|
||||
GLenum mode = copy->dstprim[copy->dstprim_nr].mode;
|
||||
|
||||
if (GL_TRIANGLE_STRIP == mode &&
|
||||
copy->dstelt_nr & 1) { /* see bug9962 */
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
if (copy->dstbuf_nr + 4 > copy->dstbuf_size)
|
||||
return GL_TRUE;
|
||||
|
||||
@@ -458,7 +465,7 @@ static void replay_init( struct copy_context *copy )
|
||||
dst->StrideB = copy->vertex_size;
|
||||
dst->Ptr = copy->dstbuf + offset;
|
||||
dst->Enabled = GL_TRUE;
|
||||
dst->Normalized = GL_TRUE;
|
||||
dst->Normalized = src->Normalized;
|
||||
dst->BufferObj = ctx->Array.NullBufferObj;
|
||||
dst->_MaxElement = copy->dstbuf_size; /* may be less! */
|
||||
|
||||
|
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
* This file is automatically generated from the Mesa internal type
|
||||
* definitions. Do not edit directly.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_TYPES_H__
|
||||
#define __ASM_TYPES_H__
|
||||
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for GLcontext
|
||||
*/
|
||||
|
||||
#define CTX_DRIVER_CTX 952
|
||||
|
||||
#define CTX_LIGHT_ENABLED 39312
|
||||
#define CTX_LIGHT_SHADE_MODEL 39316
|
||||
#define CTX_LIGHT_COLOR_MAT_FACE 39320
|
||||
#define CTX_LIGHT_COLOR_MAT_MODE 39324
|
||||
#define CTX_LIGHT_COLOR_MAT_MASK 39328
|
||||
#define CTX_LIGHT_COLOR_MAT_ENABLED 39332
|
||||
#define CTX_LIGHT_ENABLED_LIST 39340
|
||||
#define CTX_LIGHT_NEED_VERTS 43701
|
||||
#define CTX_LIGHT_FLAGS 43704
|
||||
#define CTX_LIGHT_BASE_COLOR 43708
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for struct vertex_buffer
|
||||
*/
|
||||
|
||||
#define VB_SIZE 0
|
||||
#define VB_COUNT 4
|
||||
|
||||
#define VB_ELTS 8
|
||||
#define VB_OBJ_PTR 12
|
||||
#define VB_EYE_PTR 16
|
||||
#define VB_CLIP_PTR 20
|
||||
#define VB_PROJ_CLIP_PTR 24
|
||||
#define VB_CLIP_OR_MASK 28
|
||||
#define VB_CLIP_MASK 32
|
||||
#define VB_NORMAL_PTR 36
|
||||
#define VB_EDGE_FLAG 44
|
||||
#define VB_TEX0_COORD_PTR 48
|
||||
#define VB_TEX1_COORD_PTR 52
|
||||
#define VB_TEX2_COORD_PTR 56
|
||||
#define VB_TEX3_COORD_PTR 60
|
||||
#define VB_INDEX_PTR 80
|
||||
#define VB_COLOR_PTR 88
|
||||
#define VB_SECONDARY_COLOR_PTR 96
|
||||
#define VB_FOG_COORD_PTR 104
|
||||
#define VB_PRIMITIVE 108
|
||||
|
||||
|
||||
/*
|
||||
* Flags for struct vertex_buffer
|
||||
*/
|
||||
|
||||
#define VERT_BIT_OBJ 0x1
|
||||
#define VERT_BIT_NORM 0x4
|
||||
#define VERT_BIT_RGBA 0x8
|
||||
#define VERT_BIT_SPEC_RGB 0x10
|
||||
#define VERT_BIT_FOG_COORD 0x20
|
||||
#define VERT_BIT_TEX0 0x100
|
||||
#define VERT_BIT_TEX1 0x200
|
||||
#define VERT_BIT_TEX2 0x400
|
||||
#define VERT_BIT_TEX3 0x800
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for GLvector4f
|
||||
*/
|
||||
|
||||
#define V4F_DATA 0
|
||||
#define V4F_START 4
|
||||
#define V4F_COUNT 8
|
||||
#define V4F_STRIDE 12
|
||||
#define V4F_SIZE 16
|
||||
#define V4F_FLAGS 20
|
||||
|
||||
/*
|
||||
* Flags for GLvector4f
|
||||
*/
|
||||
|
||||
#define VEC_MALLOC 0x10
|
||||
#define VEC_NOT_WRITEABLE 0x40
|
||||
#define VEC_BAD_STRIDE 0x100
|
||||
|
||||
#define VEC_SIZE_1 0x1
|
||||
#define VEC_SIZE_2 0x3
|
||||
#define VEC_SIZE_3 0x7
|
||||
#define VEC_SIZE_4 0xf
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for GLmatrix
|
||||
*/
|
||||
|
||||
#define MATRIX_DATA 0
|
||||
#define MATRIX_INV 4
|
||||
#define MATRIX_FLAGS 8
|
||||
#define MATRIX_TYPE 12
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for struct gl_light
|
||||
*/
|
||||
|
||||
#define LIGHT_NEXT 0
|
||||
#define LIGHT_PREV 4
|
||||
|
||||
#define LIGHT_AMBIENT 8
|
||||
#define LIGHT_DIFFUSE 24
|
||||
#define LIGHT_SPECULAR 40
|
||||
#define LIGHT_EYE_POSITION 56
|
||||
#define LIGHT_EYE_DIRECTION 72
|
||||
#define LIGHT_SPOT_EXPONENT 88
|
||||
#define LIGHT_SPOT_CUTOFF 92
|
||||
#define LIGHT_COS_CUTOFF 100
|
||||
#define LIGHT_CONST_ATTEN 104
|
||||
#define LIGHT_LINEAR_ATTEN 108
|
||||
#define LIGHT_QUADRATIC_ATTEN 112
|
||||
#define LIGHT_ENABLED 116
|
||||
|
||||
#define LIGHT_FLAGS 120
|
||||
|
||||
#define LIGHT_POSITION 124
|
||||
#define LIGHT_VP_INF_NORM 140
|
||||
#define LIGHT_H_INF_NORM 152
|
||||
#define LIGHT_NORM_DIRECTION 164
|
||||
#define LIGHT_VP_INF_SPOT_ATTEN 180
|
||||
|
||||
#define LIGHT_SPOT_EXP_TABLE 184
|
||||
#define LIGHT_MAT_AMBIENT 4280
|
||||
#define LIGHT_MAT_DIFFUSE 4304
|
||||
#define LIGHT_MAT_SPECULAR 4328
|
||||
|
||||
#define SIZEOF_GL_LIGHT 4360
|
||||
|
||||
/*
|
||||
* Flags for struct gl_light
|
||||
*/
|
||||
|
||||
#define LIGHT_SPOT 0x1
|
||||
#define LIGHT_LOCAL_VIEWER 0x2
|
||||
#define LIGHT_POSITIONAL 0x4
|
||||
|
||||
#define LIGHT_NEED_VERTICES 0x6
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for struct gl_lightmodel
|
||||
*/
|
||||
|
||||
#define LIGHT_MODEL_AMBIENT 0
|
||||
#define LIGHT_MODEL_LOCAL_VIEWER 16
|
||||
#define LIGHT_MODEL_TWO_SIDE 17
|
||||
#define LIGHT_MODEL_COLOR_CONTROL 20
|
||||
|
||||
|
||||
#endif /* __ASM_TYPES_H__ */
|
@@ -1,163 +0,0 @@
|
||||
/*
|
||||
* This file is automatically generated from the Mesa internal type
|
||||
* definitions. Do not edit directly.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_TYPES_H__
|
||||
#define __ASM_TYPES_H__
|
||||
|
||||
#include "assyntax.h"
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for GLcontext
|
||||
*/
|
||||
|
||||
#define CTX_DRIVER_CTX 952
|
||||
|
||||
#define CTX_LIGHT_ENABLED 39312
|
||||
#define CTX_LIGHT_SHADE_MODEL 39316
|
||||
#define CTX_LIGHT_COLOR_MAT_FACE 39320
|
||||
#define CTX_LIGHT_COLOR_MAT_MODE 39324
|
||||
#define CTX_LIGHT_COLOR_MAT_MASK 39328
|
||||
#define CTX_LIGHT_COLOR_MAT_ENABLED 39332
|
||||
#define CTX_LIGHT_ENABLED_LIST 39340
|
||||
#define CTX_LIGHT_NEED_VERTS 43701
|
||||
#define CTX_LIGHT_FLAGS 43704
|
||||
#define CTX_LIGHT_BASE_COLOR 43708
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for struct vertex_buffer
|
||||
*/
|
||||
|
||||
#define VB_SIZE 0
|
||||
#define VB_COUNT 4
|
||||
|
||||
#define VB_ELTS 8
|
||||
#define VB_OBJ_PTR 12
|
||||
#define VB_EYE_PTR 16
|
||||
#define VB_CLIP_PTR 20
|
||||
#define VB_PROJ_CLIP_PTR 24
|
||||
#define VB_CLIP_OR_MASK 28
|
||||
#define VB_CLIP_MASK 32
|
||||
#define VB_NORMAL_PTR 36
|
||||
#define VB_EDGE_FLAG 44
|
||||
#define VB_TEX0_COORD_PTR 48
|
||||
#define VB_TEX1_COORD_PTR 52
|
||||
#define VB_TEX2_COORD_PTR 56
|
||||
#define VB_TEX3_COORD_PTR 60
|
||||
#define VB_INDEX_PTR 80
|
||||
#define VB_COLOR_PTR 88
|
||||
#define VB_SECONDARY_COLOR_PTR 96
|
||||
#define VB_FOG_COORD_PTR 104
|
||||
#define VB_PRIMITIVE 108
|
||||
|
||||
|
||||
/*
|
||||
* Flags for struct vertex_buffer
|
||||
*/
|
||||
|
||||
#define VERT_BIT_OBJ 0x1
|
||||
#define VERT_BIT_NORM 0x4
|
||||
#define VERT_BIT_RGBA 0x8
|
||||
#define VERT_BIT_SPEC_RGB 0x10
|
||||
#define VERT_BIT_FOG_COORD 0x20
|
||||
#define VERT_BIT_TEX0 0x100
|
||||
#define VERT_BIT_TEX1 0x200
|
||||
#define VERT_BIT_TEX2 0x400
|
||||
#define VERT_BIT_TEX3 0x800
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for GLvector4f
|
||||
*/
|
||||
|
||||
#define V4F_DATA 0
|
||||
#define V4F_START 4
|
||||
#define V4F_COUNT 8
|
||||
#define V4F_STRIDE 12
|
||||
#define V4F_SIZE 16
|
||||
#define V4F_FLAGS 20
|
||||
|
||||
/*
|
||||
* Flags for GLvector4f
|
||||
*/
|
||||
|
||||
#define VEC_MALLOC 0x10
|
||||
#define VEC_NOT_WRITEABLE 0x40
|
||||
#define VEC_BAD_STRIDE 0x100
|
||||
|
||||
#define VEC_SIZE_1 0x1
|
||||
#define VEC_SIZE_2 0x3
|
||||
#define VEC_SIZE_3 0x7
|
||||
#define VEC_SIZE_4 0xf
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for GLmatrix
|
||||
*/
|
||||
|
||||
#define MATRIX_DATA 0
|
||||
#define MATRIX_INV 4
|
||||
#define MATRIX_FLAGS 8
|
||||
#define MATRIX_TYPE 12
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for struct gl_light
|
||||
*/
|
||||
|
||||
#define LIGHT_NEXT 0
|
||||
#define LIGHT_PREV 4
|
||||
|
||||
#define LIGHT_AMBIENT 8
|
||||
#define LIGHT_DIFFUSE 24
|
||||
#define LIGHT_SPECULAR 40
|
||||
#define LIGHT_EYE_POSITION 56
|
||||
#define LIGHT_EYE_DIRECTION 72
|
||||
#define LIGHT_SPOT_EXPONENT 88
|
||||
#define LIGHT_SPOT_CUTOFF 92
|
||||
#define LIGHT_COS_CUTOFF 100
|
||||
#define LIGHT_CONST_ATTEN 104
|
||||
#define LIGHT_LINEAR_ATTEN 108
|
||||
#define LIGHT_QUADRATIC_ATTEN 112
|
||||
#define LIGHT_ENABLED 116
|
||||
|
||||
#define LIGHT_FLAGS 120
|
||||
|
||||
#define LIGHT_POSITION 124
|
||||
#define LIGHT_VP_INF_NORM 140
|
||||
#define LIGHT_H_INF_NORM 152
|
||||
#define LIGHT_NORM_DIRECTION 164
|
||||
#define LIGHT_VP_INF_SPOT_ATTEN 180
|
||||
|
||||
#define LIGHT_SPOT_EXP_TABLE 184
|
||||
#define LIGHT_MAT_AMBIENT 4280
|
||||
#define LIGHT_MAT_DIFFUSE 4304
|
||||
#define LIGHT_MAT_SPECULAR 4328
|
||||
|
||||
#define SIZEOF_GL_LIGHT 4360
|
||||
|
||||
/*
|
||||
* Flags for struct gl_light
|
||||
*/
|
||||
|
||||
#define LIGHT_SPOT 0x1
|
||||
#define LIGHT_LOCAL_VIEWER 0x2
|
||||
#define LIGHT_POSITIONAL 0x4
|
||||
|
||||
#define LIGHT_NEED_VERTICES 0x6
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Offsets for struct gl_lightmodel
|
||||
*/
|
||||
|
||||
#define LIGHT_MODEL_AMBIENT 0
|
||||
#define LIGHT_MODEL_LOCAL_VIEWER 16
|
||||
#define LIGHT_MODEL_TWO_SIDE 17
|
||||
#define LIGHT_MODEL_COLOR_CONTROL 20
|
||||
|
||||
|
||||
#endif /* __ASM_TYPES_H__ */
|
Reference in New Issue
Block a user