Compare commits
25 Commits
mesa_6_5_3
...
mesa_6_5_3
Author | SHA1 | Date | |
---|---|---|---|
|
02e958a1e4 | ||
|
cce5084941 | ||
|
4b1d1b7b18 | ||
|
7ff72a7659 | ||
|
c4b3b8dece | ||
|
65bab0dad8 | ||
|
74edc663a6 | ||
|
54d59cfb70 | ||
|
b7f5b8af65 | ||
|
4099531a0a | ||
|
1606f2c123 | ||
|
1dd7c00214 | ||
|
f42d4ab41e | ||
|
4a28548cbf | ||
|
5814922d25 | ||
|
3de20aead2 | ||
|
6d27194dff | ||
|
c233aa2768 | ||
|
c93b2a1cb7 | ||
|
eca456b63d | ||
|
4003bde6ff | ||
|
ddcf819906 | ||
|
9ede048127 | ||
|
97693436a5 | ||
|
8a8a5bd104 |
8
Makefile
8
Makefile
@@ -155,10 +155,10 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
DIRECTORY = Mesa-6.5.3rc3
|
||||
LIB_NAME = MesaLib-6.5.3rc3
|
||||
DEMO_NAME = MesaDemos-6.5.3rc3
|
||||
GLUT_NAME = MesaGLUT-6.5.3rc3
|
||||
DIRECTORY = Mesa-6.5.3
|
||||
LIB_NAME = MesaLib-6.5.3
|
||||
DEMO_NAME = MesaDemos-6.5.3
|
||||
GLUT_NAME = MesaGLUT-6.5.3
|
||||
|
||||
MAIN_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
|
@@ -1,155 +1,163 @@
|
||||
File: docs/README.WIN32
|
||||
|
||||
Last updated: Mar 31, 2006 - Karl Schultz - kschultz@users.sourceforge.net
|
||||
|
||||
Quick Start
|
||||
----- -----
|
||||
|
||||
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
|
||||
directory. The libs and demos build separately, so if you do not care
|
||||
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
|
||||
more than one ZIP file, they all need to be unzipped into the same
|
||||
directory. Don't worry, you will not overwrite anything.
|
||||
|
||||
The Windows build system uses Microsoft Visual Studio. Project files
|
||||
for a specific version of Visual Studio are in their own directory in
|
||||
the top-level "windows" directory. For example, Visual Studio 6 files
|
||||
are in windows/VC6. If a directory does not exist for your version of
|
||||
Visual Studio, you can try importing the project files from an earlier
|
||||
version of Visual Studio. At this time, project files exist for
|
||||
Version 6 and Version 7. The code has been built with a beta version
|
||||
of Version 8 and it runs on 64-bit Windows. If you want to try this,
|
||||
start by importing the VC7 files and create the 64-bit targets in the
|
||||
configuration manager.
|
||||
|
||||
It is likely that the new and free Visual Studio Express can be used
|
||||
to build Mesa, but it hasn't been tried yet. Start with the VC7
|
||||
project files.
|
||||
|
||||
The project files to build the core Mesa library, Windows Mesa
|
||||
drivers, OSMesa, and GLU are in the mesa directory. The project files
|
||||
to build GLUT and some demo programs are in the progs directory.
|
||||
|
||||
Makefiles are no longer shipped or supported, but can be generated
|
||||
from the projects using Visual Studio.
|
||||
|
||||
|
||||
Windows Drivers
|
||||
------- -------
|
||||
|
||||
At this time, only the GDI driver is known to work. Most of the demos
|
||||
in progs/demos should work with this driver.
|
||||
|
||||
Source code also exists in the tree for other drivers in
|
||||
src/mesa/drivers/windows, but the status of this code is unknown.
|
||||
|
||||
The GDI driver operates basically by writing pixel spans into a DIB
|
||||
section and then blitting the DIB to the window. The driver was
|
||||
recently cleaned up and rewitten and so may have bugs or may be
|
||||
missing some functionality. The older versions of the CVS source may
|
||||
be useful in figuring out any problems, or report them to me.
|
||||
|
||||
To build Mesa with the GDI driver, build the mesa, gdi, and glu
|
||||
projects in the Visual Studio workspace found at
|
||||
|
||||
windows/VC6/mesa/mesa.dsw
|
||||
or
|
||||
windows/VC7/mesa/mesa.sln
|
||||
|
||||
The osmesa DLL can also be built with the osmesa project.
|
||||
|
||||
The build system creates a lib top-level directory and copies
|
||||
resulting LIB and DLL files to this lib directory. The files are:
|
||||
|
||||
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
|
||||
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
|
||||
|
||||
If the MesaDemos ZIP file was extracted, the DLL files are also copied
|
||||
to the demos directory. This facilitates running the demos as described
|
||||
below.
|
||||
|
||||
|
||||
GLUT and Demos
|
||||
---- --- -----
|
||||
|
||||
A Visual Studio workspace can be found at
|
||||
|
||||
windows/VC6/progs/progs.dsw
|
||||
or
|
||||
windows/VC7/progs/progs.sln
|
||||
|
||||
It can be used to build GLUT and a few demos. The GLUT lib and DLL
|
||||
are copied to the top-level lib directory, along with the Mesa libs.
|
||||
|
||||
The demo build system expects to find the LIB files in the top level
|
||||
lib directory, so you must build the Mesa libs first. The demo
|
||||
executables are placed in the demos directory, because some of them
|
||||
rely on data files found there. Also, the Mesa lib DLL's were copied
|
||||
there by the Mesa lib build process. Therefore, you should be able to
|
||||
simply run the demo executables from the demo directory.
|
||||
|
||||
If you want to run the demos from the Visual Studio, you may have to
|
||||
change the startup directory and explicitly state where the executables are.
|
||||
|
||||
You may also build all the demo programs by using a makefile. Go to
|
||||
the progs/demos directory and make sure you have executed VCVARS32.BAT
|
||||
or whatever setup script is appropriate for your compiler. Then,
|
||||
|
||||
nmake -f Makefile.win
|
||||
|
||||
should build all the demos.
|
||||
|
||||
|
||||
Build System Notes
|
||||
----- ------ -----
|
||||
|
||||
VC6
|
||||
---
|
||||
|
||||
Visual Studio 6 does not recognize files with the .cc extension as C++
|
||||
language files, without a lot of unnatural tweaking. So, the VC6
|
||||
build process uses custom build steps to compile these files in the
|
||||
GLU library.
|
||||
|
||||
Two additional configurations are provided, Debug x86 and Release x86
|
||||
that activate the shader code compilation by defining SLANG_86. It is
|
||||
unknown if and how this works.
|
||||
|
||||
VC7
|
||||
---
|
||||
|
||||
The above-mentioned .cc problem does not exist in this version.
|
||||
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
After building, you can copy the above DLL files to a place in your
|
||||
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
|
||||
in a system directory, place them in the same directory as the
|
||||
executable(s). Be careful about accidentially overwriting files of
|
||||
the same name in the SYSTEM32 directory.
|
||||
|
||||
The DLL files are built so that the external entry points use the
|
||||
stdcall calling convention.
|
||||
|
||||
Static LIB files are not built. The LIB files that are built with are
|
||||
the linker import files associated with the DLL files.
|
||||
|
||||
The si-glu sources are used to build the GLU libs. This was done
|
||||
mainly to get the better tessellator code.
|
||||
|
||||
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
|
||||
to the project settings. You will also need to edit src/mesa.def to
|
||||
change all the gl* symbols to mgl*. Because this is easy to do with a
|
||||
global replace operation in a text editor, no additional mangled
|
||||
version of mesa.def is maintained or shipped.
|
||||
|
||||
If you have a Windows-related build problem or question, it is
|
||||
probably better to direct it to me (kschultz@users.sourceforge.net),
|
||||
rather than directly to the other Mesa developers. I will help you as
|
||||
much as I can. I also monitor the Mesa mailing lists and will answer
|
||||
questions in this area there as well.
|
||||
|
||||
|
||||
Karl Schultz
|
||||
File: docs/README.WIN32
|
||||
|
||||
Last updated: Apr 25, 2007 - Karl Schultz - kschultz@users.sourceforge.net
|
||||
|
||||
Quick Start
|
||||
----- -----
|
||||
|
||||
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
|
||||
directory. The libs and demos build separately, so if you do not care
|
||||
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
|
||||
more than one ZIP file, they all need to be unzipped into the same
|
||||
directory. Don't worry, you will not overwrite anything.
|
||||
|
||||
The Windows build system uses Microsoft Visual Studio. Project files
|
||||
for a specific version of Visual Studio are in their own directory in
|
||||
the top-level "windows" directory. For example, Visual Studio 8 files
|
||||
are in windows/VC8.
|
||||
|
||||
Support has been dropped for versions of Visual Studio prior to 8. The
|
||||
main reason is because Microsoft now provides a free compiler and
|
||||
developer environment. Visual Studio Express can be found at
|
||||
|
||||
http://msdn.microsoft.com/vstudio/express/visualc/default.aspx
|
||||
|
||||
You'll also need the Platform SDK. Instructions for obtaining and
|
||||
using the SDK with Visual Studio Express can be found at
|
||||
|
||||
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
|
||||
|
||||
If you are stuck using VC6 or VC7, you may start with these project
|
||||
files, but you may need to modify them to reflect changes in the
|
||||
Mesa source code tree. If you sucessfully update the project files,
|
||||
please submit them to the author of this document so that they may
|
||||
be included in the next distribution.
|
||||
|
||||
The project files to build the core Mesa library, Windows Mesa
|
||||
drivers, OSMesa, and GLU are in the mesa directory. The project files
|
||||
to build GLUT and some demo programs are in the progs directory.
|
||||
|
||||
Makefiles are no longer shipped or supported, but can be generated
|
||||
from the projects using Visual Studio.
|
||||
|
||||
|
||||
Windows Drivers
|
||||
------- -------
|
||||
|
||||
At this time, only the GDI driver is known to work. Most of the demos
|
||||
in progs/demos should work with this driver.
|
||||
|
||||
Source code also exists in the tree for other drivers in
|
||||
src/mesa/drivers/windows, but the status of this code is unknown.
|
||||
|
||||
The GDI driver operates basically by writing pixel spans into a DIB
|
||||
section and then blitting the DIB to the window. The driver was
|
||||
recently cleaned up and rewitten and so may have bugs or may be
|
||||
missing some functionality. The older versions of the CVS source may
|
||||
be useful in figuring out any problems, or report them to me.
|
||||
|
||||
To build Mesa with the GDI driver, build the mesa, gdi, and glu
|
||||
projects in the Visual Studio workspace found at
|
||||
|
||||
windows/VC8/mesa/mesa.sln
|
||||
|
||||
The osmesa DLL can also be built with the osmesa project.
|
||||
|
||||
The build system creates a lib top-level directory and copies
|
||||
resulting LIB and DLL files to this lib directory. The files are:
|
||||
|
||||
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
|
||||
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
|
||||
|
||||
If the MesaDemos ZIP file was extracted, the DLL files are also copied
|
||||
to the demos directory. This facilitates running the demos as described
|
||||
below.
|
||||
|
||||
|
||||
GLUT and Demos
|
||||
---- --- -----
|
||||
|
||||
A Visual Studio workspace can be found at
|
||||
|
||||
windows/VC8/progs/progs.sln
|
||||
|
||||
It can be used to build GLUT and a few demos. The GLUT lib and DLL
|
||||
are copied to the top-level lib directory, along with the Mesa libs.
|
||||
|
||||
The demo build system expects to find the LIB files in the top level
|
||||
lib directory, so you must build the Mesa libs first. The demo
|
||||
executables are placed in the demos directory, because some of them
|
||||
rely on data files found there. Also, the Mesa lib DLL's were copied
|
||||
there by the Mesa lib build process. Therefore, you should be able to
|
||||
simply run the demo executables from the demo directory.
|
||||
|
||||
If you want to run the demos from the Visual Studio, you may have to
|
||||
change the startup directory and explicitly state where the executables are.
|
||||
|
||||
You may also build all the demo programs by using a makefile. Go to
|
||||
the progs/demos directory and make sure you have executed VCVARS32.BAT
|
||||
or whatever setup script is appropriate for your compiler. Then,
|
||||
|
||||
nmake -f Makefile.win
|
||||
|
||||
should build all the demos.
|
||||
|
||||
|
||||
Build System Notes
|
||||
----- ------ -----
|
||||
|
||||
VC6 (not actively supported)
|
||||
---
|
||||
|
||||
Visual Studio 6 does not recognize files with the .cc extension as C++
|
||||
language files, without a lot of unnatural tweaking. So, the VC6
|
||||
build process uses custom build steps to compile these files in the
|
||||
GLU library.
|
||||
|
||||
Two additional configurations are provided, Debug x86 and Release x86
|
||||
that activate the shader code compilation by defining SLANG_86. It is
|
||||
unknown if and how this works.
|
||||
|
||||
VC7 (not actively supported)
|
||||
---
|
||||
|
||||
The above-mentioned .cc problem does not exist in this version.
|
||||
|
||||
VC8
|
||||
---
|
||||
|
||||
No notes.
|
||||
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
After building, you can copy the above DLL files to a place in your
|
||||
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
|
||||
in a system directory, place them in the same directory as the
|
||||
executable(s). Be careful about accidentially overwriting files of
|
||||
the same name in the SYSTEM32 directory.
|
||||
|
||||
The DLL files are built so that the external entry points use the
|
||||
stdcall calling convention.
|
||||
|
||||
Static LIB files are not built. The LIB files that are built with are
|
||||
the linker import files associated with the DLL files.
|
||||
|
||||
The si-glu sources are used to build the GLU libs. This was done
|
||||
mainly to get the better tessellator code.
|
||||
|
||||
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
|
||||
to the project settings. You will also need to edit src/mesa.def to
|
||||
change all the gl* symbols to mgl*. Because this is easy to do with a
|
||||
global replace operation in a text editor, no additional mangled
|
||||
version of mesa.def is maintained or shipped.
|
||||
|
||||
If you have a Windows-related build problem or question, it is
|
||||
probably better to direct it to me (kschultz@users.sourceforge.net),
|
||||
rather than directly to the other Mesa developers. I will help you as
|
||||
much as I can. I also monitor the Mesa mailing lists and will answer
|
||||
questions in this area there as well.
|
||||
|
||||
|
||||
Karl Schultz
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<H1>News</H1>
|
||||
|
||||
|
||||
<h2>April ?, 2007</h2>
|
||||
<h2>April 27, 2007</h2>
|
||||
<p>
|
||||
<a href="relnotes-6.5.3.html">Mesa 6.5.3</a> is released.
|
||||
This is a development release which will lead up to the Mesa 7.0 release
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 6.5.3 Release Notes / April ??, 2007</H1>
|
||||
<H1>Mesa 6.5.3 Release Notes / April 27, 2007</H1>
|
||||
|
||||
<p>
|
||||
Mesa 6.5.3 is a development release with many changes and new features.
|
||||
@@ -96,7 +96,7 @@ 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 1.5
|
||||
Windows/Win32 implements OpenGL 2.1
|
||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
|
||||
SVGA unsupported
|
||||
Wind River UGL unsupported
|
||||
|
@@ -45,6 +45,9 @@ in Mesa:
|
||||
<li>Linking of multiple shaders is not supported
|
||||
<li>gl_ClipVertex
|
||||
<li>The derivative functions such as dFdx() are not implemented
|
||||
<li>The inverse trig functions asin(), acos(), and atan() are not implemented
|
||||
<li>The gl_Color and gl_SecondaryColor varying vars are interpolated
|
||||
without perspective correction
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
@@ -22,9 +22,11 @@ LIBS = GLUT32.LIB OPENGL32.LIB
|
||||
|
||||
all: OPENGL32.DLL GLU32.DLL GLUT32.DLL \
|
||||
readtex.h readtex.c showbuffer.h showbuffer.c \
|
||||
extfuncs.h trackball.h trackball.c \
|
||||
arbfplight.exe arbfslight.exe arbocclude.exe bounce.exe \
|
||||
clearspd.exe cubemap.exe drawpix.exe fire.exe fogcoord.exe \
|
||||
fplight.exe gamma.exe gearbox.exe \
|
||||
clearspd.exe cubemap.exe drawpix.exe engine.exe \
|
||||
fire.exe fogcoord.exe \
|
||||
fplight.exe fslight.exe gamma.exe gearbox.exe \
|
||||
gears.exe geartrain.exe gloss.exe \
|
||||
glinfo.exe glslnoise.exe \
|
||||
gltestperf.exe glutfx.exe ipers.exe isosurf.exe lodbias.exe \
|
||||
@@ -42,14 +44,16 @@ bounce.exe: bounce.obj
|
||||
clearspd.exe: clearspd.obj
|
||||
cubemap.exe: cubemap.obj readtex.obj
|
||||
drawpix.exe: drawpix.obj readtex.obj
|
||||
engine.exe: engine.obj readtex.obj trackball.obj
|
||||
fire.exe: fire.obj readtex.obj
|
||||
fogcoord.exe: fogcoord.obj readtex.obj
|
||||
fplight.exe: fplight.obj
|
||||
fslight.exe: fslight.obj
|
||||
gamma.exe: gamma.obj
|
||||
gearbox.exe: gearbox.obj
|
||||
gears.exe: gears.obj
|
||||
geartrain.exe: geartrain.obj
|
||||
gloss.exe: gloss.obj readtex.obj
|
||||
gloss.exe: gloss.obj readtex.obj trackball.obj
|
||||
glinfo.exe: glinfo.obj
|
||||
glslnoise.exe: glslnoise.obj
|
||||
gltestperf.exe: gltestperf.obj
|
||||
@@ -105,14 +109,23 @@ showbuffer.c: $(TOP)\progs\util\showbuffer.c
|
||||
showbuffer.h: $(TOP)\progs\util\showbuffer.h
|
||||
copy $** .
|
||||
|
||||
trackball.c: $(TOP)\progs\util\trackball.c
|
||||
copy $** .
|
||||
|
||||
trackball.h: $(TOP)\progs\util\trackball.h
|
||||
copy $** .
|
||||
|
||||
extfuncs.h: $(TOP)\progs\util\extfuncs.h
|
||||
copy $** .
|
||||
|
||||
.obj.exe:
|
||||
$(link) $(ldebug) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS)
|
||||
|
||||
.c.obj:
|
||||
$(cc) $(cdebug) $(cflags) $(cvars) /I$(INCDIR) $*.c
|
||||
$(cc) $(cdebug) $(cflags) $(cvars) -D_USE_MATH_DEFINES /I$(INCDIR) $*.c
|
||||
|
||||
clean::
|
||||
del *.obj *.exe readtex.* showbuffer.*
|
||||
del *.obj *.exe readtex.* showbuffer.* trackball.*
|
||||
|
||||
clobber::
|
||||
|
||||
|
@@ -62,7 +62,7 @@ static PFNGLUNIFORM3FVARBPROC glUniform4fvARB = NULL;
|
||||
|
||||
static void normalize (GLfloat *dst, const GLfloat *src)
|
||||
{
|
||||
GLfloat len = sqrtf (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
||||
GLfloat len = sqrt (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
||||
dst[0] = src[0] / len;
|
||||
dst[1] = src[1] / len;
|
||||
dst[2] = src[2] / len;
|
||||
|
@@ -58,7 +58,7 @@ static GLfloat xRot = 90.0f, yRot = 0.0f;
|
||||
static void
|
||||
normalize(GLfloat *dst, const GLfloat *src)
|
||||
{
|
||||
GLfloat len = sqrtf(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
||||
GLfloat len = sqrt(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
||||
dst[0] = src[0] / len;
|
||||
dst[1] = src[1] / len;
|
||||
dst[2] = src[2] / len;
|
||||
|
@@ -4,10 +4,10 @@
|
||||
* Updated for GLU 1.3 tessellation by Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#define MAX_POINTS 256
|
||||
#define MAX_CONTOURS 32
|
||||
|
@@ -11,6 +11,7 @@ static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL;
|
||||
static PFNGLCREATESHADERPROC glCreateShader_func = NULL;
|
||||
static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL;
|
||||
static PFNGLDELETESHADERPROC glDeleteShader_func = NULL;
|
||||
static PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib_func = NULL;
|
||||
static PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders_func = NULL;
|
||||
static PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation_func = NULL;
|
||||
static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog_func = NULL;
|
||||
@@ -78,6 +79,7 @@ GetExtensionFuncs(void)
|
||||
glCreateShader_func = (PFNGLCREATESHADERPROC) glutGetProcAddress("glCreateShader");
|
||||
glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) glutGetProcAddress("glDeleteProgram");
|
||||
glDeleteShader_func = (PFNGLDELETESHADERPROC) glutGetProcAddress("glDeleteShader");
|
||||
glGetActiveAttrib_func = (PFNGLGETACTIVEATTRIBPROC) glutGetProcAddress("glGetActiveAttrib");
|
||||
glGetAttachedShaders_func = (PFNGLGETATTACHEDSHADERSPROC) glutGetProcAddress("glGetAttachedShaders");
|
||||
glGetAttribLocation_func = (PFNGLGETATTRIBLOCATIONPROC) glutGetProcAddress("glGetAttribLocation");
|
||||
glGetProgramInfoLog_func = (PFNGLGETPROGRAMINFOLOGPROC) glutGetProcAddress("glGetProgramInfoLog");
|
||||
|
@@ -81,7 +81,7 @@ void TAG(translate_vertex)(GLcontext *ctx,
|
||||
dst->specular[2] = ((GLubyte *)p)[0];
|
||||
dst->specular[1] = ((GLubyte *)p)[1];
|
||||
dst->specular[0] = ((GLubyte *)p)[2];
|
||||
dst->fog = ((GLubyte *)p)[3];
|
||||
dst->attrib[FRAG_ATTRIB_FOGC][0] = ((GLubyte *)p)[3];
|
||||
p++;
|
||||
|
||||
case TINY_VERTEX_FORMAT:
|
||||
|
@@ -1269,6 +1269,9 @@ void r300_setup_textures(GLcontext *ctx)
|
||||
tmu_mappings[i] = hw_tmu;
|
||||
|
||||
t=r300->state.texture.unit[i].texobj;
|
||||
/* XXX questionable fix for bug 9170: */
|
||||
if (!t)
|
||||
continue;
|
||||
|
||||
if((t->format & 0xffffff00)==0xffffff00) {
|
||||
WARN_ONCE("unknown texture format (entry %x) encountered. Help me !\n", t->format & 0xff);
|
||||
|
@@ -1239,6 +1239,7 @@ WMesaContext WMesaCreateContext(HDC hDC,
|
||||
_mesa_enable_1_4_extensions(ctx);
|
||||
_mesa_enable_1_5_extensions(ctx);
|
||||
_mesa_enable_2_0_extensions(ctx);
|
||||
_mesa_enable_2_1_extensions(ctx);
|
||||
|
||||
/* Initialize the software rasterizer and helper modules. */
|
||||
if (!_swrast_CreateContext(ctx) ||
|
||||
|
@@ -1060,7 +1060,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state)
|
||||
/*
|
||||
* Points
|
||||
*/
|
||||
if (new_state & _NEW_POINT) {
|
||||
if (1/*new_state & _NEW_POINT*/) {
|
||||
if (ctx->Point.SmoothFlag)
|
||||
ctx->_TriangleCaps |= DD_POINT_SMOOTH;
|
||||
if (ctx->Point._Size != 1.0F)
|
||||
@@ -1072,7 +1072,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state)
|
||||
/*
|
||||
* Lines
|
||||
*/
|
||||
if (new_state & _NEW_LINE) {
|
||||
if (1/*new_state & _NEW_LINE*/) {
|
||||
if (ctx->Line.SmoothFlag)
|
||||
ctx->_TriangleCaps |= DD_LINE_SMOOTH;
|
||||
if (ctx->Line.StippleFlag)
|
||||
@@ -1084,7 +1084,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state)
|
||||
/*
|
||||
* Polygons
|
||||
*/
|
||||
if (new_state & _NEW_POLYGON) {
|
||||
if (1/*new_state & _NEW_POLYGON*/) {
|
||||
if (ctx->Polygon.SmoothFlag)
|
||||
ctx->_TriangleCaps |= DD_TRI_SMOOTH;
|
||||
if (ctx->Polygon.StippleFlag)
|
||||
|
@@ -311,96 +311,93 @@ vec4 tan(const vec4 angle)
|
||||
|
||||
|
||||
|
||||
float asin (float x) {
|
||||
float y;
|
||||
__asm float_arcsine y, x;
|
||||
return y;
|
||||
float asin(const float x)
|
||||
{
|
||||
// XXX FIX ME!
|
||||
// __asm float_arcsine y, x;
|
||||
__retVal = 0.5;
|
||||
}
|
||||
|
||||
vec2 asin (vec2 v) {
|
||||
return vec2 (
|
||||
asin (v.x),
|
||||
asin (v.y)
|
||||
);
|
||||
vec2 asin(const vec2 v)
|
||||
{
|
||||
__retVal.x = asin(v.x);
|
||||
__retVal.y = asin(v.y);
|
||||
}
|
||||
|
||||
vec3 asin (vec3 v) {
|
||||
return vec3 (
|
||||
asin (v.x),
|
||||
asin (v.y),
|
||||
asin (v.z)
|
||||
);
|
||||
vec3 asin(const vec3 v)
|
||||
{
|
||||
__retVal.x = asin(v.x);
|
||||
__retVal.y = asin(v.y);
|
||||
__retVal.z = asin(v.z);
|
||||
}
|
||||
|
||||
vec4 asin (vec4 v) {
|
||||
return vec4 (
|
||||
asin (v.x),
|
||||
asin (v.y),
|
||||
asin (v.z),
|
||||
asin (v.w)
|
||||
);
|
||||
vec4 asin(const vec4 v)
|
||||
{
|
||||
__retVal.x = asin(v.x);
|
||||
__retVal.y = asin(v.y);
|
||||
__retVal.z = asin(v.z);
|
||||
}
|
||||
|
||||
float acos (float x) {
|
||||
return 1.5708 - asin (x);
|
||||
float acos(const float x)
|
||||
{
|
||||
// XXX FIX ME!
|
||||
__retVal = 0.5;
|
||||
}
|
||||
|
||||
vec2 acos (vec2 v) {
|
||||
return vec2 (
|
||||
acos (v.x),
|
||||
acos (v.y)
|
||||
);
|
||||
vec2 acos(const vec2 v)
|
||||
{
|
||||
__retVal.x = acos(v.x);
|
||||
__retVal.y = acos(v.y);
|
||||
}
|
||||
|
||||
vec3 acos (vec3 v) {
|
||||
return vec3 (
|
||||
acos (v.x),
|
||||
acos (v.y),
|
||||
acos (v.z)
|
||||
);
|
||||
vec3 acos(const vec3 v)
|
||||
{
|
||||
__retVal.x = acos(v.x);
|
||||
__retVal.y = acos(v.y);
|
||||
__retVal.z = acos(v.z);
|
||||
}
|
||||
|
||||
vec4 acos (vec4 v) {
|
||||
return vec4 (
|
||||
acos (v.x),
|
||||
acos (v.y),
|
||||
acos (v.z),
|
||||
acos (v.w)
|
||||
);
|
||||
vec4 acos(const vec4 v)
|
||||
{
|
||||
__retVal.x = acos(v.x);
|
||||
__retVal.y = acos(v.y);
|
||||
__retVal.z = acos(v.z);
|
||||
__retVal.w = acos(v.w);
|
||||
}
|
||||
|
||||
float atan (float y_over_x) {
|
||||
float z;
|
||||
__asm float_arctan z, y_over_x;
|
||||
return z;
|
||||
float atan(const float y_over_x)
|
||||
{
|
||||
// XXX FIX ME
|
||||
//__asm float_arctan z, y_over_x;
|
||||
__retVal = 0.5;
|
||||
}
|
||||
|
||||
vec2 atan (vec2 y_over_x) {
|
||||
return vec2 (
|
||||
atan (y_over_x.x),
|
||||
atan (y_over_x.y)
|
||||
);
|
||||
vec2 atan(const vec2 y_over_x)
|
||||
{
|
||||
__retVal.x = atan(y_over_x.x);
|
||||
__retVal.y = atan(y_over_x.y);
|
||||
}
|
||||
|
||||
vec3 atan (vec3 y_over_x) {
|
||||
return vec3 (
|
||||
atan (y_over_x.x),
|
||||
atan (y_over_x.y),
|
||||
atan (y_over_x.z)
|
||||
);
|
||||
vec3 atan(const vec3 y_over_x)
|
||||
{
|
||||
__retVal.x = atan(y_over_x.x);
|
||||
__retVal.y = atan(y_over_x.y);
|
||||
__retVal.z = atan(y_over_x.z);
|
||||
}
|
||||
|
||||
vec4 atan (vec4 y_over_x) {
|
||||
return vec4 (
|
||||
atan (y_over_x.x),
|
||||
atan (y_over_x.y),
|
||||
atan (y_over_x.z),
|
||||
atan (y_over_x.w)
|
||||
);
|
||||
vec4 atan(const vec4 y_over_x)
|
||||
{
|
||||
__retVal.x = atan(y_over_x.x);
|
||||
__retVal.y = atan(y_over_x.y);
|
||||
__retVal.z = atan(y_over_x.z);
|
||||
__retVal.w = atan(y_over_x.w);
|
||||
}
|
||||
|
||||
float atan (float y, float x) {
|
||||
float z = atan (y / x);
|
||||
float atan(const float y, const float x)
|
||||
{
|
||||
if (x == 0.0)
|
||||
return 0.0;
|
||||
float z = atan(y / x);
|
||||
if (x < 0.0)
|
||||
{
|
||||
if (y < 0.0)
|
||||
@@ -410,30 +407,28 @@ float atan (float y, float x) {
|
||||
return z;
|
||||
}
|
||||
|
||||
vec2 atan (vec2 u, vec2 v) {
|
||||
return vec2 (
|
||||
atan (u.x, v.x),
|
||||
atan (u.y, v.y)
|
||||
);
|
||||
vec2 atan(const vec2 u, const vec2 v)
|
||||
{
|
||||
__retVal.x = atan(u.x, v.x);
|
||||
__retVal.y = atan(u.y, v.y);
|
||||
}
|
||||
|
||||
vec3 atan (vec3 u, vec3 v) {
|
||||
return vec3 (
|
||||
atan (u.x, v.x),
|
||||
atan (u.y, v.y),
|
||||
atan (u.z, v.z)
|
||||
);
|
||||
vec3 atan(const vec3 u, const vec3 v)
|
||||
{
|
||||
__retVal.x = atan(u.x, v.x);
|
||||
__retVal.y = atan(u.y, v.y);
|
||||
__retVal.z = atan(u.z, v.z);
|
||||
}
|
||||
|
||||
vec4 atan (vec4 u, vec4 v) {
|
||||
return vec4 (
|
||||
atan (u.x, v.x),
|
||||
atan (u.y, v.y),
|
||||
atan (u.z, v.z),
|
||||
atan (u.w, v.w)
|
||||
);
|
||||
vec4 atan(const vec4 u, const vec4 v)
|
||||
{
|
||||
__retVal.x = atan(u.x, v.x);
|
||||
__retVal.y = atan(u.y, v.y);
|
||||
__retVal.z = atan(u.z, v.z);
|
||||
__retVal.w = atan(u.w, v.w);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// 8.2 Exponential Functions
|
||||
//
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -114,18 +114,18 @@ link_varying_vars(struct gl_shader_program *shProg, struct gl_program *prog)
|
||||
varsRead |= (1 << inst->SrcReg[j].Index);
|
||||
}
|
||||
}
|
||||
/* XXX update program OutputsWritten, InputsRead */
|
||||
}
|
||||
|
||||
if (prog->Target == GL_VERTEX_PROGRAM_ARB) {
|
||||
prog->OutputsWritten |= varsWritten;
|
||||
/*printf("VERT OUTPUTS: 0x%x \n", varsWritten);*/
|
||||
}
|
||||
else {
|
||||
assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB);
|
||||
prog->InputsRead |= varsRead;
|
||||
/*printf("FRAG INPUTS: 0x%x\n", varsRead);*/
|
||||
}
|
||||
|
||||
|
||||
free(map);
|
||||
|
||||
return GL_TRUE;
|
||||
@@ -452,6 +452,21 @@ fragment_program(struct gl_program *prog)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Record a linking error.
|
||||
*/
|
||||
static void
|
||||
link_error(struct gl_shader_program *shProg, const char *msg)
|
||||
{
|
||||
if (shProg->InfoLog) {
|
||||
_mesa_free(shProg->InfoLog);
|
||||
}
|
||||
shProg->InfoLog = _mesa_strdup(msg);
|
||||
shProg->LinkStatus = GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Shader linker. Currently:
|
||||
*
|
||||
@@ -553,18 +568,30 @@ _slang_link(GLcontext *ctx,
|
||||
_slang_update_inputs_outputs(&shProg->VertexProgram->Base);
|
||||
if (!(shProg->VertexProgram->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) {
|
||||
/* the vertex program did not compute a vertex position */
|
||||
if (shProg->InfoLog) {
|
||||
_mesa_free(shProg->InfoLog);
|
||||
}
|
||||
shProg->InfoLog
|
||||
= _mesa_strdup("gl_Position was not written by vertex shader\n");
|
||||
shProg->LinkStatus = GL_FALSE;
|
||||
link_error(shProg,
|
||||
"gl_Position was not written by vertex shader\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (shProg->FragmentProgram)
|
||||
_slang_update_inputs_outputs(&shProg->FragmentProgram->Base);
|
||||
|
||||
/* Check that all the varying vars needed by the fragment shader are
|
||||
* actually produced by the vertex shader.
|
||||
*/
|
||||
if (shProg->FragmentProgram) {
|
||||
const GLbitfield varyingRead
|
||||
= shProg->FragmentProgram->Base.InputsRead >> FRAG_ATTRIB_VAR0;
|
||||
const GLbitfield varyingWritten = shProg->VertexProgram ?
|
||||
shProg->VertexProgram->Base.OutputsWritten >> VERT_RESULT_VAR0 : 0x0;
|
||||
if ((varyingRead & varyingWritten) != varyingRead) {
|
||||
link_error(shProg,
|
||||
"Fragment program using varying vars not written by vertex shader\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (fragProg && shProg->FragmentProgram) {
|
||||
/* notify driver that a new fragment program has been compiled/linked */
|
||||
ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB,
|
||||
|
@@ -67,7 +67,7 @@ struct LineInfo
|
||||
GLfloat iPlane[4];
|
||||
/* DO_SPEC */
|
||||
GLfloat srPlane[4], sgPlane[4], sbPlane[4];
|
||||
/* DO_TEXVAR */
|
||||
/* DO_ATTRIBS */
|
||||
GLfloat sPlane[FRAG_ATTRIB_MAX][4];
|
||||
GLfloat tPlane[FRAG_ATTRIB_MAX][4];
|
||||
GLfloat uPlane[FRAG_ATTRIB_MAX][4];
|
||||
@@ -499,7 +499,7 @@ segment(GLcontext *ctx,
|
||||
#define DO_Z
|
||||
#define DO_FOG
|
||||
#define DO_RGBA
|
||||
#define DO_TEXVAR
|
||||
#define DO_ATTRIBS
|
||||
#include "s_aalinetemp.h"
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ segment(GLcontext *ctx,
|
||||
#define DO_Z
|
||||
#define DO_FOG
|
||||
#define DO_RGBA
|
||||
#define DO_TEXVAR
|
||||
#define DO_ATTRIBS
|
||||
#define DO_SPEC
|
||||
#include "s_aalinetemp.h"
|
||||
|
||||
|
@@ -80,7 +80,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
|
||||
line->span.array->spec[i][GCOMP] = solve_plane_chan(fx, fy, line->sgPlane);
|
||||
line->span.array->spec[i][BCOMP] = solve_plane_chan(fx, fy, line->sbPlane);
|
||||
#endif
|
||||
#if defined(DO_TEXVAR)
|
||||
#if defined(DO_ATTRIBS)
|
||||
ATTRIB_LOOP_BEGIN
|
||||
GLfloat (*attribArray)[4] = line->span.array->attribs[attr];
|
||||
GLfloat invQ;
|
||||
@@ -202,7 +202,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
|
||||
constant_plane(v1->index, line.iPlane);
|
||||
}
|
||||
#endif
|
||||
#if defined(DO_TEXVAR)
|
||||
#if defined(DO_ATTRIBS)
|
||||
{
|
||||
const GLfloat invW0 = v0->win[3];
|
||||
const GLfloat invW1 = v1->win[3];
|
||||
@@ -225,7 +225,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
|
||||
const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
|
||||
const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
|
||||
line.texWidth[attr] = (GLfloat) texImage->Width;
|
||||
line.texHeight[attr] = (GLfloat) texImage->Height;
|
||||
line.texHeight[attr] = (GLfloat) texImage->Height;
|
||||
}
|
||||
ATTRIB_LOOP_END
|
||||
}
|
||||
@@ -290,5 +290,5 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
|
||||
#undef DO_RGBA
|
||||
#undef DO_INDEX
|
||||
#undef DO_SPEC
|
||||
#undef DO_TEXVAR
|
||||
#undef DO_ATTRIBS
|
||||
#undef NAME
|
||||
|
@@ -408,7 +408,7 @@ tex_aa_tri(GLcontext *ctx,
|
||||
#define DO_Z
|
||||
#define DO_FOG
|
||||
#define DO_RGBA
|
||||
#define DO_TEXVAR
|
||||
#define DO_ATTRIBS
|
||||
#include "s_aatritemp.h"
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ spec_tex_aa_tri(GLcontext *ctx,
|
||||
#define DO_Z
|
||||
#define DO_FOG
|
||||
#define DO_RGBA
|
||||
#define DO_TEXVAR
|
||||
#define DO_ATTRIBS
|
||||
#define DO_SPEC
|
||||
#include "s_aatritemp.h"
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@
|
||||
* DO_RGBA - if defined, compute RGBA values
|
||||
* DO_INDEX - if defined, compute color index values
|
||||
* DO_SPEC - if defined, compute specular RGB values
|
||||
* DO_TEXVAR - if defined, compute texcoords, varying
|
||||
* DO_ATTRIBS - if defined, compute texcoords, varying, etc.
|
||||
*/
|
||||
|
||||
/*void triangle( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/
|
||||
@@ -70,7 +70,7 @@
|
||||
#ifdef DO_SPEC
|
||||
GLfloat srPlane[4], sgPlane[4], sbPlane[4];
|
||||
#endif
|
||||
#if defined(DO_TEXVAR)
|
||||
#if defined(DO_ATTRIBS)
|
||||
GLfloat sPlane[FRAG_ATTRIB_MAX][4]; /* texture S */
|
||||
GLfloat tPlane[FRAG_ATTRIB_MAX][4]; /* texture T */
|
||||
GLfloat uPlane[FRAG_ATTRIB_MAX][4]; /* texture R */
|
||||
@@ -181,7 +181,7 @@
|
||||
}
|
||||
span.arrayMask |= SPAN_SPEC;
|
||||
#endif
|
||||
#if defined(DO_TEXVAR)
|
||||
#if defined(DO_ATTRIBS)
|
||||
{
|
||||
const GLfloat invW0 = v0->win[3];
|
||||
const GLfloat invW1 = v1->win[3];
|
||||
@@ -283,7 +283,7 @@
|
||||
array->spec[count][GCOMP] = solve_plane_chan(cx, cy, sgPlane);
|
||||
array->spec[count][BCOMP] = solve_plane_chan(cx, cy, sbPlane);
|
||||
#endif
|
||||
#if defined(DO_TEXVAR)
|
||||
#if defined(DO_ATTRIBS)
|
||||
ATTRIB_LOOP_BEGIN
|
||||
GLfloat invQ = solve_plane_recip(cx, cy, vPlane[attr]);
|
||||
array->attribs[attr][count][0] = solve_plane(cx, cy, sPlane[attr]) * invQ;
|
||||
@@ -375,7 +375,7 @@
|
||||
array->spec[ix][GCOMP] = solve_plane_chan(cx, cy, sgPlane);
|
||||
array->spec[ix][BCOMP] = solve_plane_chan(cx, cy, sbPlane);
|
||||
#endif
|
||||
#if defined(DO_TEXVAR)
|
||||
#if defined(DO_ATTRIBS)
|
||||
ATTRIB_LOOP_BEGIN
|
||||
GLfloat invQ = solve_plane_recip(cx, cy, vPlane[attr]);
|
||||
array->attribs[attr][ix][0] = solve_plane(cx, cy, sPlane[attr]) * invQ;
|
||||
@@ -426,13 +426,13 @@
|
||||
array->attribs[FRAG_ATTRIB_FOGC][j][0]
|
||||
= array->attribs[FRAG_ATTRIB_FOGC][j + left][0];
|
||||
#endif
|
||||
#if defined(DO_TEXVAR)
|
||||
#if defined(DO_ATTRIBS)
|
||||
array->lambda[0][j] = array->lambda[0][j + left];
|
||||
#endif
|
||||
array->coverage[j] = array->coverage[j + left];
|
||||
}
|
||||
}
|
||||
#ifdef DO_TEXVAR
|
||||
#ifdef DO_ATTRIBS
|
||||
/* shift texcoords, varying */
|
||||
{
|
||||
SWspanarrays *array = span.array;
|
||||
@@ -482,8 +482,8 @@
|
||||
#undef DO_SPEC
|
||||
#endif
|
||||
|
||||
#ifdef DO_TEXVAR
|
||||
#undef DO_TEXVAR
|
||||
#ifdef DO_ATTRIBS
|
||||
#undef DO_ATTRIBS
|
||||
#endif
|
||||
|
||||
#ifdef DO_OCCLUSION_TEST
|
||||
|
@@ -536,6 +536,13 @@ _swrast_update_fragment_attribs(GLcontext *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
/* don't want to interpolate these generic attribs just yet */
|
||||
/* XXX temporary */
|
||||
attribsMask &= ~(FRAG_BIT_WPOS |
|
||||
FRAG_BIT_COL0 |
|
||||
FRAG_BIT_COL1 |
|
||||
FRAG_BIT_FOGC);
|
||||
|
||||
/* Update _ActiveAttribs[] list */
|
||||
{
|
||||
GLuint i, num = 0;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
* Version: 6.5.3
|
||||
*
|
||||
* Copyright (C) 1999-2005 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"),
|
||||
@@ -171,34 +171,13 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor )
|
||||
#include "s_linetemp.h"
|
||||
|
||||
|
||||
/* Single-texture line, w/ fog, Z, specular, etc. */
|
||||
/* General-purpose textured line (any/all features). */
|
||||
#define NAME textured_line
|
||||
#define INTERP_RGBA
|
||||
#define INTERP_Z
|
||||
#define INTERP_FOG
|
||||
#define INTERP_TEX
|
||||
#define RENDER_SPAN(span) \
|
||||
if (ctx->Line.StippleFlag) { \
|
||||
span.arrayMask |= SPAN_MASK; \
|
||||
compute_stipple_mask(ctx, span.end, span.array->mask); \
|
||||
} \
|
||||
if (ctx->Line._Width > 1.0) { \
|
||||
draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \
|
||||
} \
|
||||
else { \
|
||||
_swrast_write_rgba_span(ctx, &span); \
|
||||
}
|
||||
#include "s_linetemp.h"
|
||||
|
||||
|
||||
/* Multi-texture or separate specular line, w/ fog, Z, specular, etc. */
|
||||
#define NAME multitextured_line
|
||||
#define INTERP_RGBA
|
||||
#define INTERP_SPEC
|
||||
#define INTERP_Z
|
||||
#define INTERP_FOG
|
||||
#define INTERP_MULTITEX
|
||||
#define INTERP_VARYING
|
||||
#define INTERP_ATTRIBS
|
||||
#define RENDER_SPAN(span) \
|
||||
if (ctx->Line.StippleFlag) { \
|
||||
span.arrayMask |= SPAN_MASK; \
|
||||
@@ -251,8 +230,6 @@ _mesa_print_line_function(GLcontext *ctx)
|
||||
_mesa_printf("general_rgba_line\n");
|
||||
else if (swrast->Line == textured_line)
|
||||
_mesa_printf("textured_line\n");
|
||||
else if (swrast->Line == multitextured_line)
|
||||
_mesa_printf("multitextured_line\n");
|
||||
else
|
||||
_mesa_printf("Driver func %p\n", (void *(*)()) swrast->Line);
|
||||
}
|
||||
@@ -302,15 +279,7 @@ _swrast_choose_line( GLcontext *ctx )
|
||||
else if (ctx->Texture._EnabledCoordUnits
|
||||
|| ctx->FragmentProgram._Current) {
|
||||
/* textured lines */
|
||||
if (ctx->Texture._EnabledCoordUnits > 0x1
|
||||
|| NEED_SECONDARY_COLOR(ctx)
|
||||
|| ctx->FragmentProgram._Current) {
|
||||
/* multi-texture and/or separate specular color */
|
||||
USE(multitextured_line);
|
||||
}
|
||||
else {
|
||||
USE(textured_line);
|
||||
}
|
||||
USE(textured_line);
|
||||
}
|
||||
else if (ctx->Depth.Test || swrast->_FogEnabled || ctx->Line._Width != 1.0
|
||||
|| ctx->Line.StippleFlag) {
|
||||
|
@@ -35,9 +35,7 @@
|
||||
* INTERP_RGBA - if defined, interpolate RGBA values
|
||||
* INTERP_SPEC - if defined, interpolate specular RGB values
|
||||
* INTERP_INDEX - if defined, interpolate color index values
|
||||
* INTERP_TEX - if defined, interpolate unit 0 texcoords
|
||||
* INTERP_MULTITEX - if defined, interpolate multi-texcoords
|
||||
* INTERP_VARYING - if defined, interpolate GLSL varyings
|
||||
* INTERP_ATTRIBS - if defined, interpolate attribs (texcoords, varying, etc)
|
||||
*
|
||||
* When one can directly address pixels in the color buffer the following
|
||||
* macros can be defined and used to directly compute pixel addresses during
|
||||
@@ -284,32 +282,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
|
||||
span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->attrib[FRAG_ATTRIB_FOGC][0]
|
||||
- vert0->attrib[FRAG_ATTRIB_FOGC][0]) / numPixels;
|
||||
#endif
|
||||
#ifdef INTERP_TEX
|
||||
interpFlags |= SPAN_TEXTURE;
|
||||
{
|
||||
const GLfloat invw0 = vert0->win[3];
|
||||
const GLfloat invw1 = vert1->win[3];
|
||||
const GLfloat invLen = 1.0F / numPixels;
|
||||
GLfloat ds, dt, dr, dq;
|
||||
span.attrStart[FRAG_ATTRIB_TEX0][0] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][0];
|
||||
span.attrStart[FRAG_ATTRIB_TEX0][1] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][1];
|
||||
span.attrStart[FRAG_ATTRIB_TEX0][2] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][2];
|
||||
span.attrStart[FRAG_ATTRIB_TEX0][3] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][3];
|
||||
ds = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][0]) - span.attrStart[FRAG_ATTRIB_TEX0][0];
|
||||
dt = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][1]) - span.attrStart[FRAG_ATTRIB_TEX0][1];
|
||||
dr = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][2]) - span.attrStart[FRAG_ATTRIB_TEX0][2];
|
||||
dq = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][3]) - span.attrStart[FRAG_ATTRIB_TEX0][3];
|
||||
span.attrStepX[FRAG_ATTRIB_TEX0][0] = ds * invLen;
|
||||
span.attrStepX[FRAG_ATTRIB_TEX0][1] = dt * invLen;
|
||||
span.attrStepX[FRAG_ATTRIB_TEX0][2] = dr * invLen;
|
||||
span.attrStepX[FRAG_ATTRIB_TEX0][3] = dq * invLen;
|
||||
span.attrStepY[FRAG_ATTRIB_TEX0][0] = 0.0F;
|
||||
span.attrStepY[FRAG_ATTRIB_TEX0][1] = 0.0F;
|
||||
span.attrStepY[FRAG_ATTRIB_TEX0][2] = 0.0F;
|
||||
span.attrStepY[FRAG_ATTRIB_TEX0][3] = 0.0F;
|
||||
}
|
||||
#endif
|
||||
#if defined(INTERP_MULTITEX) || defined(INTERP_VARYING)
|
||||
#if defined(INTERP_ATTRIBS)
|
||||
interpFlags |= (SPAN_TEXTURE | SPAN_VARYING);
|
||||
{
|
||||
const GLfloat invLen = 1.0F / numPixels;
|
||||
@@ -443,8 +416,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
|
||||
#undef INTERP_FOG
|
||||
#undef INTERP_RGBA
|
||||
#undef INTERP_SPEC
|
||||
#undef INTERP_TEX
|
||||
#undef INTERP_MULTITEX
|
||||
#undef INTERP_ATTRIBS
|
||||
#undef INTERP_INDEX
|
||||
#undef PIXEL_ADDRESS
|
||||
#undef PIXEL_TYPE
|
||||
|
@@ -38,7 +38,7 @@
|
||||
#define RGBA 0x1
|
||||
#define INDEX 0x2
|
||||
#define SMOOTH 0x4
|
||||
#define TEXTURE 0x8
|
||||
#define ATTRIBS 0x8
|
||||
#define SPECULAR 0x10
|
||||
#define LARGE 0x20
|
||||
#define ATTENUATE 0x40
|
||||
@@ -104,7 +104,7 @@
|
||||
/*
|
||||
* Textured RGBA points.
|
||||
*/
|
||||
#define FLAGS (RGBA | LARGE | TEXTURE | SPECULAR)
|
||||
#define FLAGS (RGBA | LARGE | ATTRIBS | SPECULAR)
|
||||
#define NAME textured_rgba_point
|
||||
#include "s_pointtemp.h"
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
/*
|
||||
* Antialiased points with texture mapping.
|
||||
*/
|
||||
#define FLAGS (RGBA | SMOOTH | TEXTURE | SPECULAR)
|
||||
#define FLAGS (RGBA | SMOOTH | ATTRIBS | SPECULAR)
|
||||
#define NAME antialiased_tex_rgba_point
|
||||
#include "s_pointtemp.h"
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
/*
|
||||
* Distance attenuated, textured RGBA points.
|
||||
*/
|
||||
#define FLAGS (RGBA | ATTENUATE | TEXTURE | SPECULAR)
|
||||
#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SPECULAR)
|
||||
#define NAME atten_textured_rgba_point
|
||||
#include "s_pointtemp.h"
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
/*
|
||||
* Distance attenuated, antialiased points with or without texture mapping.
|
||||
*/
|
||||
#define FLAGS (RGBA | ATTENUATE | TEXTURE | SMOOTH)
|
||||
#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SMOOTH)
|
||||
#define NAME atten_antialiased_rgba_point
|
||||
#include "s_pointtemp.h"
|
||||
|
||||
|
@@ -39,14 +39,14 @@
|
||||
*
|
||||
* RGBA = do rgba instead of color index
|
||||
* SMOOTH = do antialiasing
|
||||
* TEXTURE = do texture coords
|
||||
* ATTRIBS = general attributes (texcoords, etc)
|
||||
* SPECULAR = do separate specular color
|
||||
* LARGE = do points with diameter > 1 pixel
|
||||
* ATTENUATE = compute point size attenuation
|
||||
* SPRITE = GL_ARB_point_sprite / GL_NV_point_sprite
|
||||
*
|
||||
* Notes: LARGE and ATTENUATE are exclusive of each other.
|
||||
* TEXTURE requires RGBA
|
||||
* ATTRIBS requires RGBA
|
||||
*/
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
||||
#if FLAGS & INDEX
|
||||
const GLuint colorIndex = (GLuint) vert->index; /* XXX round? */
|
||||
#endif
|
||||
#if FLAGS & TEXTURE
|
||||
#if FLAGS & ATTRIBS
|
||||
GLfloat attrib[FRAG_ATTRIB_MAX][4]; /* texture & varying */
|
||||
#endif
|
||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||
@@ -117,7 +117,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
||||
#if FLAGS & INDEX
|
||||
span->arrayMask |= SPAN_INDEX;
|
||||
#endif
|
||||
#if FLAGS & TEXTURE
|
||||
#if FLAGS & ATTRIBS
|
||||
span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
|
||||
if (ctx->FragmentProgram._Active) {
|
||||
/* Don't divide texture s,t,r by q (use TXP to do that) */
|
||||
@@ -272,7 +272,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
||||
#if FLAGS & INDEX
|
||||
span->array->index[count] = colorIndex;
|
||||
#endif
|
||||
#if FLAGS & TEXTURE
|
||||
#if FLAGS & ATTRIBS
|
||||
ATTRIB_LOOP_BEGIN
|
||||
COPY_4V(span->array->attribs[attr][count], attrib[attr]);
|
||||
if (attr < FRAG_ATTRIB_VAR0) {
|
||||
@@ -397,7 +397,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
||||
#if FLAGS & INDEX
|
||||
span->array->index[count] = colorIndex;
|
||||
#endif
|
||||
#if FLAGS & TEXTURE
|
||||
#if FLAGS & ATTRIBS
|
||||
ATTRIB_LOOP_BEGIN
|
||||
COPY_4V(span->array->attribs[attr][count], attribs[attr]);
|
||||
ATTRIB_LOOP_END
|
||||
|
@@ -67,24 +67,9 @@ _swrast_culltriangle( GLcontext *ctx,
|
||||
|
||||
|
||||
/*
|
||||
* Render a flat-shaded color index triangle.
|
||||
* Render a smooth or flat-shaded color index triangle.
|
||||
*/
|
||||
#define NAME flat_ci_triangle
|
||||
#define INTERP_Z 1
|
||||
#define INTERP_FOG 1
|
||||
#define SETUP_CODE \
|
||||
span.interpMask |= SPAN_INDEX; \
|
||||
span.index = FloatToFixed(v2->index);\
|
||||
span.indexStep = 0;
|
||||
#define RENDER_SPAN( span ) _swrast_write_index_span(ctx, &span);
|
||||
#include "s_tritemp.h"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Render a smooth-shaded color index triangle.
|
||||
*/
|
||||
#define NAME smooth_ci_triangle
|
||||
#define NAME ci_triangle
|
||||
#define INTERP_Z 1
|
||||
#define INTERP_FOG 1
|
||||
#define INTERP_INDEX 1
|
||||
@@ -139,7 +124,7 @@ _swrast_culltriangle( GLcontext *ctx,
|
||||
* Render an RGB, GL_DECAL, textured triangle.
|
||||
* Interpolate S,T only w/out mipmapping or perspective correction.
|
||||
*
|
||||
* No fog.
|
||||
* No fog. No depth testing.
|
||||
*/
|
||||
#define NAME simple_textured_triangle
|
||||
#define INTERP_INT_TEX 1
|
||||
@@ -803,7 +788,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span,
|
||||
#define INTERP_FOG 1
|
||||
#define INTERP_RGB 1
|
||||
#define INTERP_ALPHA 1
|
||||
#define INTERP_TEX 1
|
||||
#define INTERP_ATTRIBS 1
|
||||
|
||||
#define SETUP_CODE \
|
||||
struct persp_info info; \
|
||||
@@ -865,16 +850,16 @@ fast_persp_span(GLcontext *ctx, SWspan *span,
|
||||
|
||||
|
||||
/*
|
||||
* Render a smooth-shaded, textured, RGBA triangle.
|
||||
* Render an RGBA triangle with arbitrary attributes.
|
||||
*/
|
||||
#define NAME general_textured_triangle
|
||||
#define NAME general_triangle
|
||||
#define INTERP_Z 1
|
||||
#define INTERP_W 1
|
||||
#define INTERP_FOG 1
|
||||
#define INTERP_RGB 1
|
||||
#define INTERP_SPEC 1
|
||||
#define INTERP_ALPHA 1
|
||||
#define INTERP_TEX 1
|
||||
#define INTERP_ATTRIBS 1
|
||||
#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span);
|
||||
#include "s_tritemp.h"
|
||||
|
||||
@@ -1054,6 +1039,11 @@ _swrast_choose_triangle( GLcontext *ctx )
|
||||
}
|
||||
}
|
||||
|
||||
if (!rgbmode) {
|
||||
USE(ci_triangle);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->Texture._EnabledCoordUnits ||
|
||||
ctx->FragmentProgram._Current ||
|
||||
ctx->ATIFragmentShader._Enabled) {
|
||||
@@ -1102,7 +1092,7 @@ _swrast_choose_triangle( GLcontext *ctx )
|
||||
}
|
||||
else {
|
||||
#if (CHAN_BITS == 16 || CHAN_BITS == 32)
|
||||
USE(general_textured_triangle);
|
||||
USE(general_triangle);
|
||||
#else
|
||||
USE(affine_textured_triangle);
|
||||
#endif
|
||||
@@ -1110,7 +1100,7 @@ _swrast_choose_triangle( GLcontext *ctx )
|
||||
}
|
||||
else {
|
||||
#if (CHAN_BITS == 16 || CHAN_BITS == 32)
|
||||
USE(general_textured_triangle);
|
||||
USE(general_triangle);
|
||||
#else
|
||||
USE(persp_textured_triangle);
|
||||
#endif
|
||||
@@ -1118,28 +1108,18 @@ _swrast_choose_triangle( GLcontext *ctx )
|
||||
}
|
||||
else {
|
||||
/* general case textured triangles */
|
||||
USE(general_textured_triangle);
|
||||
USE(general_triangle);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ASSERT(!ctx->Texture._EnabledCoordUnits);
|
||||
if (ctx->Light.ShadeModel==GL_SMOOTH) {
|
||||
/* smooth shaded, no texturing, stippled or some raster ops */
|
||||
if (rgbmode) {
|
||||
USE(smooth_rgba_triangle);
|
||||
}
|
||||
else {
|
||||
USE(smooth_ci_triangle);
|
||||
}
|
||||
USE(smooth_rgba_triangle);
|
||||
}
|
||||
else {
|
||||
/* flat shaded, no texturing, stippled or some raster ops */
|
||||
if (rgbmode) {
|
||||
USE(flat_rgba_triangle);
|
||||
}
|
||||
else {
|
||||
USE(flat_ci_triangle);
|
||||
}
|
||||
USE(flat_rgba_triangle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,8 @@
|
||||
* INTERP_INDEX - if defined, interpolate color index values
|
||||
* INTERP_INT_TEX - if defined, interpolate integer ST texcoords
|
||||
* (fast, simple 2-D texture mapping)
|
||||
* INTERP_TEX - if defined, interpolate texcoords and varying vars
|
||||
* INTERP_ATTRIBS - if defined, interpolate arbitrary attribs (texcoords,
|
||||
* varying vars, etc)
|
||||
* NOTE: OpenGL STRQ = Mesa STUV (R was taken for red)
|
||||
*
|
||||
* When one can directly address pixels in the color buffer the following
|
||||
@@ -601,7 +602,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
|
||||
span.intTexStep[1] = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_TEX0][1]);
|
||||
}
|
||||
#endif
|
||||
#ifdef INTERP_TEX
|
||||
#ifdef INTERP_ATTRIBS
|
||||
span.interpMask |= (SPAN_TEXTURE | SPAN_VARYING);
|
||||
{
|
||||
/* win[3] is 1/W */
|
||||
@@ -719,7 +720,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
|
||||
GLfixed sLeft=0, dsOuter=0, dsInner;
|
||||
GLfixed tLeft=0, dtOuter=0, dtInner;
|
||||
#endif
|
||||
#ifdef INTERP_TEX
|
||||
#ifdef INTERP_ATTRIBS
|
||||
GLfloat sLeft[FRAG_ATTRIB_MAX];
|
||||
GLfloat tLeft[FRAG_ATTRIB_MAX];
|
||||
GLfloat uLeft[FRAG_ATTRIB_MAX];
|
||||
@@ -986,7 +987,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
|
||||
dtOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][1]);
|
||||
}
|
||||
#endif
|
||||
#ifdef INTERP_TEX
|
||||
#ifdef INTERP_ATTRIBS
|
||||
ATTRIB_LOOP_BEGIN
|
||||
const GLfloat invW = vLower->win[3];
|
||||
const GLfloat s0 = vLower->attrib[attr][0] * invW;
|
||||
@@ -1057,7 +1058,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
|
||||
dsInner = dsOuter + span.intTexStep[0];
|
||||
dtInner = dtOuter + span.intTexStep[1];
|
||||
#endif
|
||||
#ifdef INTERP_TEX
|
||||
#ifdef INTERP_ATTRIBS
|
||||
ATTRIB_LOOP_BEGIN
|
||||
dsInner[attr] = dsOuter[attr] + span.attrStepX[attr][0];
|
||||
dtInner[attr] = dtOuter[attr] + span.attrStepX[attr][1];
|
||||
@@ -1106,7 +1107,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
|
||||
span.intTex[1] = tLeft;
|
||||
#endif
|
||||
|
||||
#ifdef INTERP_TEX
|
||||
#ifdef INTERP_ATTRIBS
|
||||
ATTRIB_LOOP_BEGIN
|
||||
span.attrStart[attr][0] = sLeft[attr];
|
||||
span.attrStart[attr][1] = tLeft[attr];
|
||||
@@ -1194,7 +1195,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
|
||||
sLeft += dsOuter;
|
||||
tLeft += dtOuter;
|
||||
#endif
|
||||
#ifdef INTERP_TEX
|
||||
#ifdef INTERP_ATTRIBS
|
||||
ATTRIB_LOOP_BEGIN
|
||||
sLeft[attr] += dsOuter[attr];
|
||||
tLeft[attr] += dtOuter[attr];
|
||||
@@ -1239,7 +1240,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
|
||||
sLeft += dsInner;
|
||||
tLeft += dtInner;
|
||||
#endif
|
||||
#ifdef INTERP_TEX
|
||||
#ifdef INTERP_ATTRIBS
|
||||
ATTRIB_LOOP_BEGIN
|
||||
sLeft[attr] += dsInner[attr];
|
||||
tLeft[attr] += dtInner[attr];
|
||||
@@ -1276,7 +1277,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
|
||||
#undef INTERP_SPEC
|
||||
#undef INTERP_INDEX
|
||||
#undef INTERP_INT_TEX
|
||||
#undef INTERP_TEX
|
||||
#undef INTERP_ATTRIBS
|
||||
#undef TEX_UNIT_LOOP
|
||||
#undef VARYING_LOOP
|
||||
|
||||
|
@@ -135,7 +135,7 @@ void TAG(translate_vertex)(GLcontext *ctx,
|
||||
dst->specular[1] = src->v.specular.green;
|
||||
dst->specular[2] = src->v.specular.blue;
|
||||
|
||||
dst->fog = src->v.specular.alpha/255.0;
|
||||
dst->attrib[FRAG_ATTRIB_FOGC][0] = src->v.specular.alpha/255.0;
|
||||
|
||||
if (HAVE_PTEX_VERTICES &&
|
||||
((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) ||
|
||||
|
Reference in New Issue
Block a user