Compare commits
47 Commits
mesa_3_4_1
...
mesa_3_4_2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
217ff8f196 | ||
|
|
06e6793b60 | ||
|
|
e01975967a | ||
|
|
82313b4df0 | ||
|
|
1e3b2d9b7e | ||
|
|
b96b92f7ec | ||
|
|
8184f76f02 | ||
|
|
1edc9d7248 | ||
|
|
c80ee2065a | ||
|
|
e8bf438419 | ||
|
|
f4f8dc57b6 | ||
|
|
446b09ef66 | ||
|
|
9edd7c1538 | ||
|
|
e1b0819815 | ||
|
|
72af1b921e | ||
|
|
f68bfe0b5c | ||
|
|
b585fdcefc | ||
|
|
f752017f5b | ||
|
|
3fef3e49bc | ||
|
|
259de69210 | ||
|
|
3063e1da09 | ||
|
|
62abec65c9 | ||
|
|
bb4f463d1c | ||
|
|
0f6e64513b | ||
|
|
32fda642b2 | ||
|
|
72d4c40401 | ||
|
|
032908842a | ||
|
|
89e8b95d8b | ||
|
|
736400f6b9 | ||
|
|
9a7cc899e1 | ||
|
|
9d2eba0c20 | ||
|
|
c32ad4d4be | ||
|
|
deb0a3d786 | ||
|
|
45902de9c6 | ||
|
|
b11ce6f485 | ||
|
|
df89122630 | ||
|
|
e4410ab230 | ||
|
|
ab0bfd3f84 | ||
|
|
ccab03eaaa | ||
|
|
0e60b90ed5 | ||
|
|
a387769bb9 | ||
|
|
bd61d1b46d | ||
|
|
7c06923b95 | ||
|
|
ce26824c68 | ||
|
|
026c1b2e9c | ||
|
|
da2cccaba2 | ||
|
|
7987dbf70d |
@@ -1,13 +1,13 @@
|
||||
# $Id: Make-config,v 1.25.4.6 2001/01/24 04:49:27 brianp Exp $
|
||||
# $Id: Make-config,v 1.25.4.7 2001/05/14 19:11:32 brianp Exp $
|
||||
|
||||
MESA_MAJOR=3
|
||||
MESA_MINOR=4
|
||||
MESA_TINY=1
|
||||
MESA_TINY=2
|
||||
VERSION=$(MESA_MAJOR).$(MESA_MINOR)
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
#
|
||||
# Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
# Copyright (C) 1999-2001 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"),
|
||||
|
||||
14
Makefile.X11
14
Makefile.X11
@@ -1,9 +1,9 @@
|
||||
# $Id: Makefile.X11,v 1.32.2.7 2001/02/07 23:49:26 brianp Exp $
|
||||
# $Id: Makefile.X11,v 1.32.2.8 2001/05/16 20:37:47 brianp Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.4.1
|
||||
# Version: 3.4.2
|
||||
#
|
||||
# Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
# Copyright (C) 1999-2001 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"),
|
||||
@@ -320,10 +320,10 @@ realclean: clean
|
||||
|
||||
|
||||
|
||||
DIRECTORY = Mesa-3.4.1
|
||||
LIB_NAME = MesaLib-3.4.1
|
||||
DEMO_NAME = MesaDemos-3.4.1
|
||||
GLU_NAME = MesaGLU-3.4.1
|
||||
DIRECTORY = Mesa-3.4.2
|
||||
LIB_NAME = MesaLib-3.4.2
|
||||
DEMO_NAME = MesaDemos-3.4.2
|
||||
GLU_NAME = MesaGLU-3.4.2
|
||||
GLUT_NAME = GLUT-3.7
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
3Dfx Glide device driver for Mesa 3.4.1
|
||||
3Dfx Glide device driver for Mesa 3.4.2
|
||||
(see below for FAQ)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ What do you need ?
|
||||
under Linux (more information in the "Useful Glide Environment
|
||||
Variables");
|
||||
|
||||
- Mesa 3.4.1;
|
||||
- Mesa 3.4.2;
|
||||
|
||||
- The 3Dfx Glide library 2.3 or later for your OS (the 2.4 works fine).
|
||||
The Voodoo2 requires the Glide library 2.51. The Glide 3.1 is not
|
||||
@@ -78,18 +78,18 @@ Linux:
|
||||
If your Glide libraries and headers are in a different directory
|
||||
you'll have to modify the Mesa-config and mklib.glide files.
|
||||
|
||||
- Unpack the MesaLib-3.4.1.tar.gz and MesaDemos-3.4.1.tar.gz archives;
|
||||
- Unpack the MesaLib-3.4.2.tar.gz and MesaDemos-3.4.2.tar.gz archives;
|
||||
|
||||
- If you're going to use a newer Mesa/Glide driver than v0.27 then
|
||||
unpack the new driver archive over the Mesa directory.
|
||||
|
||||
- In the Mesa-3.4.1 directory type "make linux-glide"
|
||||
- In the Mesa-3.4.2 directory type "make linux-glide"
|
||||
|
||||
- Compilation _should_ finish without errors;
|
||||
|
||||
- Set your LD_LIBRARY_PATH environment variable so that the
|
||||
libglide2x.so and Mesa library files can be found. For example:
|
||||
setenv LD_LIBRARY_PATH "/usr/local/glide/lib:/SOMEDIR/Mesa-3.4.1/lib"
|
||||
setenv LD_LIBRARY_PATH "/usr/local/glide/lib:/SOMEDIR/Mesa-3.4.2/lib"
|
||||
|
||||
- You'll have to run Glide-based programs as root or set the suid
|
||||
bit on executables;
|
||||
@@ -115,10 +115,10 @@ MS Windows:
|
||||
|
||||
- You must have the vcvars32.bat script in your PATH;
|
||||
|
||||
- Go to the directory Mesa-3.4.1 and run the mesafx.bat;
|
||||
- Go to the directory Mesa-3.4.2 and run the mesafx.bat;
|
||||
|
||||
- The script will compile everything (Mesa-3.4.1/lib/OpenGL32.{lib,dll},
|
||||
Mesa-3.4.1/lib/GLU32.{lib,dll}, Mesa-3.4.1/lib/GLUT32.{lib,dll};
|
||||
- The script will compile everything (Mesa-3.4.2/lib/OpenGL32.{lib,dll},
|
||||
Mesa-3.4.2/lib/GLU32.{lib,dll}, Mesa-3.4.2/lib/GLUT32.{lib,dll};
|
||||
|
||||
- Try some demo (fire.exe, teapot.exe, etc.) in order to check if
|
||||
everything is OK (you can use Alt-Tab or Ctrl-F9 to switch between
|
||||
@@ -386,7 +386,7 @@ Hints and Special Features:
|
||||
- The Voodoo driver support multiple Voodoo Graphics boards in the
|
||||
some PC. Using this feature, you can write applications that use
|
||||
multiple monitors, videoprojectors or HMDs for the output. See
|
||||
Mesa-3.4.1/demos/tunnel2.c for an example of how setup one
|
||||
Mesa-3.4.2/demos/tunnel2.c for an example of how setup one
|
||||
context for each board.
|
||||
|
||||
- The v0.19 introduces a new powerful texture memory manager: the
|
||||
@@ -404,7 +404,7 @@ Hints and Special Features:
|
||||
- The Voodoo driver supports the GL_EXT_paletted_texture. it works
|
||||
only with GL_COLOR_INDEX8_EXT, GL_RGBA palettes and the alpha value
|
||||
is ignored because this is a limitation of the the current Glide
|
||||
version and of the Voodoo hardware. See Mesa-3.4.1/demos/paltex.c
|
||||
version and of the Voodoo hardware. See Mesa-3.4.2/demos/paltex.c
|
||||
for a demo of this extension.
|
||||
|
||||
- The Voodoo driver chooses the screen resolution according to the
|
||||
@@ -476,12 +476,12 @@ version of GLQuake with works with the Mesa/3Dfx/Glide combo.
|
||||
Here's what you need to run GLQuake on Linux:
|
||||
PC with 100MHz Pentium or better
|
||||
a 3Dfx-based card
|
||||
Mesa 3.4.1 libraries: libGL.so libGLU.so
|
||||
Mesa 3.4.2 libraries: libGL.so libGLU.so
|
||||
Glide 2.4 libraries: libglide2x.so libtexus.so
|
||||
GLQuake for Linux.
|
||||
|
||||
Also, the windows version of GLQuake works fine with the Mesa OpenGL32.dll,
|
||||
you have only to copy the Mesa-3.4.1/lib/OpenGL32.dll in the GLQuake directory
|
||||
you have only to copy the Mesa-3.4.2/lib/OpenGL32.dll in the GLQuake directory
|
||||
in order to test 'MesaQuake'.
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
Mesa 3.4.1 Unix/X11 Information
|
||||
Mesa 3.4.2 Unix/X11 Information
|
||||
|
||||
|
||||
|
||||
@@ -323,4 +323,4 @@ Summary of X-related environment variables:
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: README.X11,v 3.5.4.2 2001/01/24 04:53:26 brianp Exp $
|
||||
$Id: README.X11,v 3.5.4.3 2001/05/14 19:11:32 brianp Exp $
|
||||
|
||||
22
docs/RELNOTES-3.4.2
Normal file
22
docs/RELNOTES-3.4.2
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
Mesa 3.4.2 release notes
|
||||
|
||||
May 17, 2001
|
||||
|
||||
PLEASE READ!!!!
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 3.3) designate new developmental releases.
|
||||
Even numbered versions (such as 3.4) designate stable releases.
|
||||
|
||||
Mesa 3.4.2 is a maintenance release that simply fixes bugs found since
|
||||
the Mesa 3.4.1 release. For details, see the VERSIONS file.
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-3.4.2,v 1.1.2.2 2001/05/16 22:29:07 brianp Exp $
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: VERSIONS,v 1.38.2.29 2001/02/14 15:25:06 brianp Exp $
|
||||
$Id: VERSIONS,v 1.38.2.46 2001/05/17 19:31:55 brianp Exp $
|
||||
|
||||
|
||||
Mesa Version History
|
||||
@@ -801,3 +801,25 @@ Mesa Version History
|
||||
- fixed RGB color over/underflow bug for very tiny triangles
|
||||
Known problems:
|
||||
- NURBS or evaluator surfaces inside display lists don't always work
|
||||
|
||||
3.4.2 May 17, 2001
|
||||
Bug fixes:
|
||||
- deleting the currently bound texture could cause bad problems
|
||||
- using fog could result in random vertex alpha values
|
||||
- AA triangle rendering could touch pixels outside right window bound
|
||||
- fixed byteswapping problem in clear_32bit_ximage() function
|
||||
- fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam
|
||||
- fixed memory leak in glXUseXFont()
|
||||
- fragment sampling in AA triangle function was off by 1/2 pixel
|
||||
- Windows: reading pixels from framebuffer didn't always work
|
||||
- glConvolutionFilter2D could segfault or cause FP exception
|
||||
- fixed segfaults in FX and X drivers when using tex unit 1 but not 0
|
||||
- GL_NAND logicop didn't work right in RGBA mode
|
||||
- fixed a memory corruption bug in vertex buffer reset code
|
||||
- clearing the softwara alpha buffer with scissoring was broken
|
||||
- fixed a few color index mode fog bugs
|
||||
- fixed some bad assertions in color index mode
|
||||
- fixed FX line 'stipple' bug #420091
|
||||
Changes:
|
||||
- optimized writing mono-colored pixel spans to X pixmaps
|
||||
- increased max viewport size to 2048 x 2048
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: gl.h,v 1.44.4.2 2001/01/06 22:43:00 gareth Exp $ */
|
||||
/* $Id: gl.h,v 1.44.4.3 2001/03/21 15:59:49 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -44,11 +44,11 @@
|
||||
#define OPENSTEP
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(__WIN32__)
|
||||
#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
|
||||
#define __WIN32__
|
||||
#endif
|
||||
|
||||
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
|
||||
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
|
||||
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
|
||||
# define GLAPI __declspec(dllexport)
|
||||
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
|
||||
@@ -63,7 +63,7 @@
|
||||
# define GLAPIENTRY
|
||||
#endif /* WIN32 / CYGWIN bracket */
|
||||
|
||||
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
|
||||
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
|
||||
#include <gl/mesa_wgl.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* $Id: gl_mangle.h,v 1.4 2000/01/04 08:07:09 brianp Exp $ */
|
||||
/* $Id: gl_mangle.h,v 1.4.4.1 2001/02/19 18:29:20 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.4.x
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2001 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"),
|
||||
@@ -535,5 +535,128 @@
|
||||
#define glCopyColorTable mglCopyColorTable
|
||||
#define glLockArraysEXT mglLockArraysEXT
|
||||
#define glUnlockArraysEXT mglUnlockArraysEXT
|
||||
#define glGetFinalCombinerInputParameterivNV mglGetFinalCombinerInputParameterivNV
|
||||
#define glGetFinalCombinerInputParameterfvNV mglGetFinalCombinerInputParameterfvNV
|
||||
#define glGetCombinerOutputParameterivNV mglGetCombinerOutputParameterivNV
|
||||
#define glGetCombinerOutputParameterfvNV mglGetCombinerOutputParameterfvNV
|
||||
#define glGetCombinerInputParameterivNV mglGetCombinerInputParameterivNV
|
||||
#define glGetCombinerInputParameterfvNV mglGetCombinerInputParameterfvNV
|
||||
#define glFinalCombinerInputNV mglFinalCombinerInputNV
|
||||
#define glCombinerOutputNV mglCombinerOutputNV
|
||||
#define glCombinerInputNV mglCombinerInputNV
|
||||
#define glCombinerParameteriNV mglCombinerParameteriNV
|
||||
#define glCombinerParameterivNV mglCombinerParameterivNV
|
||||
#define glCombinerParameterfNV mglCombinerParameterfNV
|
||||
#define glCombinerParameterfvNV mglCombinerParameterfvNV
|
||||
#define glVertexArrayRangeNV mglVertexArrayRangeNV
|
||||
#define glFlushVertexArrayRangeNV mglFlushVertexArrayRangeNV
|
||||
#define glVertexWeightPointerEXT mglVertexWeightPointerEXT
|
||||
#define glVertexWeightfvEXT mglVertexWeightfvEXT
|
||||
#define glVertexWeightfEXT mglVertexWeightfEXT
|
||||
#define glBlendFuncSeparateEXT mglBlendFuncSeparateEXT
|
||||
#define glFogCoordPointerEXT mglFogCoordPointerEXT
|
||||
#define glFogCoorddEXT mglFogCoorddEXT
|
||||
#define glFogCoordfvEXT mglFogCoordfvEXT
|
||||
#define glFogCoordfEXT mglFogCoordfEXT
|
||||
#define glLightEnviSGIX mglLightEnviSGIX
|
||||
#define glGetFragmentMaterialivSGIX mglGetFragmentMaterialivSGIX
|
||||
#define glGetFragmentMaterialfvSGIX mglGetFragmentMaterialfvSGIX
|
||||
#define glGetFragmentLightivSGIX mglGetFragmentLightivSGIX
|
||||
#define glGetFragmentLightfvSGIX mglGetFragmentLightfvSGIX
|
||||
#define glFragmentMaterialivSGIX mglFragmentMaterialivSGIX
|
||||
#define glFragmentMaterialiSGIX mglFragmentMaterialiSGIX
|
||||
#define glFragmentMaterialfvSGIX mglFragmentMaterialfvSGIX
|
||||
#define glFragmentMaterialfSGIX mglFragmentMaterialfSGIX
|
||||
#define glFragmentLightModelivSGIX mglFragmentLightModelivSGIX
|
||||
#define glFragmentLightModeliSGIX mglFragmentLightModeliSGIX
|
||||
#define glFragmentLightModelfvSGIX mglFragmentLightModelfvSGIX
|
||||
#define glFragmentLightModelfSGIX mglFragmentLightModelfSGIX
|
||||
#define glFragmentLightivSGIX mglFragmentLightivSGIX
|
||||
#define glFragmentLightiSGIX mglFragmentLightiSGIX
|
||||
#define glFragmentLightfvSGIX mglFragmentLightfvSGIX
|
||||
#define glFragmentLightfSGIX mglFragmentLightfSGIX
|
||||
#define glFragmentColorMaterialSGIX mglFragmentColorMaterialSGIX
|
||||
#define glCullParameterdvEXT mglCullParameterdvEXT
|
||||
#define glCullParameterfvEXT mglCullParameterfvEXT
|
||||
#define glIndexFuncEXT mglIndexFuncEXT
|
||||
#define glIndexMaterialEXT mglIndexMaterialEXT
|
||||
#define glListParameterivSGIX mglListParameterivSGIX
|
||||
#define glListParameteriSGIX mglListParameteriSGIX
|
||||
#define glListParameterfvSGIX mglListParameterfvSGIX
|
||||
#define glListParameterfSGIX mglListParameterfSGIX
|
||||
#define glGetListParameterivSGIX mglGetListParameterivSGIX
|
||||
#define glGetListParameterfvSGIX mglGetListParameterfvSGIX
|
||||
#define glHintPGI mglHintPGI
|
||||
#define glCopyColorSubTableEXT mglCopyColorSubTableEXT
|
||||
#define glFlushRasterSGIX mglFlushRasterSGIX
|
||||
#define glReferencePlaneSGIX mglReferencePlaneSGIX
|
||||
#define glTagSampleBufferSGIX mglTagSampleBufferSGIX
|
||||
#define glFrameZoomSGIX mglFrameZoomSGIX
|
||||
#define glGetInstrumentsSGIX mglGetInstrumentsSGIX
|
||||
#define glPollInstrumentsSGIX mglPollInstrumentsSGIX
|
||||
#define glReadInstrumentsSGIX mglReadInstrumentsSGIX
|
||||
#define glStopInstrumentsSGIX mglStopInstrumentsSGIX
|
||||
#define glStartInstrumentsSGIX mglStartInstrumentsSGIX
|
||||
#define glInstrumentsBufferSGIX mglInstrumentsBufferSGIX
|
||||
#define glPointParameterfvSGIS mglPointParameterfvSGIS
|
||||
#define glPointParameterfSGIS mglPointParameterfSGIS
|
||||
#define glSpriteParameterivSGIX mglSpriteParameterivSGIX
|
||||
#define glSpriteParameteriSGIX mglSpriteParameteriSGIX
|
||||
#define glSpriteParameterfvSGIX mglSpriteParameterfvSGIX
|
||||
#define glSpriteParameterfSGIX mglSpriteParameterfSGIX
|
||||
#define glSamplePatternSGIS mglSamplePatternSGIS
|
||||
#define glSampleMaskSGIS mglSampleMaskSGIS
|
||||
#define glSharpenTexFuncSGIS mglSharpenTexFuncSGIS
|
||||
#define glGetSharpenTexFuncSGIS mglGetSharpenTexFuncSGIS
|
||||
#define glGetDetailTexFuncSGIS mglGetDetailTexFuncSGIS
|
||||
#define glDetailTexFuncSGIS mglDetailTexFuncSGIS
|
||||
#define glTexSubImage4DSGIS mglTexSubImage4DSGIS
|
||||
#define glTexImage4DSGIS mglTexImage4DSGIS
|
||||
#define glGetPixelTexGenParameterivSGIS mglGetPixelTexGenParameterivSGIS
|
||||
#define glGetPixelTexGenParameterfvSGIS mglGetPixelTexGenParameterfvSGIS
|
||||
#define glPixelTexGenParameteriSGIS mglPixelTexGenParameteriSGIS
|
||||
#define glPixelTexGenParameterfSGIS mglPixelTexGenParameterfSGIS
|
||||
#define glGetColorTableParameterivSGI mglGetColorTableParameterivSGI
|
||||
#define glGetColorTableParameterfvSGI mglGetColorTableParameterfvSGI
|
||||
#define glGetColorTableSGI mglGetColorTableSGI
|
||||
#define glCopyColorTableSGI mglCopyColorTableSGI
|
||||
#define glColorTableParameterivSGI mglColorTableParameterivSGI
|
||||
#define glColorTableParameterfvSGI mglColorTableParameterfvSGI
|
||||
#define glColorTableSGI mglColorTableSGI
|
||||
#define glSeparableFilter2DEXT mglSeparableFilter2DEXT
|
||||
#define glGetSeparableFilterEXT mglGetSeparableFilterEXT
|
||||
#define glGetConvolutionParameterfvEXT mglGetConvolutionParameterfvEXT
|
||||
#define glGetConvolutionParameterivEXT mglGetConvolutionParameterivEXT
|
||||
#define glGetConvolutionFilterEXT mglGetConvolutionFilterEXT
|
||||
#define glCopyConvolutionFilter2DEXT mglCopyConvolutionFilter2DEXT
|
||||
#define glCopyConvolutionFilter1DEXT mglCopyConvolutionFilter1DEXT
|
||||
#define glConvolutionParameterivEXT mglConvolutionParameterivEXT
|
||||
#define glConvolutionParameteriEXT mglConvolutionParameteriEXT
|
||||
#define glConvolutionParameterfvEXT mglConvolutionParameterfvEXT
|
||||
#define glConvolutionParameterfEXT mglConvolutionParameterfEXT
|
||||
#define glConvolutionFilter2DEXT mglConvolutionFilter2DEXT
|
||||
#define glConvolutionFilter1DEXT mglConvolutionFilter1DEXT
|
||||
#define glResetMinmaxEXT mglResetMinmaxEXT
|
||||
#define glResetHistogramEXT mglResetHistogramEXT
|
||||
#define glMinmaxEXT mglMinmaxEXT
|
||||
#define glHistogramEXT mglHistogramEXT
|
||||
#define glGetMinmaxParameterivEXT mglGetMinmaxParameterivEXT
|
||||
#define glGetMinmaxParameterfvEXT mglGetMinmaxParameterfvEXT
|
||||
#define glGetMinmaxEXT mglGetMinmaxEXT
|
||||
#define glGetHistogramParameterivEXT mglGetHistogramParameterivEXT
|
||||
#define glGetHistogramParameterfvEXT mglGetHistogramParameterfvEXT
|
||||
#define glGetHistogramEXT mglGetHistogramEXT
|
||||
#define glCopyTexSubImage2DEXT mglCopyTexSubImage2DEXT
|
||||
#define glCopyTexSubImage1DEXT mglCopyTexSubImage1DEXT
|
||||
#define glCopyTexImage2DEXT mglCopyTexImage2DEXT
|
||||
#define glCopyTexImage1DEXT mglCopyTexImage1DEXT
|
||||
#define glTexSubImage2DEXT mglTexSubImage2DEXT
|
||||
#define glTexSubImage1DEXT mglTexSubImage1DEXT
|
||||
#define glSampleCoverageARB mglSampleCoverageARB
|
||||
#define glSamplePassARB mglSamplePassARB
|
||||
#define glMultTransposeMatrixfARB mglMultTransposeMatrixfARB
|
||||
#define glMultTransposeMatrixdARB mglMultTransposeMatrixdARB
|
||||
#define glLoadTransposeMatrixfARB mglLoadTransposeMatrixfARB
|
||||
#define glLoadTransposeMatrixdARB mglLoadTransposeMatrixdARB
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: glu.c,v 1.21.2.2 2001/01/24 04:49:27 brianp Exp $ */
|
||||
/* $Id: glu.c,v 1.21.2.3 2001/05/14 19:11:33 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -302,7 +302,7 @@ const GLubyte *GLAPIENTRY
|
||||
gluGetString(GLenum name)
|
||||
{
|
||||
static char *extensions = "GL_EXT_abgr";
|
||||
static char *version = "1.1 Mesa 3.4.1";
|
||||
static char *version = "1.1 Mesa 3.4.2";
|
||||
|
||||
switch (name) {
|
||||
case GLU_EXTENSIONS:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.X11,v 1.20 2000/07/14 14:55:04 brianp Exp $
|
||||
# $Id: Makefile.X11,v 1.20.2.2 2001/03/23 17:08:08 brianp Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.3
|
||||
@@ -77,6 +77,7 @@ CORE_SOURCES = \
|
||||
stages.c \
|
||||
state.c \
|
||||
stencil.c \
|
||||
texformat.c \
|
||||
teximage.c \
|
||||
texobj.c \
|
||||
texstate.c \
|
||||
@@ -132,9 +133,9 @@ DRIVER_SOURCES = \
|
||||
FX/fxvsetup.c \
|
||||
FX/fxglidew.c
|
||||
|
||||
ASM_SOURCES =
|
||||
ASM_SOURCES =
|
||||
|
||||
ADDITIONAL_OBJ =
|
||||
ADDITIONAL_OBJ =
|
||||
|
||||
OBJECTS = $(ASM_SOURCES:.S=.o) \
|
||||
$(CORE_SOURCES:.c=.o) \
|
||||
@@ -222,6 +223,7 @@ X86/3dnow.o: X86/3dnow.c
|
||||
X86/katmai.o: X86/katmai.c
|
||||
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
#default:
|
||||
@@ -234,7 +236,7 @@ clean:
|
||||
targets: $(LIBDIR)/$(GL_LIB)
|
||||
|
||||
# Make the library
|
||||
$(LIBDIR)/$(GL_LIB): $(OBJECTS)
|
||||
$(LIBDIR)/$(GL_LIB): $(GENERATED_SOURCES) $(OBJECTS)
|
||||
$(MAKELIB) $(GL_LIB) $(GL_MAJOR) $(GL_MINOR) $(GL_TINY) $(OBJECTS)
|
||||
rm -f $(LIBDIR)/$(GL_LIB)*
|
||||
mv $(GL_LIB)* $(LIBDIR)
|
||||
@@ -249,9 +251,9 @@ include depend
|
||||
#
|
||||
# Run 'make dep' to update the dependencies if you change what's included
|
||||
# by any source file.
|
||||
#
|
||||
dep: $(CORE_SOURCES) $(DRIVER_SOURCES)
|
||||
makedepend -fdepend -Y -I../include -DGGI -DSVGA -DFX $(CORE_SOURCES) $(DRIVER_SOURCES)
|
||||
#
|
||||
dep: $(CORE_SOURCES) $(DRIVER_SOURCES) $(ASM_SOURCES)
|
||||
makedepend -fdepend -Y -I../include $(CFLAGS) -DGGI -DSVGA -DFX $(CORE_SOURCES) $(DRIVER_SOURCES) $(ASM_SOURCES)
|
||||
|
||||
tags:
|
||||
etags `find . -name \*.[ch]` `find ../include`
|
||||
|
||||
@@ -986,7 +986,7 @@ static GLboolean fxIsInHardware(GLcontext *ctx)
|
||||
if (ctx->Texture.ReallyEnabled & TEXTURE1_2D) {
|
||||
if (ctx->Texture.Unit[1].EnvMode == GL_BLEND)
|
||||
return GL_FALSE;
|
||||
if (ctx->Texture.Unit[0].Current->Image[0]->Border > 0)
|
||||
if (ctx->Texture.Unit[1].Current->Image[0]->Border > 0)
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,169 @@
|
||||
#include "fxdrv.h"
|
||||
#include "image.h"
|
||||
#include "texutil.h"
|
||||
#include "texformat.h"
|
||||
|
||||
|
||||
static GLint
|
||||
bytesPerTexel(GLint mesaFormat)
|
||||
{
|
||||
switch (mesaFormat) {
|
||||
case MESA_FORMAT_RGBA8888:
|
||||
return 4;
|
||||
case MESA_FORMAT_ABGR8888:
|
||||
return 4;
|
||||
case MESA_FORMAT_ARGB8888:
|
||||
return 4;
|
||||
case MESA_FORMAT_RGB888:
|
||||
return 4;
|
||||
case MESA_FORMAT_BGR888:
|
||||
return 4;
|
||||
case MESA_FORMAT_RGB565:
|
||||
return 2;
|
||||
case MESA_FORMAT_ARGB4444:
|
||||
return 2;
|
||||
case MESA_FORMAT_ARGB1555:
|
||||
return 2;
|
||||
case MESA_FORMAT_AL88:
|
||||
return 2;
|
||||
case MESA_FORMAT_RGB332:
|
||||
return 1;
|
||||
case MESA_FORMAT_A8:
|
||||
return 1;
|
||||
case MESA_FORMAT_L8:
|
||||
return 1;
|
||||
case MESA_FORMAT_I8:
|
||||
return 1;
|
||||
case MESA_FORMAT_CI8:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This is a bit of a hack. We just need it for Mesa 3.4.2 in order
|
||||
* to keep the FX driver working. This is all different in 3.5
|
||||
*/
|
||||
static GLboolean
|
||||
_mesa_convert_teximage(GLint mesaFormat, GLint dstWidth, GLint dstHeight,
|
||||
void *destPtr, GLint dstStride,
|
||||
GLint srcWidth, GLint srcHeight,
|
||||
GLenum format, GLenum type, const GLvoid *srcPtr,
|
||||
const struct gl_pixelstore_attrib *packing)
|
||||
{
|
||||
if (srcWidth != dstWidth || srcHeight != dstHeight) {
|
||||
/* rescale (needed because of Glide's 1:8 texture aspect limitation) */
|
||||
GLvoid *tmpImage;
|
||||
GLint texelBytes;
|
||||
GLboolean b;
|
||||
|
||||
assert(dstWidth >= srcWidth);
|
||||
assert(dstHeight >= dstHeight);
|
||||
|
||||
texelBytes = _mesa_bytes_per_pixel(format, type);
|
||||
tmpImage = MALLOC(dstWidth * dstHeight * texelBytes);
|
||||
if (!tmpImage) {
|
||||
return GL_FALSE; /* out of mem */
|
||||
}
|
||||
b = _mesa_convert_texsubimage2d(mesaFormat,
|
||||
0, 0, /* xoffset, yoffset */
|
||||
srcWidth, srcHeight,
|
||||
dstWidth,
|
||||
format, type,
|
||||
packing,
|
||||
srcPtr, tmpImage);
|
||||
if (!b) {
|
||||
/* can't handle this pixel format/type/packing combination */
|
||||
FREE(tmpImage);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
texelBytes = bytesPerTexel(mesaFormat);
|
||||
if (!texelBytes) {
|
||||
FREE(tmpImage);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
/* rescale now */
|
||||
_mesa_rescale_teximage2d(texelBytes, srcWidth, srcHeight,
|
||||
dstWidth, dstHeight, tmpImage, destPtr);
|
||||
FREE(tmpImage);
|
||||
return GL_TRUE;
|
||||
}
|
||||
else {
|
||||
/* rescale not needed */
|
||||
return _mesa_convert_texsubimage2d(mesaFormat,
|
||||
0, 0, /* xoffset, yoffset */
|
||||
dstWidth, dstHeight,
|
||||
dstWidth,
|
||||
format, type,
|
||||
packing,
|
||||
srcPtr, destPtr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static GLboolean
|
||||
_mesa_convert_texsubimage(GLint mesaFormat, GLint xoffset, GLint yoffset,
|
||||
GLint dstWidth, GLint dstHeight,
|
||||
void *destPtr, GLint dstStride,
|
||||
GLint subWidth, GLint subHeight,
|
||||
GLint srcWidth, GLint srcHeight,
|
||||
GLenum format, GLenum type, const GLvoid *srcPtr,
|
||||
const struct gl_pixelstore_attrib *packing)
|
||||
{
|
||||
if (dstWidth != srcWidth || dstHeight != srcHeight) {
|
||||
/* bail out on texsubimage changes that need rescale. TexImage2D
|
||||
* will get called instead.
|
||||
*/
|
||||
return GL_FALSE;
|
||||
}
|
||||
else {
|
||||
return _mesa_convert_texsubimage2d(mesaFormat,
|
||||
xoffset, yoffset,
|
||||
subWidth, subHeight,
|
||||
dstWidth,
|
||||
format, type,
|
||||
packing,
|
||||
srcPtr, destPtr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_mesa_unconvert_teximage(GLint mesaFormat, GLint srcWidth, GLint srcHeight,
|
||||
const GLvoid *srcPtr,
|
||||
GLint srcStride, GLint dstWidth, GLint dstHeight,
|
||||
GLenum dstFormat, GLvoid *dstPtr)
|
||||
{
|
||||
if (srcWidth != dstWidth || srcHeight != dstHeight) {
|
||||
/* need to rescale image */
|
||||
GLint texelBytes = bytesPerTexel(mesaFormat);
|
||||
GLvoid *tmpImage;
|
||||
|
||||
if (!texelBytes)
|
||||
return; /* bad format? */
|
||||
|
||||
tmpImage = MALLOC(srcWidth * srcHeight * texelBytes);
|
||||
if (!tmpImage) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* convert */
|
||||
_mesa_unconvert_teximage2d(mesaFormat, dstFormat, srcWidth, srcHeight,
|
||||
srcPtr, tmpImage);
|
||||
/* rescale */
|
||||
_mesa_rescale_teximage2d(texelBytes, srcWidth, srcHeight,
|
||||
dstWidth, dstHeight, tmpImage, dstPtr);
|
||||
FREE(tmpImage);
|
||||
}
|
||||
else {
|
||||
_mesa_unconvert_teximage2d(mesaFormat, dstFormat, srcWidth, srcHeight,
|
||||
srcPtr, dstPtr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void fxPrintTextureData(tfxTexInfo *ti)
|
||||
@@ -848,7 +1011,7 @@ GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
tfxTexInfo *ti = fxTMGetTexInfo(texObj);
|
||||
tfxMipMapLevel *mml = &ti->mipmapLevel[level];
|
||||
GLint dstWidth, dstHeight, wScale, hScale, texelSize, dstStride;
|
||||
MesaIntTexFormat intFormat;
|
||||
GLint mesaFormat;
|
||||
|
||||
fxTexGetFormat(texImage->IntFormat, &gldformat, NULL);
|
||||
|
||||
@@ -865,7 +1028,7 @@ GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
case GL_INTENSITY12:
|
||||
case GL_INTENSITY16:
|
||||
texelSize = 1;
|
||||
intFormat = MESA_I8;
|
||||
mesaFormat = MESA_FORMAT_I8;
|
||||
break;
|
||||
case 1:
|
||||
case GL_LUMINANCE:
|
||||
@@ -874,7 +1037,7 @@ GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
case GL_LUMINANCE12:
|
||||
case GL_LUMINANCE16:
|
||||
texelSize = 1;
|
||||
intFormat = MESA_L8;
|
||||
mesaFormat = MESA_FORMAT_L8;
|
||||
break;
|
||||
case GL_ALPHA:
|
||||
case GL_ALPHA4:
|
||||
@@ -882,7 +1045,7 @@ GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
case GL_ALPHA12:
|
||||
case GL_ALPHA16:
|
||||
texelSize = 1;
|
||||
intFormat = MESA_A8;
|
||||
mesaFormat = MESA_FORMAT_A8;
|
||||
break;
|
||||
case GL_COLOR_INDEX:
|
||||
case GL_COLOR_INDEX1_EXT:
|
||||
@@ -892,7 +1055,7 @@ GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
case GL_COLOR_INDEX12_EXT:
|
||||
case GL_COLOR_INDEX16_EXT:
|
||||
texelSize = 1;
|
||||
intFormat = MESA_C8;
|
||||
mesaFormat = MESA_FORMAT_CI8;
|
||||
break;
|
||||
case 2:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
@@ -903,7 +1066,7 @@ GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
case GL_LUMINANCE12_ALPHA12:
|
||||
case GL_LUMINANCE16_ALPHA16:
|
||||
texelSize = 2;
|
||||
intFormat = MESA_A8_L8;
|
||||
mesaFormat = MESA_FORMAT_AL88;
|
||||
break;
|
||||
case 3:
|
||||
case GL_RGB:
|
||||
@@ -915,7 +1078,7 @@ GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
case GL_RGB12:
|
||||
case GL_RGB16:
|
||||
texelSize = 2;
|
||||
intFormat = MESA_R5_G6_B5;
|
||||
mesaFormat = MESA_FORMAT_RGB565;
|
||||
break;
|
||||
case 4:
|
||||
case GL_RGBA:
|
||||
@@ -926,18 +1089,20 @@ GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
case GL_RGBA12:
|
||||
case GL_RGBA16:
|
||||
texelSize = 2;
|
||||
intFormat = MESA_A4_R4_G4_B4;
|
||||
mesaFormat = MESA_FORMAT_ARGB4444;
|
||||
break;
|
||||
case GL_RGB5_A1:
|
||||
texelSize = 2;
|
||||
intFormat = MESA_A1_R5_G5_B5;
|
||||
mesaFormat = MESA_FORMAT_ARGB1555;
|
||||
break;
|
||||
default:
|
||||
gl_problem(NULL, "tdfx driver: texbuildimagemap() bad format");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
_mesa_set_teximage_component_sizes(intFormat, texImage);
|
||||
/*
|
||||
_mesa_set_teximage_component_sizes(mesaFormat, texImage);
|
||||
*/
|
||||
|
||||
/*printf("teximage:\n");*/
|
||||
/* allocate new storage for texture image, if needed */
|
||||
@@ -957,7 +1122,7 @@ GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
dstStride = dstWidth * texelSize;
|
||||
|
||||
/* store the texture image */
|
||||
if (!_mesa_convert_teximage(intFormat, dstWidth, dstHeight, mml->data,
|
||||
if (!_mesa_convert_teximage(mesaFormat, dstWidth, dstHeight, mml->data,
|
||||
dstStride,
|
||||
texImage->Width, texImage->Height,
|
||||
format, type, pixels, packing)) {
|
||||
@@ -1014,7 +1179,7 @@ GLboolean fxDDTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
switch (mml->glideFormat) {
|
||||
case GR_TEXFMT_INTENSITY_8:
|
||||
dstStride = mml->width;
|
||||
result = _mesa_convert_texsubimage(MESA_I8, xoffset, yoffset,
|
||||
result = _mesa_convert_texsubimage(MESA_FORMAT_CI8, xoffset, yoffset,
|
||||
mml->width, mml->height, mml->data,
|
||||
dstStride, width, height,
|
||||
texImage->Width, texImage->Height,
|
||||
@@ -1022,7 +1187,7 @@ GLboolean fxDDTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
break;
|
||||
case GR_TEXFMT_ALPHA_8:
|
||||
dstStride = mml->width;
|
||||
result = _mesa_convert_texsubimage(MESA_A8, xoffset, yoffset,
|
||||
result = _mesa_convert_texsubimage(MESA_FORMAT_A8, xoffset, yoffset,
|
||||
mml->width, mml->height, mml->data,
|
||||
dstStride, width, height,
|
||||
texImage->Width, texImage->Height,
|
||||
@@ -1030,7 +1195,7 @@ GLboolean fxDDTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
break;
|
||||
case GR_TEXFMT_P_8:
|
||||
dstStride = mml->width;
|
||||
result = _mesa_convert_texsubimage(MESA_C8, xoffset, yoffset,
|
||||
result = _mesa_convert_texsubimage(MESA_FORMAT_CI8, xoffset, yoffset,
|
||||
mml->width, mml->height, mml->data,
|
||||
dstStride, width, height,
|
||||
texImage->Width, texImage->Height,
|
||||
@@ -1038,7 +1203,7 @@ GLboolean fxDDTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
break;
|
||||
case GR_TEXFMT_ALPHA_INTENSITY_88:
|
||||
dstStride = mml->width * 2;
|
||||
result = _mesa_convert_texsubimage(MESA_A8_L8, xoffset, yoffset,
|
||||
result = _mesa_convert_texsubimage(MESA_FORMAT_AL88, xoffset, yoffset,
|
||||
mml->width, mml->height, mml->data,
|
||||
dstStride, width, height,
|
||||
texImage->Width, texImage->Height,
|
||||
@@ -1046,7 +1211,7 @@ GLboolean fxDDTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
break;
|
||||
case GR_TEXFMT_RGB_565:
|
||||
dstStride = mml->width * 2;
|
||||
result = _mesa_convert_texsubimage(MESA_R5_G6_B5, xoffset, yoffset,
|
||||
result = _mesa_convert_texsubimage(MESA_FORMAT_RGB565, xoffset, yoffset,
|
||||
mml->width, mml->height, mml->data,
|
||||
dstStride, width, height,
|
||||
texImage->Width, texImage->Height,
|
||||
@@ -1054,7 +1219,7 @@ GLboolean fxDDTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
break;
|
||||
case GR_TEXFMT_ARGB_4444:
|
||||
dstStride = mml->width * 2;
|
||||
result = _mesa_convert_texsubimage(MESA_A4_R4_G4_B4, xoffset, yoffset,
|
||||
result = _mesa_convert_texsubimage(MESA_FORMAT_ARGB4444, xoffset, yoffset,
|
||||
mml->width, mml->height, mml->data,
|
||||
dstStride, width, height,
|
||||
texImage->Width, texImage->Height,
|
||||
@@ -1062,7 +1227,7 @@ GLboolean fxDDTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
|
||||
break;
|
||||
case GR_TEXFMT_ARGB_1555:
|
||||
dstStride = mml->width * 2;
|
||||
result = _mesa_convert_texsubimage(MESA_A1_R5_G5_B5, xoffset, yoffset,
|
||||
result = _mesa_convert_texsubimage(MESA_FORMAT_ARGB1555, xoffset, yoffset,
|
||||
mml->width, mml->height, mml->data,
|
||||
dstStride, width, height,
|
||||
texImage->Width, texImage->Height,
|
||||
@@ -1119,7 +1284,7 @@ GLvoid *fxDDGetTexImage(GLcontext *ctx, GLenum target, GLint level,
|
||||
ti = fxTMGetTexInfo(texObj);
|
||||
mml = &ti->mipmapLevel[level];
|
||||
if (mml->data) {
|
||||
MesaIntTexFormat mesaFormat;
|
||||
GLint mesaFormat;
|
||||
GLenum glFormat;
|
||||
struct gl_texture_image *texImage = texObj->Image[level];
|
||||
GLint srcStride;
|
||||
@@ -1130,37 +1295,37 @@ GLvoid *fxDDGetTexImage(GLcontext *ctx, GLenum target, GLint level,
|
||||
|
||||
switch (mml->glideFormat) {
|
||||
case GR_TEXFMT_INTENSITY_8:
|
||||
mesaFormat = MESA_I8;
|
||||
mesaFormat = MESA_FORMAT_CI8;
|
||||
glFormat = GL_INTENSITY;
|
||||
srcStride = mml->width;
|
||||
break;
|
||||
case GR_TEXFMT_ALPHA_INTENSITY_88:
|
||||
mesaFormat = MESA_A8_L8;
|
||||
mesaFormat = MESA_FORMAT_AL88;
|
||||
glFormat = GL_LUMINANCE_ALPHA;
|
||||
srcStride = mml->width;
|
||||
break;
|
||||
case GR_TEXFMT_ALPHA_8:
|
||||
mesaFormat = MESA_A8;
|
||||
mesaFormat = MESA_FORMAT_A8;
|
||||
glFormat = GL_ALPHA;
|
||||
srcStride = mml->width;
|
||||
break;
|
||||
case GR_TEXFMT_RGB_565:
|
||||
mesaFormat = MESA_R5_G6_B5;
|
||||
mesaFormat = MESA_FORMAT_RGB565;
|
||||
glFormat = GL_RGB;
|
||||
srcStride = mml->width * 2;
|
||||
break;
|
||||
case GR_TEXFMT_ARGB_4444:
|
||||
mesaFormat = MESA_A4_R4_G4_B4;
|
||||
mesaFormat = MESA_FORMAT_ARGB4444;
|
||||
glFormat = GL_RGBA;
|
||||
srcStride = mml->width * 2;
|
||||
break;
|
||||
case GR_TEXFMT_ARGB_1555:
|
||||
mesaFormat = MESA_A1_R5_G5_B5;
|
||||
mesaFormat = MESA_FORMAT_ARGB1555;
|
||||
glFormat = GL_RGBA;
|
||||
srcStride = mml->width * 2;
|
||||
break;
|
||||
case GR_TEXFMT_P_8:
|
||||
mesaFormat = MESA_C8;
|
||||
mesaFormat = MESA_FORMAT_CI8;
|
||||
glFormat = GL_COLOR_INDEX;
|
||||
srcStride = mml->width;
|
||||
break;
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES 1
|
||||
#include "fxdrv.h"
|
||||
#include <windows.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
@@ -64,7 +66,6 @@ extern "C" {
|
||||
|
||||
#include <stdio.h>
|
||||
#include "GL/fxmesa.h"
|
||||
#include "fxdrv.h"
|
||||
|
||||
#define MAX_MESA_ATTRS 20
|
||||
|
||||
@@ -867,4 +868,4 @@ BOOL GLAPIENTRY SwapBuffers(HDC hdc)
|
||||
return wglSwapBuffers(hdc);
|
||||
}
|
||||
|
||||
#endif /* FX */
|
||||
#endif /* __WIN32__ */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: wgl.c,v 1.2.6.1 2000/08/02 20:28:19 brianp Exp $ */
|
||||
/* $Id: wgl.c,v 1.2.6.3 2001/05/09 20:44:52 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@@ -247,7 +247,6 @@ static FIXED FixedFromDouble(double d)
|
||||
return *(FIXED *)&l;
|
||||
}
|
||||
|
||||
|
||||
GLAPI BOOL GLWINAPI wglUseFontBitmapsA(HDC hdc, DWORD first,
|
||||
DWORD count, DWORD listBase)
|
||||
{
|
||||
@@ -266,46 +265,45 @@ GLAPI BOOL GLWINAPI wglUseFontBitmapsA(HDC hdc, DWORD first,
|
||||
if (listBase<0)
|
||||
return FALSE;
|
||||
|
||||
font_list = glGenLists( count );
|
||||
if(font_list == 0)
|
||||
return FALSE;
|
||||
font_list = listBase;
|
||||
|
||||
mat.eM11 = FixedFromDouble(1);
|
||||
mat.eM12 = FixedFromDouble(0);
|
||||
mat.eM21 = FixedFromDouble(0);
|
||||
mat.eM22 = FixedFromDouble(1);
|
||||
mat.eM22 = FixedFromDouble(-1);
|
||||
|
||||
memset(&gm,0,sizeof(gm));
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
DWORD err;
|
||||
|
||||
glNewList( font_list+i, GL_COMPILE );
|
||||
|
||||
/* allocate space for the bitmap/outline */
|
||||
size = GetGlyphOutline(hdc, first + i, GGO_BITMAP, &gm, 0, NULL, &mat);
|
||||
if (size == GDI_ERROR)
|
||||
{
|
||||
DWORD err;
|
||||
err = GetLastError();
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
hBits = GlobalAlloc(GHND, size);
|
||||
hBits = GlobalAlloc(GHND, size+1);
|
||||
lpBits = GlobalLock(hBits);
|
||||
|
||||
err =
|
||||
GetGlyphOutline(hdc, /* handle to device context */
|
||||
first + i, /* character to query */
|
||||
GGO_BITMAP, /* format of data to return */
|
||||
&gm, /* pointer to structure for metrics */
|
||||
&gm, /* pointer to structure for metrics*/
|
||||
size, /* size of buffer for data */
|
||||
lpBits, /* pointer to buffer for data */
|
||||
&mat /* pointer to transformation */
|
||||
/* matrix structure */
|
||||
);
|
||||
|
||||
if (*lpBits == GDI_ERROR)
|
||||
if (err == GDI_ERROR)
|
||||
{
|
||||
DWORD err;
|
||||
err = GetLastError();
|
||||
|
||||
GlobalUnlock(hBits);
|
||||
@@ -315,7 +313,7 @@ GLAPI BOOL GLWINAPI wglUseFontBitmapsA(HDC hdc, DWORD first,
|
||||
}
|
||||
|
||||
glBitmap(gm.gmBlackBoxX,gm.gmBlackBoxY,
|
||||
gm.gmptGlyphOrigin.x,
|
||||
-gm.gmptGlyphOrigin.x,
|
||||
gm.gmptGlyphOrigin.y,
|
||||
gm.gmCellIncX,gm.gmCellIncY,
|
||||
(const GLubyte * )lpBits);
|
||||
@@ -326,7 +324,7 @@ GLAPI BOOL GLWINAPI wglUseFontBitmapsA(HDC hdc, DWORD first,
|
||||
glEndList( );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GLAPI BOOL GLWINAPI wglUseFontBitmapsW(HDC hdc,DWORD first,DWORD count,DWORD listBase)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: wmesa.c,v 1.3.4.3 2000/09/28 22:39:43 brianp Exp $ */
|
||||
/* $Id: wmesa.c,v 1.3.4.5 2001/05/09 20:42:45 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Windows (Win32) device driver for Mesa 3.4
|
||||
@@ -1085,7 +1085,8 @@ static void read_rgba_pixels( const GLcontext* ctx,
|
||||
assert(Current->rgb_flag==GL_TRUE);
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
Color=GetPixel(DC,x[i],FLIP(y[i]));
|
||||
GLint y2 = Current->Height - y[i] - 1;
|
||||
Color=GetPixel(DC,x[i],y2);
|
||||
rgba[i][RCOMP] = GetRValue(Color);
|
||||
rgba[i][GCOMP] = GetGValue(Color);
|
||||
rgba[i][BCOMP] = GetBValue(Color);
|
||||
@@ -1406,6 +1407,14 @@ void /*APIENTRY*/ WMesaMakeCurrent( WMesaContext c )
|
||||
void /*APIENTRY*/ WMesaSwapBuffers( void )
|
||||
{
|
||||
HDC DC = Current->hDC;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
/* If we're swapping the buffer associated with the current context
|
||||
* we have to flush any pending rendering commands first.
|
||||
*/
|
||||
if (Current && Current->gl_ctx == ctx)
|
||||
_mesa_swapbuffers(ctx);
|
||||
|
||||
if (Current->db_flag)
|
||||
wmFlush(Current);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* $Id: fakeglx.c,v 1.34.4.7 2001/01/24 04:49:27 brianp Exp $ */
|
||||
/* $Id: fakeglx.c,v 1.34.4.9 2001/05/15 20:22:19 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.4
|
||||
* Version: 3.4.2
|
||||
*
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2001 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"),
|
||||
@@ -65,7 +65,7 @@
|
||||
#define SERVER_MINOR_VERSION 3
|
||||
|
||||
/* This is appended onto the glXGetClient/ServerString version strings. */
|
||||
#define MESA_GLX_VERSION "Mesa 3.4.1"
|
||||
#define MESA_GLX_VERSION "Mesa 3.4.2"
|
||||
|
||||
/* Who implemented this GLX? */
|
||||
#define VENDOR "Brian Paul"
|
||||
@@ -337,22 +337,40 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo )
|
||||
);
|
||||
}
|
||||
else if (is_usable_visual( visinfo )) {
|
||||
/* Configure this visual as RGB, double-buffered, depth-buffered. */
|
||||
/* This is surely wrong for some people's needs but what else */
|
||||
/* can be done? They should use glXChooseVisual(). */
|
||||
return save_glx_visual( dpy, visinfo,
|
||||
GL_TRUE, /* rgb */
|
||||
GL_FALSE, /* alpha */
|
||||
GL_TRUE, /* double */
|
||||
GL_FALSE, /* stereo */
|
||||
DEFAULT_SOFTWARE_DEPTH_BITS,
|
||||
8 * sizeof(GLstencil),
|
||||
8 * sizeof(GLaccum), /* r */
|
||||
8 * sizeof(GLaccum), /* g */
|
||||
8 * sizeof(GLaccum), /* b */
|
||||
8 * sizeof(GLaccum), /* a */
|
||||
0 /* level */
|
||||
);
|
||||
if (getenv("MESA_GLX_FORCE_CI")) {
|
||||
/* Configure this visual as a COLOR INDEX visual. */
|
||||
return save_glx_visual( dpy, visinfo,
|
||||
GL_FALSE, /* rgb */
|
||||
GL_FALSE, /* alpha */
|
||||
GL_TRUE, /* double */
|
||||
GL_FALSE, /* stereo */
|
||||
DEFAULT_SOFTWARE_DEPTH_BITS,
|
||||
8 * sizeof(GLstencil),
|
||||
0 * sizeof(GLaccum), /* r */
|
||||
0 * sizeof(GLaccum), /* g */
|
||||
0 * sizeof(GLaccum), /* b */
|
||||
0 * sizeof(GLaccum), /* a */
|
||||
0 /* level */
|
||||
);
|
||||
}
|
||||
else {
|
||||
/* Configure this visual as RGB, double-buffered, depth-buffered. */
|
||||
/* This is surely wrong for some people's needs but what else */
|
||||
/* can be done? They should use glXChooseVisual(). */
|
||||
return save_glx_visual( dpy, visinfo,
|
||||
GL_TRUE, /* rgb */
|
||||
GL_FALSE, /* alpha */
|
||||
GL_TRUE, /* double */
|
||||
GL_FALSE, /* stereo */
|
||||
DEFAULT_SOFTWARE_DEPTH_BITS,
|
||||
8 * sizeof(GLstencil),
|
||||
8 * sizeof(GLaccum), /* r */
|
||||
8 * sizeof(GLaccum), /* g */
|
||||
8 * sizeof(GLaccum), /* b */
|
||||
8 * sizeof(GLaccum), /* a */
|
||||
0 /* level */
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"Mesa: error in glXCreateContext: bad visual\n");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: xfonts.c,v 1.6.4.4 2001/02/09 08:25:18 joukj Exp $ */
|
||||
/* $Id: xfonts.c,v 1.6.4.5 2001/04/26 19:28:29 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -260,7 +260,7 @@ void Fake_glXUseXFont( Font font, int first, int count, int listbase )
|
||||
bm = (GLubyte *) MALLOC((max_bm_width * max_bm_height) * sizeof
|
||||
(GLubyte));
|
||||
if (!bm) {
|
||||
XFreeFontInfo( NULL, fs, 0 );
|
||||
XFreeFontInfo( NULL, fs, 1 );
|
||||
gl_error(NULL, GL_OUT_OF_MEMORY,
|
||||
"Couldn't allocate bitmap in glXUseXFont()");
|
||||
return;
|
||||
@@ -375,7 +375,7 @@ bm_height);
|
||||
}
|
||||
|
||||
FREE(bm);
|
||||
XFreeFontInfo( NULL, fs, 0 );
|
||||
XFreeFontInfo( NULL, fs, 1 );
|
||||
XFreeGC (dpy, gc);
|
||||
|
||||
/* Restore saved packing modes. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: xmesaP.h,v 1.11 2000/07/19 23:26:35 brianp Exp $ */
|
||||
/* $Id: xmesaP.h,v 1.11.2.1 2001/05/01 22:00:47 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -227,7 +227,11 @@ struct xmesa_buffer {
|
||||
|
||||
/* Used to do XAllocColor/XFreeColors accounting: */
|
||||
int num_alloced;
|
||||
#if defined(XFree86Server)
|
||||
Pixel alloced_colors[256];
|
||||
#else
|
||||
unsigned long alloced_colors[256];
|
||||
#endif
|
||||
|
||||
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
|
||||
__DRIdrawablePrivate *driDrawPriv; /* back pointer to DRI drawable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.X11,v 1.20 2000/07/14 14:55:04 brianp Exp $
|
||||
# $Id: Makefile.X11,v 1.20.2.2 2001/03/23 17:08:08 brianp Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.3
|
||||
@@ -77,6 +77,7 @@ CORE_SOURCES = \
|
||||
stages.c \
|
||||
state.c \
|
||||
stencil.c \
|
||||
texformat.c \
|
||||
teximage.c \
|
||||
texobj.c \
|
||||
texstate.c \
|
||||
@@ -132,9 +133,9 @@ DRIVER_SOURCES = \
|
||||
FX/fxvsetup.c \
|
||||
FX/fxglidew.c
|
||||
|
||||
ASM_SOURCES =
|
||||
ASM_SOURCES =
|
||||
|
||||
ADDITIONAL_OBJ =
|
||||
ADDITIONAL_OBJ =
|
||||
|
||||
OBJECTS = $(ASM_SOURCES:.S=.o) \
|
||||
$(CORE_SOURCES:.c=.o) \
|
||||
@@ -222,6 +223,7 @@ X86/3dnow.o: X86/3dnow.c
|
||||
X86/katmai.o: X86/katmai.c
|
||||
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
#default:
|
||||
@@ -234,7 +236,7 @@ clean:
|
||||
targets: $(LIBDIR)/$(GL_LIB)
|
||||
|
||||
# Make the library
|
||||
$(LIBDIR)/$(GL_LIB): $(OBJECTS)
|
||||
$(LIBDIR)/$(GL_LIB): $(GENERATED_SOURCES) $(OBJECTS)
|
||||
$(MAKELIB) $(GL_LIB) $(GL_MAJOR) $(GL_MINOR) $(GL_TINY) $(OBJECTS)
|
||||
rm -f $(LIBDIR)/$(GL_LIB)*
|
||||
mv $(GL_LIB)* $(LIBDIR)
|
||||
@@ -249,9 +251,9 @@ include depend
|
||||
#
|
||||
# Run 'make dep' to update the dependencies if you change what's included
|
||||
# by any source file.
|
||||
#
|
||||
dep: $(CORE_SOURCES) $(DRIVER_SOURCES)
|
||||
makedepend -fdepend -Y -I../include -DGGI -DSVGA -DFX $(CORE_SOURCES) $(DRIVER_SOURCES)
|
||||
#
|
||||
dep: $(CORE_SOURCES) $(DRIVER_SOURCES) $(ASM_SOURCES)
|
||||
makedepend -fdepend -Y -I../include $(CFLAGS) -DGGI -DSVGA -DFX $(CORE_SOURCES) $(DRIVER_SOURCES) $(ASM_SOURCES)
|
||||
|
||||
tags:
|
||||
etags `find . -name \*.[ch]` `find ../include`
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: buffers.c,v 1.9.4.3 2000/11/05 21:24:00 brianp Exp $ */
|
||||
/* $Id: buffers.c,v 1.9.4.4 2001/05/15 20:13:22 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -168,7 +168,7 @@ clear_color_buffer(GLcontext *ctx)
|
||||
}
|
||||
else {
|
||||
/* Color index mode */
|
||||
ASSERT(ctx->Color.IndexMask == (GLuint) ~0);
|
||||
ASSERT(ctx->Color.IndexMask == ((1 << ctx->Visual->IndexBits) - 1));
|
||||
if (ctx->Visual->IndexBits == 8) {
|
||||
/* 8-bit clear */
|
||||
GLubyte span[MAX_WIDTH];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: config.h,v 1.15 2000/07/05 22:40:30 brianp Exp $ */
|
||||
/* $Id: config.h,v 1.15.4.1 2001/05/14 19:17:07 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
/* Maximum viewport/image size: */
|
||||
#define MAX_WIDTH 2048
|
||||
#define MAX_HEIGHT 1200
|
||||
#define MAX_HEIGHT 2048
|
||||
|
||||
/* Maxmimum size for CVA. May be overridden by the drivers. */
|
||||
#define MAX_ARRAY_LOCK_SIZE 3000
|
||||
|
||||
@@ -1890,7 +1890,11 @@ _mesa_get_dispatch(GLcontext *ctx)
|
||||
void gl_problem( const GLcontext *ctx, const char *s )
|
||||
{
|
||||
fprintf( stderr, "Mesa implementation error: %s\n", s );
|
||||
fprintf( stderr, "Report to Mesa bug database at www.mesa3d.org\n" );
|
||||
#ifdef XF86DRI
|
||||
fprintf( stderr, "Please report to the DRI bug database at dri.sourceforge.net\n");
|
||||
#else
|
||||
fprintf( stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" );
|
||||
#endif
|
||||
(void) ctx;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: extensions.c,v 1.32.4.2 2001/01/06 22:43:00 gareth Exp $ */
|
||||
/* $Id: extensions.c,v 1.32.4.3 2001/04/24 21:52:50 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -53,7 +53,7 @@ static struct { int enabled; const char *name; } default_extensions[] = {
|
||||
{ DEFAULT_ON, "GL_ARB_multitexture" },
|
||||
{ DEFAULT_OFF, "GL_ARB_texture_compression" },
|
||||
{ DEFAULT_OFF, "GL_ARB_texture_cube_map" }, /* in progress */
|
||||
{ ALWAYS_ENABLED, "GL_ARB_tranpose_matrix" },
|
||||
{ ALWAYS_ENABLED, "GL_ARB_transpose_matrix" },
|
||||
{ ALWAYS_ENABLED, "GL_EXT_abgr" },
|
||||
{ DEFAULT_ON, "GL_EXT_blend_color" },
|
||||
{ DEFAULT_ON, "GL_EXT_blend_func_separate" },
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* $Id: get.c,v 1.30.2.4 2001/01/24 04:49:27 brianp Exp $*/
|
||||
/* $Id: get.c,v 1.30.2.5 2001/05/14 19:11:32 brianp Exp $*/
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.4
|
||||
* Version: 3.4.2
|
||||
*
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2001 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"),
|
||||
@@ -5095,7 +5095,7 @@ _mesa_GetString( GLenum name )
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
static const char *vendor = "Brian Paul";
|
||||
static const char *renderer = "Mesa";
|
||||
static const char *version = "1.2 Mesa 3.4.1";
|
||||
static const char *version = "1.2 Mesa 3.4.2";
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0);
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/* $Id: image.c,v 1.35.4.5 2001/01/25 17:34:21 brianp Exp $ */
|
||||
/* $Id: image.c,v 1.35.4.8 2001/05/15 20:17:20 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.4.1
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999-2000 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"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
@@ -1546,7 +1546,6 @@ _mesa_pack_rgba_span( GLcontext *ctx,
|
||||
_mesa_pack_float_rgba_span(ctx, n, (const GLfloat (*)[4]) rgba,
|
||||
format, type, destination,
|
||||
packing, applyTransferOps);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1812,7 +1811,7 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
|
||||
alphaIndex = 0;
|
||||
stride = 1;
|
||||
break;
|
||||
case GL_LUMINANCE:
|
||||
case GL_LUMINANCE:
|
||||
redIndex = greenIndex = blueIndex = 0;
|
||||
alphaIndex = -1;
|
||||
stride = 1;
|
||||
@@ -1823,8 +1822,7 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
|
||||
stride = 2;
|
||||
break;
|
||||
case GL_INTENSITY:
|
||||
redIndex = 0;
|
||||
greenIndex = blueIndex = alphaIndex = -1;
|
||||
redIndex = greenIndex = blueIndex = alphaIndex = 0;
|
||||
stride = 1;
|
||||
break;
|
||||
case GL_RGB:
|
||||
@@ -2160,7 +2158,7 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
|
||||
GLuint i;
|
||||
for (i = 0; i < n; i ++) {
|
||||
GLuint p = uisrc[i];
|
||||
rgba[i][rComp] = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 24) );
|
||||
rgba[i][rComp] = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 24) );
|
||||
rgba[i][gComp] = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 16) & 0xff);
|
||||
rgba[i][bComp] = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 8) & 0xff);
|
||||
rgba[i][aComp] = UBYTE_COLOR_TO_FLOAT_COLOR((p ) & 0xff);
|
||||
@@ -2174,7 +2172,7 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
|
||||
rgba[i][rComp] = UBYTE_COLOR_TO_FLOAT_COLOR((p ) & 0xff);
|
||||
rgba[i][gComp] = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 8) & 0xff);
|
||||
rgba[i][bComp] = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 16) & 0xff);
|
||||
rgba[i][aComp] = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 24) );
|
||||
rgba[i][aComp] = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 24) );
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2263,7 +2261,7 @@ _mesa_unpack_ubyte_color_span( GLcontext *ctx,
|
||||
GLboolean applyTransferOps )
|
||||
{
|
||||
ASSERT(dstFormat == GL_ALPHA ||
|
||||
dstFormat == GL_LUMINANCE ||
|
||||
dstFormat == GL_LUMINANCE ||
|
||||
dstFormat == GL_LUMINANCE_ALPHA ||
|
||||
dstFormat == GL_INTENSITY ||
|
||||
dstFormat == GL_RGB ||
|
||||
@@ -2305,9 +2303,6 @@ _mesa_unpack_ubyte_color_span( GLcontext *ctx,
|
||||
srcType == GL_UNSIGNED_INT_10_10_10_2 ||
|
||||
srcType == GL_UNSIGNED_INT_2_10_10_10_REV);
|
||||
|
||||
/* this is intended for RGBA mode only */
|
||||
assert(ctx->Visual->RGBAflag);
|
||||
|
||||
applyTransferOps &= (ctx->Pixel.ScaleOrBiasRGBA ||
|
||||
ctx->Pixel.MapColorFlag ||
|
||||
ctx->ColorMatrix.type != MATRIX_IDENTITY ||
|
||||
@@ -2475,7 +2470,7 @@ _mesa_unpack_ubyte_color_span( GLcontext *ctx,
|
||||
dstRedIndex = dstGreenIndex = dstBlueIndex = -1;
|
||||
dstLuminanceIndex = dstIntensityIndex = -1;
|
||||
break;
|
||||
case GL_LUMINANCE:
|
||||
case GL_LUMINANCE:
|
||||
dstLuminanceIndex = 0;
|
||||
dstRedIndex = dstGreenIndex = dstBlueIndex = dstAlphaIndex = -1;
|
||||
dstIntensityIndex = -1;
|
||||
@@ -2582,7 +2577,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx,
|
||||
GLboolean applyTransferOps, GLboolean clamp )
|
||||
{
|
||||
ASSERT(dstFormat == GL_ALPHA ||
|
||||
dstFormat == GL_LUMINANCE ||
|
||||
dstFormat == GL_LUMINANCE ||
|
||||
dstFormat == GL_LUMINANCE_ALPHA ||
|
||||
dstFormat == GL_INTENSITY ||
|
||||
dstFormat == GL_RGB ||
|
||||
@@ -2744,7 +2739,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx,
|
||||
dstRedIndex = dstGreenIndex = dstBlueIndex = -1;
|
||||
dstLuminanceIndex = dstIntensityIndex = -1;
|
||||
break;
|
||||
case GL_LUMINANCE:
|
||||
case GL_LUMINANCE:
|
||||
dstLuminanceIndex = 0;
|
||||
dstRedIndex = dstGreenIndex = dstBlueIndex = dstAlphaIndex = -1;
|
||||
dstIntensityIndex = -1;
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/* $Id: macros.h,v 1.8 1999/11/22 18:57:56 brianp Exp $ */
|
||||
/* $Id: macros.h,v 1.8.4.1 2001/03/02 16:40:47 gareth Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
*
|
||||
* Version: 3.4
|
||||
*
|
||||
* Copyright (C) 1999 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"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
@@ -90,7 +90,7 @@
|
||||
#define TEST_BITS(WORD, BITS) ((WORD) & (BITS))
|
||||
|
||||
|
||||
/* Stepping a GLfloat pointer by a byte stride
|
||||
/* Stepping a GLfloat pointer by a byte stride
|
||||
*/
|
||||
#define STRIDE_F(p, i) (p = (GLfloat *)((GLubyte *)p + i))
|
||||
#define STRIDE_UI(p, i) (p = (GLuint *)((GLubyte *)p + i))
|
||||
@@ -161,7 +161,7 @@ do { \
|
||||
case 2: (DST)[1] = (SRC)[1]; \
|
||||
case 1: (DST)[0] = (SRC)[0]; \
|
||||
} \
|
||||
} while(0)
|
||||
} while(0)
|
||||
|
||||
#define SUB_4V( DST, SRCA, SRCB ) \
|
||||
do { \
|
||||
@@ -497,4 +497,31 @@ do { \
|
||||
#define FLOAT_TO_INT(X) ( (GLint) (2147483647.0 * (X)) )
|
||||
|
||||
|
||||
|
||||
/* Generic color packing macros
|
||||
*/
|
||||
|
||||
#define PACK_COLOR_8888( a, b, c, d ) \
|
||||
(((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
|
||||
|
||||
#define PACK_COLOR_888( a, b, c ) \
|
||||
(((a) << 16) | ((b) << 8) | (c))
|
||||
|
||||
#define PACK_COLOR_565( a, b, c ) \
|
||||
((((a) & 0xf8) << 8) | (((b) & 0xfc) << 3) | (((c) & 0xf8) >> 3))
|
||||
|
||||
#define PACK_COLOR_1555( a, b, c, d ) \
|
||||
((((b) & 0xf8) << 7) | (((c) & 0xf8) << 2) | (((d) & 0xf8) >> 3) | \
|
||||
((a) ? 0x8000 : 0))
|
||||
|
||||
#define PACK_COLOR_4444( a, b, c, d ) \
|
||||
((((a) & 0xf0) << 8) | (((b) & 0xf0) << 4) | ((c) & 0xf0) | ((d) >> 4))
|
||||
|
||||
#define PACK_COLOR_88( a, b ) \
|
||||
(((a) << 8) | (b))
|
||||
|
||||
#define PACK_COLOR_332( a, b, c ) \
|
||||
(((a) & 0xe0) | (((b) & 0xe0) >> 3) | (((c) & 0xc0) >> 6))
|
||||
|
||||
|
||||
#endif /*MACROS_H*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: matrix.c,v 1.18.4.2 2000/11/05 21:24:01 brianp Exp $ */
|
||||
/* $Id: matrix.c,v 1.18.4.3 2001/03/19 22:45:31 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -1452,6 +1452,9 @@ _mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
void
|
||||
gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
{
|
||||
const GLfloat n = ctx->Viewport.Near;
|
||||
const GLfloat f = ctx->Viewport.Far;
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glViewport");
|
||||
|
||||
if (width<0 || height<0) {
|
||||
@@ -1477,8 +1480,8 @@ gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
ctx->Viewport.WindowMap.m[MAT_TX] = ctx->Viewport.WindowMap.m[MAT_SX] + x;
|
||||
ctx->Viewport.WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F;
|
||||
ctx->Viewport.WindowMap.m[MAT_TY] = ctx->Viewport.WindowMap.m[MAT_SY] + y;
|
||||
ctx->Viewport.WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual->DepthMaxF;
|
||||
ctx->Viewport.WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual->DepthMaxF;
|
||||
ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0);
|
||||
ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual->DepthMaxF * ((f - n) / 2.0 + n);
|
||||
|
||||
ctx->Viewport.WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
|
||||
ctx->Viewport.WindowMap.type = MATRIX_3D_NO_ROT;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* $Id: stencil.c,v 1.16.4.1 2000/11/28 21:30:44 brianp Exp $ */
|
||||
/* $Id: stencil.c,v 1.16.4.3 2001/02/23 23:13:58 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.4
|
||||
* Version: 3.4.2
|
||||
*
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2001 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"),
|
||||
@@ -1039,47 +1039,45 @@ _mesa_stencil_and_ztest_pixels( GLcontext *ctx,
|
||||
if (ctx->Driver.WriteStencilPixels) {
|
||||
/*** Hardware stencil buffer ***/
|
||||
GLstencil stencil[PB_SIZE];
|
||||
GLubyte mask[PB_SIZE];
|
||||
GLubyte origMask[PB_SIZE];
|
||||
|
||||
ASSERT(ctx->Driver.ReadStencilPixels);
|
||||
(*ctx->Driver.ReadStencilPixels)(ctx, n, x, y, stencil);
|
||||
|
||||
MEMCPY(origMask, mask, n * sizeof(GLubyte));
|
||||
|
||||
if (do_stencil_test( ctx, n, stencil, mask ) == GL_FALSE) {
|
||||
/* all fragments failed the stencil test, we're done. */
|
||||
return GL_FALSE;
|
||||
}
|
||||
(void) do_stencil_test( ctx, n, stencil, mask );
|
||||
|
||||
if (ctx->Depth.Test == GL_FALSE) {
|
||||
apply_stencil_op( ctx, ctx->Stencil.ZPassFunc, n, stencil, mask );
|
||||
}
|
||||
else {
|
||||
GLubyte passmask[PB_SIZE], failmask[PB_SIZE], oldmask[PB_SIZE];
|
||||
GLuint i;
|
||||
|
||||
MEMCPY(oldmask, mask, n * sizeof(GLubyte));
|
||||
|
||||
_mesa_depth_test_pixels(ctx, n, x, y, z, mask);
|
||||
|
||||
for (i=0;i<n;i++) {
|
||||
ASSERT(mask[i] == 0 || mask[i] == 1);
|
||||
passmask[i] = oldmask[i] & mask[i];
|
||||
failmask[i] = oldmask[i] & (mask[i] ^ 1);
|
||||
}
|
||||
|
||||
if (ctx->Stencil.ZFailFunc != GL_KEEP) {
|
||||
apply_stencil_op( ctx, ctx->Stencil.ZFailFunc, n, stencil, failmask );
|
||||
GLubyte failmask[PB_SIZE];
|
||||
GLuint i;
|
||||
for (i = 0; i < n; i++) {
|
||||
ASSERT(mask[i] == 0 || mask[i] == 1);
|
||||
failmask[i] = origMask[i] & (mask[i] ^ 1);
|
||||
}
|
||||
apply_stencil_op(ctx, ctx->Stencil.ZFailFunc, n, stencil, failmask);
|
||||
}
|
||||
if (ctx->Stencil.ZPassFunc != GL_KEEP) {
|
||||
apply_stencil_op( ctx, ctx->Stencil.ZPassFunc, n, stencil, passmask );
|
||||
GLubyte passmask[PB_SIZE];
|
||||
GLuint i;
|
||||
for (i = 0; i < n; i++) {
|
||||
ASSERT(mask[i] == 0 || mask[i] == 1);
|
||||
passmask[i] = origMask[i] & mask[i];
|
||||
}
|
||||
apply_stencil_op(ctx, ctx->Stencil.ZPassFunc, n, stencil, passmask);
|
||||
}
|
||||
}
|
||||
|
||||
/* Write updated stencil values into hardware stencil buffer */
|
||||
(ctx->Driver.WriteStencilPixels)(ctx, n, x, y, stencil, mask );
|
||||
(ctx->Driver.WriteStencilPixels)(ctx, n, x, y, stencil, origMask );
|
||||
|
||||
return GL_TRUE;
|
||||
|
||||
}
|
||||
else {
|
||||
/*** Software stencil buffer ***/
|
||||
@@ -1089,7 +1087,6 @@ _mesa_stencil_and_ztest_pixels( GLcontext *ctx,
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (ctx->Depth.Test==GL_FALSE) {
|
||||
apply_stencil_op_to_pixels( ctx, n, x, y, ctx->Stencil.ZPassFunc, mask );
|
||||
}
|
||||
|
||||
352
src/mesa/main/texformat.c
Normal file
352
src/mesa/main/texformat.c
Normal file
@@ -0,0 +1,352 @@
|
||||
/* $Id: texformat.c,v 1.1.2.1 2001/03/02 16:40:47 gareth Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.4
|
||||
*
|
||||
* Copyright (C) 1999-2000 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"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author:
|
||||
* Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
#include "glheader.h"
|
||||
#include "context.h"
|
||||
#include "image.h"
|
||||
#include "mem.h"
|
||||
#include "mmath.h"
|
||||
#include "span.h"
|
||||
#include "texformat.h"
|
||||
#include "teximage.h"
|
||||
#include "texstate.h"
|
||||
#include "types.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* ================================================================
|
||||
* Texture internal formats:
|
||||
*/
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_rgba8888 = {
|
||||
MESA_FORMAT_RGBA8888, /* IntFormat */
|
||||
8, /* RedBits */
|
||||
8, /* GreenBits */
|
||||
8, /* BlueBits */
|
||||
8, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
4, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_abgr8888 = {
|
||||
MESA_FORMAT_ABGR8888, /* IntFormat */
|
||||
8, /* RedBits */
|
||||
8, /* GreenBits */
|
||||
8, /* BlueBits */
|
||||
8, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
4, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_argb8888 = {
|
||||
MESA_FORMAT_ARGB8888, /* IntFormat */
|
||||
8, /* RedBits */
|
||||
8, /* GreenBits */
|
||||
8, /* BlueBits */
|
||||
8, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
4, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_rgb888 = {
|
||||
MESA_FORMAT_RGB888, /* IntFormat */
|
||||
8, /* RedBits */
|
||||
8, /* GreenBits */
|
||||
8, /* BlueBits */
|
||||
0, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
3, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_bgr888 = {
|
||||
MESA_FORMAT_BGR888, /* IntFormat */
|
||||
8, /* RedBits */
|
||||
8, /* GreenBits */
|
||||
8, /* BlueBits */
|
||||
0, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
3, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_rgb565 = {
|
||||
MESA_FORMAT_RGB565, /* IntFormat */
|
||||
5, /* RedBits */
|
||||
6, /* GreenBits */
|
||||
5, /* BlueBits */
|
||||
0, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
2, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_argb4444 = {
|
||||
MESA_FORMAT_ARGB4444, /* IntFormat */
|
||||
4, /* RedBits */
|
||||
4, /* GreenBits */
|
||||
4, /* BlueBits */
|
||||
4, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
2, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_argb1555 = {
|
||||
MESA_FORMAT_ARGB1555, /* IntFormat */
|
||||
5, /* RedBits */
|
||||
5, /* GreenBits */
|
||||
5, /* BlueBits */
|
||||
1, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
2, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_al88 = {
|
||||
MESA_FORMAT_AL88, /* IntFormat */
|
||||
0, /* RedBits */
|
||||
0, /* GreenBits */
|
||||
0, /* BlueBits */
|
||||
8, /* AlphaBits */
|
||||
8, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
2, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_rgb332 = {
|
||||
MESA_FORMAT_RGB332, /* IntFormat */
|
||||
3, /* RedBits */
|
||||
3, /* GreenBits */
|
||||
2, /* BlueBits */
|
||||
0, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
1, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_a8 = {
|
||||
MESA_FORMAT_A8, /* IntFormat */
|
||||
0, /* RedBits */
|
||||
0, /* GreenBits */
|
||||
0, /* BlueBits */
|
||||
8, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
1, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_l8 = {
|
||||
MESA_FORMAT_L8, /* IntFormat */
|
||||
0, /* RedBits */
|
||||
0, /* GreenBits */
|
||||
0, /* BlueBits */
|
||||
0, /* AlphaBits */
|
||||
8, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
1, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_i8 = {
|
||||
MESA_FORMAT_I8, /* IntFormat */
|
||||
0, /* RedBits */
|
||||
0, /* GreenBits */
|
||||
0, /* BlueBits */
|
||||
0, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
8, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
1, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_texformat_ci8 = {
|
||||
MESA_FORMAT_CI8, /* IntFormat */
|
||||
0, /* RedBits */
|
||||
0, /* GreenBits */
|
||||
0, /* BlueBits */
|
||||
0, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
8, /* IndexBits */
|
||||
1, /* TexelBytes */
|
||||
};
|
||||
|
||||
const struct gl_texture_format _mesa_null_texformat = {
|
||||
-1, /* IntFormat */
|
||||
0, /* RedBits */
|
||||
0, /* GreenBits */
|
||||
0, /* BlueBits */
|
||||
0, /* AlphaBits */
|
||||
0, /* LuminanceBits */
|
||||
0, /* IntensityBits */
|
||||
0, /* IndexBits */
|
||||
0, /* TexelBytes */
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Given an internal texture format enum or 1, 2, 3, 4 return the
|
||||
* corresponding _base_ internal format: GL_ALPHA, GL_LUMINANCE,
|
||||
* GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA.
|
||||
* Return -1 if invalid enum.
|
||||
*/
|
||||
void _mesa_init_texture_format( GLcontext *ctx,
|
||||
struct gl_texture_image *texImage,
|
||||
GLenum internalFormat )
|
||||
{
|
||||
texImage->IntFormat = internalFormat;
|
||||
|
||||
/* Ask the driver for the base format, if it doesn't know, it will
|
||||
* return -1;
|
||||
*/
|
||||
if ( ctx->Driver.BaseCompressedTexFormat ) {
|
||||
GLint format = 0; /* Silence compiler warning */
|
||||
format = (*ctx->Driver.BaseCompressedTexFormat)( ctx, format );
|
||||
if ( format >= 0 ) {
|
||||
internalFormat = format;
|
||||
}
|
||||
}
|
||||
|
||||
switch ( internalFormat ) {
|
||||
/* GH: Bias towards GL_RGB, GL_RGBA texture formats. This has
|
||||
* got to be better than sticking them way down the end of this
|
||||
* huge list.
|
||||
*/
|
||||
case 4: /* Quake3 uses this... */
|
||||
case GL_RGBA:
|
||||
texImage->Format = GL_RGBA;
|
||||
texImage->TexFormat = &_mesa_texformat_abgr8888;
|
||||
break;
|
||||
|
||||
case 3: /* ... and this. */
|
||||
case GL_RGB:
|
||||
texImage->Format = GL_RGB;
|
||||
texImage->TexFormat = &_mesa_texformat_bgr888;
|
||||
break;
|
||||
|
||||
/* GH: Okay, keep checking as normal. Still test for GL_RGB,
|
||||
* GL_RGBA formats first.
|
||||
*/
|
||||
case GL_RGBA2:
|
||||
case GL_RGBA4:
|
||||
case GL_RGB5_A1:
|
||||
case GL_RGBA8:
|
||||
case GL_RGB10_A2:
|
||||
case GL_RGBA12:
|
||||
case GL_RGBA16:
|
||||
texImage->Format = GL_RGBA;
|
||||
texImage->TexFormat = &_mesa_texformat_abgr8888;
|
||||
break;
|
||||
|
||||
case GL_R3_G3_B2:
|
||||
case GL_RGB4:
|
||||
case GL_RGB5:
|
||||
case GL_RGB8:
|
||||
case GL_RGB10:
|
||||
case GL_RGB12:
|
||||
case GL_RGB16:
|
||||
texImage->Format = GL_RGB;
|
||||
texImage->TexFormat = &_mesa_texformat_bgr888;
|
||||
break;
|
||||
|
||||
case GL_ALPHA:
|
||||
case GL_ALPHA4:
|
||||
case GL_ALPHA8:
|
||||
case GL_ALPHA12:
|
||||
case GL_ALPHA16:
|
||||
texImage->Format = GL_ALPHA;
|
||||
texImage->TexFormat = &_mesa_texformat_a8;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case GL_LUMINANCE:
|
||||
case GL_LUMINANCE4:
|
||||
case GL_LUMINANCE8:
|
||||
case GL_LUMINANCE12:
|
||||
case GL_LUMINANCE16:
|
||||
texImage->Format = GL_LUMINANCE;
|
||||
texImage->TexFormat = &_mesa_texformat_l8;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
case GL_LUMINANCE4_ALPHA4:
|
||||
case GL_LUMINANCE6_ALPHA2:
|
||||
case GL_LUMINANCE8_ALPHA8:
|
||||
case GL_LUMINANCE12_ALPHA4:
|
||||
case GL_LUMINANCE12_ALPHA12:
|
||||
case GL_LUMINANCE16_ALPHA16:
|
||||
texImage->Format = GL_LUMINANCE_ALPHA;
|
||||
texImage->TexFormat = &_mesa_texformat_al88;
|
||||
break;
|
||||
|
||||
case GL_INTENSITY:
|
||||
case GL_INTENSITY4:
|
||||
case GL_INTENSITY8:
|
||||
case GL_INTENSITY12:
|
||||
case GL_INTENSITY16:
|
||||
texImage->Format = GL_INTENSITY;
|
||||
texImage->TexFormat = &_mesa_texformat_i8;
|
||||
break;
|
||||
|
||||
case GL_COLOR_INDEX:
|
||||
case GL_COLOR_INDEX1_EXT:
|
||||
case GL_COLOR_INDEX2_EXT:
|
||||
case GL_COLOR_INDEX4_EXT:
|
||||
case GL_COLOR_INDEX8_EXT:
|
||||
case GL_COLOR_INDEX12_EXT:
|
||||
case GL_COLOR_INDEX16_EXT:
|
||||
texImage->Format = GL_COLOR_INDEX;
|
||||
texImage->TexFormat = &_mesa_texformat_ci8;
|
||||
break;
|
||||
|
||||
default:
|
||||
gl_problem( ctx, "unexpected format in _mesa_init_texture_format" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
81
src/mesa/main/texformat.h
Normal file
81
src/mesa/main/texformat.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/* $Id: texformat.h,v 1.1.2.1 2001/03/02 16:40:47 gareth Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.4
|
||||
*
|
||||
* Copyright (C) 1999-2000 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"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author:
|
||||
* Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
#ifndef TEXFORMAT_H
|
||||
#define TEXFORMAT_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
/* The Mesa internal texture image types. These will be set to their
|
||||
* default value, but may be changed by drivers as required.
|
||||
*/
|
||||
/* msb <------ TEXEL BITS -----------> lsb */
|
||||
enum _format { /* ---- ---- ---- ---- ---- ---- ---- ---- */
|
||||
MESA_FORMAT_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
|
||||
MESA_FORMAT_ABGR8888, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
|
||||
MESA_FORMAT_ARGB8888, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */
|
||||
MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */
|
||||
MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */
|
||||
MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */
|
||||
MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */
|
||||
MESA_FORMAT_ARGB1555, /* ARRR RRGG GGGB BBBB */
|
||||
MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */
|
||||
MESA_FORMAT_RGB332, /* RRRG GGBB */
|
||||
MESA_FORMAT_A8, /* AAAA AAAA */
|
||||
MESA_FORMAT_L8, /* LLLL LLLL */
|
||||
MESA_FORMAT_I8, /* IIII IIII */
|
||||
MESA_FORMAT_CI8 /* CCCC CCCC */
|
||||
};
|
||||
|
||||
|
||||
extern void
|
||||
_mesa_init_texture_format( GLcontext *ctx,
|
||||
struct gl_texture_image *texImage,
|
||||
GLenum internalFormat );
|
||||
|
||||
|
||||
extern const struct gl_texture_format _mesa_texformat_rgba8888;
|
||||
extern const struct gl_texture_format _mesa_texformat_abgr8888;
|
||||
extern const struct gl_texture_format _mesa_texformat_argb8888;
|
||||
extern const struct gl_texture_format _mesa_texformat_rgb888;
|
||||
extern const struct gl_texture_format _mesa_texformat_bgr888;
|
||||
extern const struct gl_texture_format _mesa_texformat_rgb565;
|
||||
extern const struct gl_texture_format _mesa_texformat_argb4444;
|
||||
extern const struct gl_texture_format _mesa_texformat_argb1555;
|
||||
extern const struct gl_texture_format _mesa_texformat_al88;
|
||||
extern const struct gl_texture_format _mesa_texformat_rgb332;
|
||||
extern const struct gl_texture_format _mesa_texformat_a8;
|
||||
extern const struct gl_texture_format _mesa_texformat_l8;
|
||||
extern const struct gl_texture_format _mesa_texformat_i8;
|
||||
extern const struct gl_texture_format _mesa_texformat_ci8;
|
||||
|
||||
extern const struct gl_texture_format _mesa_null_texformat;
|
||||
|
||||
#endif
|
||||
@@ -1,21 +1,21 @@
|
||||
/* $Id: teximage.c,v 1.39.4.10 2001/01/23 23:32:44 brianp Exp $ */
|
||||
/* $Id: teximage.c,v 1.39.4.13 2001/05/15 20:12:15 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.4
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999-2000 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"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "mem.h"
|
||||
#include "mmath.h"
|
||||
#include "span.h"
|
||||
#include "texformat.h"
|
||||
#include "teximage.h"
|
||||
#include "texstate.h"
|
||||
#include "types.h"
|
||||
@@ -301,115 +302,6 @@ is_compressed_format(GLcontext *ctx, GLenum internalFormat)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Examine the texImage->Format field and set the Red, Green, Blue, etc
|
||||
* texel component sizes to default values.
|
||||
* These fields are set only here by core Mesa but device drivers may
|
||||
* overwritting these fields to indicate true texel resolution.
|
||||
*/
|
||||
static void
|
||||
set_teximage_component_sizes( struct gl_texture_image *texImage )
|
||||
{
|
||||
switch (texImage->Format) {
|
||||
case GL_ALPHA:
|
||||
texImage->RedBits = 0;
|
||||
texImage->GreenBits = 0;
|
||||
texImage->BlueBits = 0;
|
||||
texImage->AlphaBits = 8;
|
||||
texImage->IntensityBits = 0;
|
||||
texImage->LuminanceBits = 0;
|
||||
texImage->IndexBits = 0;
|
||||
break;
|
||||
case GL_LUMINANCE:
|
||||
texImage->RedBits = 0;
|
||||
texImage->GreenBits = 0;
|
||||
texImage->BlueBits = 0;
|
||||
texImage->AlphaBits = 0;
|
||||
texImage->IntensityBits = 0;
|
||||
texImage->LuminanceBits = 8;
|
||||
texImage->IndexBits = 0;
|
||||
break;
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
texImage->RedBits = 0;
|
||||
texImage->GreenBits = 0;
|
||||
texImage->BlueBits = 0;
|
||||
texImage->AlphaBits = 8;
|
||||
texImage->IntensityBits = 0;
|
||||
texImage->LuminanceBits = 8;
|
||||
texImage->IndexBits = 0;
|
||||
break;
|
||||
case GL_INTENSITY:
|
||||
texImage->RedBits = 0;
|
||||
texImage->GreenBits = 0;
|
||||
texImage->BlueBits = 0;
|
||||
texImage->AlphaBits = 0;
|
||||
texImage->IntensityBits = 8;
|
||||
texImage->LuminanceBits = 0;
|
||||
texImage->IndexBits = 0;
|
||||
break;
|
||||
case GL_RED:
|
||||
texImage->RedBits = 8;
|
||||
texImage->GreenBits = 0;
|
||||
texImage->BlueBits = 0;
|
||||
texImage->AlphaBits = 0;
|
||||
texImage->IntensityBits = 0;
|
||||
texImage->LuminanceBits = 0;
|
||||
texImage->IndexBits = 0;
|
||||
break;
|
||||
case GL_GREEN:
|
||||
texImage->RedBits = 0;
|
||||
texImage->GreenBits = 8;
|
||||
texImage->BlueBits = 0;
|
||||
texImage->AlphaBits = 0;
|
||||
texImage->IntensityBits = 0;
|
||||
texImage->LuminanceBits = 0;
|
||||
texImage->IndexBits = 0;
|
||||
break;
|
||||
case GL_BLUE:
|
||||
texImage->RedBits = 0;
|
||||
texImage->GreenBits = 0;
|
||||
texImage->BlueBits = 8;
|
||||
texImage->AlphaBits = 0;
|
||||
texImage->IntensityBits = 0;
|
||||
texImage->LuminanceBits = 0;
|
||||
texImage->IndexBits = 0;
|
||||
break;
|
||||
case GL_RGB:
|
||||
case GL_BGR:
|
||||
texImage->RedBits = 8;
|
||||
texImage->GreenBits = 8;
|
||||
texImage->BlueBits = 8;
|
||||
texImage->AlphaBits = 0;
|
||||
texImage->IntensityBits = 0;
|
||||
texImage->LuminanceBits = 0;
|
||||
texImage->IndexBits = 0;
|
||||
break;
|
||||
case GL_RGBA:
|
||||
case GL_BGRA:
|
||||
case GL_ABGR_EXT:
|
||||
texImage->RedBits = 8;
|
||||
texImage->GreenBits = 8;
|
||||
texImage->BlueBits = 8;
|
||||
texImage->AlphaBits = 8;
|
||||
texImage->IntensityBits = 0;
|
||||
texImage->LuminanceBits = 0;
|
||||
texImage->IndexBits = 0;
|
||||
break;
|
||||
case GL_COLOR_INDEX:
|
||||
texImage->RedBits = 0;
|
||||
texImage->GreenBits = 0;
|
||||
texImage->BlueBits = 0;
|
||||
texImage->AlphaBits = 0;
|
||||
texImage->IntensityBits = 0;
|
||||
texImage->LuminanceBits = 0;
|
||||
texImage->IndexBits = 8;
|
||||
break;
|
||||
default:
|
||||
gl_problem(NULL, "unexpected format in set_teximage_component_sizes");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
set_tex_image(struct gl_texture_object *tObj,
|
||||
GLenum target, GLint level,
|
||||
@@ -468,9 +360,7 @@ init_texture_image( GLcontext *ctx,
|
||||
{
|
||||
ASSERT(img);
|
||||
ASSERT(!img->Data);
|
||||
img->Format = (GLenum) _mesa_base_tex_format(ctx, internalFormat);
|
||||
set_teximage_component_sizes( img );
|
||||
img->IntFormat = (GLenum) internalFormat;
|
||||
_mesa_init_texture_format( ctx, img, internalFormat );
|
||||
img->Border = border;
|
||||
img->Width = width;
|
||||
img->Height = height;
|
||||
@@ -558,6 +448,7 @@ _mesa_select_tex_object(GLcontext *ctx, struct gl_texture_unit *texUnit,
|
||||
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
|
||||
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
|
||||
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
|
||||
case GL_TEXTURE_CUBE_MAP_ARB:
|
||||
return ctx->Extensions.HaveTextureCubeMap
|
||||
? texUnit->CurrentCubeMap : NULL;
|
||||
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
|
||||
@@ -746,7 +637,7 @@ make_texture_image( GLcontext *ctx,
|
||||
}
|
||||
return; /* all done */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -852,13 +743,6 @@ clear_proxy_teximage(struct gl_texture_image *img)
|
||||
ASSERT(img);
|
||||
img->Format = 0;
|
||||
img->IntFormat = 0;
|
||||
img->RedBits = 0;
|
||||
img->GreenBits = 0;
|
||||
img->BlueBits = 0;
|
||||
img->AlphaBits = 0;
|
||||
img->IntensityBits = 0;
|
||||
img->LuminanceBits = 0;
|
||||
img->IndexBits = 0;
|
||||
img->Border = 0;
|
||||
img->Width = 0;
|
||||
img->Height = 0;
|
||||
@@ -872,6 +756,7 @@ clear_proxy_teximage(struct gl_texture_image *img)
|
||||
img->Data = NULL;
|
||||
img->IsCompressed = 0;
|
||||
img->CompressedSize = 0;
|
||||
img->TexFormat = &_mesa_null_texformat;
|
||||
}
|
||||
|
||||
|
||||
@@ -1995,11 +1880,10 @@ void
|
||||
_mesa_GetTexImage( GLenum target, GLint level, GLenum format,
|
||||
GLenum type, GLvoid *pixels )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
const struct gl_texture_object *texObj;
|
||||
struct gl_texture_image *texImage;
|
||||
GLboolean discardImage;
|
||||
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexImage");
|
||||
|
||||
if (level < 0 || level >= ctx->Const.MaxTextureLevels) {
|
||||
@@ -2175,11 +2059,12 @@ _mesa_TexSubImage1D( GLenum target, GLint level,
|
||||
GLenum format, GLenum type,
|
||||
const GLvoid *pixels )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_texture_unit *texUnit;
|
||||
struct gl_texture_object *texObj;
|
||||
struct gl_texture_image *texImage;
|
||||
GLboolean success = GL_FALSE;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexSubImage1D");
|
||||
|
||||
if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0,
|
||||
width, 1, 1, format, type)) {
|
||||
@@ -2258,11 +2143,12 @@ _mesa_TexSubImage2D( GLenum target, GLint level,
|
||||
GLenum format, GLenum type,
|
||||
const GLvoid *pixels )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_texture_unit *texUnit;
|
||||
struct gl_texture_object *texObj;
|
||||
struct gl_texture_image *texImage;
|
||||
GLboolean success = GL_FALSE;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexSubImage2D");
|
||||
|
||||
if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0,
|
||||
width, height, 1, format, type)) {
|
||||
@@ -2371,11 +2257,12 @@ _mesa_TexSubImage3D( GLenum target, GLint level,
|
||||
GLenum format, GLenum type,
|
||||
const GLvoid *pixels )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_texture_unit *texUnit;
|
||||
struct gl_texture_object *texObj;
|
||||
struct gl_texture_image *texImage;
|
||||
GLboolean success = GL_FALSE;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexSubImage3D");
|
||||
|
||||
if (subtexture_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset,
|
||||
width, height, depth, format, type)) {
|
||||
@@ -2522,7 +2409,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
|
||||
return;
|
||||
|
||||
if (ctx->Pixel.MapColorFlag || ctx->Pixel.ScaleOrBiasRGBA
|
||||
|| !ctx->Driver.CopyTexImage1D
|
||||
|| !ctx->Driver.CopyTexImage1D
|
||||
|| !(*ctx->Driver.CopyTexImage1D)(ctx, target, level,
|
||||
internalFormat, x, y, width, border))
|
||||
{
|
||||
@@ -2617,7 +2504,7 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level,
|
||||
gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* now call glTexSubImage1D to do the real work */
|
||||
unpackSave = ctx->Unpack;
|
||||
ctx->Unpack = _mesa_native_packing;
|
||||
@@ -2669,7 +2556,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
|
||||
_mesa_TexSubImage2D(target, level, xoffset, yoffset, width, height,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, image);
|
||||
ctx->Unpack = unpackSave;
|
||||
|
||||
|
||||
FREE(image);
|
||||
}
|
||||
}
|
||||
@@ -2714,7 +2601,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
|
||||
_mesa_TexSubImage3D(target, level, xoffset, yoffset, zoffset,
|
||||
width, height, 1, GL_RGBA, GL_UNSIGNED_BYTE, image);
|
||||
ctx->Unpack = unpackSave;
|
||||
|
||||
|
||||
FREE(image);
|
||||
}
|
||||
}
|
||||
@@ -3117,11 +3004,12 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei width, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_texture_unit *texUnit;
|
||||
struct gl_texture_object *texObj;
|
||||
struct gl_texture_image *texImage;
|
||||
GLboolean success = GL_FALSE;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCompressedTexSubImage1DARB");
|
||||
|
||||
if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0,
|
||||
width, 1, 1, format, GL_NONE)) {
|
||||
@@ -3154,11 +3042,12 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
|
||||
GLenum format, GLsizei imageSize,
|
||||
const GLvoid *data)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_texture_unit *texUnit;
|
||||
struct gl_texture_object *texObj;
|
||||
struct gl_texture_image *texImage;
|
||||
GLboolean success = GL_FALSE;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCompressedTexSubImage2DARB");
|
||||
|
||||
if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0,
|
||||
width, height, 1, format, GL_NONE)) {
|
||||
@@ -3192,11 +3081,12 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei height, GLsizei depth, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_texture_unit *texUnit;
|
||||
struct gl_texture_object *texObj;
|
||||
struct gl_texture_image *texImage;
|
||||
GLboolean success = GL_FALSE;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCompressedTexSubImage3DARB");
|
||||
|
||||
if (subtexture_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset,
|
||||
width, height, depth, format, GL_NONE)) {
|
||||
@@ -3227,10 +3117,9 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
|
||||
void
|
||||
_mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
const struct gl_texture_object *texObj;
|
||||
struct gl_texture_image *texImage;
|
||||
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetCompressedTexImageARB");
|
||||
|
||||
if (level < 0 || level >= ctx->Const.MaxTextureLevels) {
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/* $Id: teximage.h,v 1.11.4.2 2000/10/16 23:37:16 brianp Exp $ */
|
||||
/* $Id: teximage.h,v 1.11.4.3 2001/05/02 21:44:27 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.4
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999-2000 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"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
@@ -143,7 +143,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level,
|
||||
|
||||
|
||||
extern void
|
||||
_mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset,
|
||||
_mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset,
|
||||
GLint x, GLint y, GLsizei width );
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height );
|
||||
|
||||
|
||||
extern void
|
||||
extern void
|
||||
_mesa_CopyTexSubImage3D( GLenum target, GLint level,
|
||||
GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height );
|
||||
@@ -205,4 +205,3 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: texobj.c,v 1.23.4.9 2000/12/14 23:10:39 brianp Exp $ */
|
||||
/* $Id: texobj.c,v 1.23.4.10 2001/03/23 02:00:33 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -493,6 +493,7 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *texName)
|
||||
ctx->Shared->DefaultD[d]->RefCount++;
|
||||
t->RefCount--;
|
||||
ASSERT( t->RefCount >= 0 );
|
||||
ctx->NewState |= NEW_TEXTURING;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: texstate.c,v 1.15.4.3 2001/01/06 22:43:00 gareth Exp $ */
|
||||
/* $Id: texstate.c,v 1.15.4.5 2001/05/04 17:26:08 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -891,25 +891,49 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
|
||||
*params = img->Border;
|
||||
return;
|
||||
case GL_TEXTURE_RED_SIZE:
|
||||
*params = img->RedBits;
|
||||
if (img->Format == GL_RGB || img->Format == GL_RGBA)
|
||||
*params = img->TexFormat->RedBits;
|
||||
else
|
||||
*params = 0;
|
||||
return;
|
||||
case GL_TEXTURE_GREEN_SIZE:
|
||||
*params = img->GreenBits;
|
||||
if (img->Format == GL_RGB || img->Format == GL_RGBA)
|
||||
*params = img->TexFormat->GreenBits;
|
||||
else
|
||||
*params = 0;
|
||||
return;
|
||||
case GL_TEXTURE_BLUE_SIZE:
|
||||
*params = img->BlueBits;
|
||||
if (img->Format == GL_RGB || img->Format == GL_RGBA)
|
||||
*params = img->TexFormat->BlueBits;
|
||||
else
|
||||
*params = 0;
|
||||
return;
|
||||
case GL_TEXTURE_ALPHA_SIZE:
|
||||
*params = img->AlphaBits;
|
||||
if (img->Format == GL_ALPHA || img->Format == GL_LUMINANCE_ALPHA ||
|
||||
img->Format == GL_RGBA)
|
||||
*params = img->TexFormat->AlphaBits;
|
||||
else
|
||||
*params = 0;
|
||||
return;
|
||||
case GL_TEXTURE_INTENSITY_SIZE:
|
||||
*params = img->IntensityBits;
|
||||
if (img->Format != GL_INTENSITY)
|
||||
*params = 0;
|
||||
else if (img->TexFormat->IntensityBits > 0)
|
||||
*params = img->TexFormat->IntensityBits;
|
||||
else /* intensity probably stored as rgb texture */
|
||||
*params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits);
|
||||
return;
|
||||
case GL_TEXTURE_LUMINANCE_SIZE:
|
||||
*params = img->LuminanceBits;
|
||||
if (img->Format != GL_LUMINANCE &&
|
||||
img->Format != GL_LUMINANCE_ALPHA)
|
||||
*params = 0;
|
||||
else if (img->TexFormat->LuminanceBits)
|
||||
*params = img->TexFormat->LuminanceBits;
|
||||
else /* luminance probably stored as rgb texture */
|
||||
*params = img->TexFormat->RedBits;
|
||||
return;
|
||||
case GL_TEXTURE_INDEX_SIZE_EXT:
|
||||
*params = img->IndexBits;
|
||||
*params = img->TexFormat->IndexBits;
|
||||
return;
|
||||
|
||||
/* GL_ARB_texture_compression */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,93 +1,88 @@
|
||||
/* $Id: texutil.h,v 1.3.4.1 2000/08/29 22:58:33 brianp Exp $ */
|
||||
/* $Id: texutil.h,v 1.3.4.3 2001/05/14 17:54:26 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.4
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999-2000 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"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TEXUTIL_H
|
||||
#define TEXUTIL_H
|
||||
|
||||
|
||||
#include "types.h"
|
||||
#include "texformat.h"
|
||||
|
||||
extern GLboolean
|
||||
_mesa_convert_texsubimage1d( GLint mesaFormat,
|
||||
GLint xoffset,
|
||||
GLint width,
|
||||
GLenum format, GLenum type,
|
||||
const struct gl_pixelstore_attrib *packing,
|
||||
const GLvoid *srcImage, GLvoid *dstImage );
|
||||
|
||||
extern GLboolean
|
||||
_mesa_convert_texsubimage2d( GLint mesaFormat,
|
||||
GLint xoffset, GLint yoffset,
|
||||
GLint width, GLint height,
|
||||
GLint imageWidth,
|
||||
GLenum format, GLenum type,
|
||||
const struct gl_pixelstore_attrib *packing,
|
||||
const GLvoid *srcImage, GLvoid *dstImage );
|
||||
|
||||
/*
|
||||
* NOTE: "FF" means fill with byte value 0xff
|
||||
extern GLboolean
|
||||
_mesa_convert_texsubimage3d( GLint mesaFormat,
|
||||
GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLint width, GLint height, GLint depth,
|
||||
GLint imageWidth, GLint imageHeight,
|
||||
GLenum format, GLenum type,
|
||||
const struct gl_pixelstore_attrib *packing,
|
||||
const GLvoid *srcImage, GLvoid *dstImage );
|
||||
|
||||
/* Deprecated in 3.5:
|
||||
*/
|
||||
/* msb <------ TEXEL BITS -----------> lsb */
|
||||
typedef enum { /* ---- ---- ---- ---- ---- ---- ---- ---- */
|
||||
MESA_I8, /* IIII IIII */
|
||||
MESA_L8, /* LLLL LLLL */
|
||||
MESA_A8, /* AAAA AAAA */
|
||||
MESA_C8, /* CCCC CCCC */
|
||||
MESA_A8_L8, /* AAAA AAAA LLLL LLLL */
|
||||
MESA_R5_G6_B5, /* RRRR RGGG GGGB BBBB */
|
||||
MESA_A4_R4_G4_B4, /* AAAA RRRR GGGG BBBB */
|
||||
MESA_A1_R5_G5_B5, /* ARRR RRGG GGGB BBBB */
|
||||
MESA_A8_R8_G8_B8, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */
|
||||
MESA_FF_R8_G8_B8 /* FFFF FFFF RRRR RRRR GGGG GGGG BBBB BBBB */
|
||||
} MesaIntTexFormat;
|
||||
|
||||
|
||||
|
||||
|
||||
extern GLboolean
|
||||
_mesa_convert_teximage(MesaIntTexFormat dstFormat,
|
||||
GLint dstWidth, GLint dstHeight, GLvoid *dstImage,
|
||||
GLint dstRowStride,
|
||||
GLint srcWidth, GLint srcHeight,
|
||||
GLenum srcFormat, GLenum srcType,
|
||||
const GLvoid *srcImage,
|
||||
const struct gl_pixelstore_attrib *packing);
|
||||
|
||||
|
||||
|
||||
extern GLboolean
|
||||
_mesa_convert_texsubimage(MesaIntTexFormat dstFormat,
|
||||
GLint dstXoffset, GLint dstYoffset,
|
||||
GLint dstWidth, GLint dstHeight, GLvoid *dstImage,
|
||||
GLint dstRowStride,
|
||||
GLint width, GLint height,
|
||||
GLint srcWidth, GLint srcHeight,
|
||||
GLenum srcFormat, GLenum srcType,
|
||||
const GLvoid *srcImage,
|
||||
const struct gl_pixelstore_attrib *packing);
|
||||
|
||||
extern void
|
||||
_mesa_unconvert_teximage1d( GLint mesaFormat, GLenum format, GLint width,
|
||||
const GLvoid *srcImage, GLvoid *dstImage );
|
||||
|
||||
extern void
|
||||
_mesa_unconvert_teximage(MesaIntTexFormat srcFormat,
|
||||
GLint srcWidth, GLint srcHeight,
|
||||
const GLvoid *srcImage, GLint srcRowStride,
|
||||
GLint dstWidth, GLint dstHeight,
|
||||
GLenum dstFormat, GLubyte *dstImage);
|
||||
|
||||
_mesa_unconvert_teximage2d( GLint mesaFormat, GLenum format,
|
||||
GLint width, GLint height,
|
||||
const GLvoid *srcImage, GLvoid *dstImage );
|
||||
|
||||
extern void
|
||||
_mesa_set_teximage_component_sizes(MesaIntTexFormat mesaFormat,
|
||||
struct gl_texture_image *texImage);
|
||||
_mesa_unconvert_teximage3d( GLint mesaFormat, GLenum format,
|
||||
GLint width, GLint height, GLint depth,
|
||||
const GLvoid *srcImage, GLvoid *dstImage );
|
||||
|
||||
/* Nearest filtering only (for broken hardware that can't support
|
||||
* all aspect ratios). FIXME: Make this a subimage update as well...
|
||||
*/
|
||||
extern void
|
||||
_mesa_rescale_teximage2d( GLint texelBytes,
|
||||
GLint srcWidth, GLint srcHeight,
|
||||
GLint dstWidth, GLint dstHeight,
|
||||
const GLvoid *srcImage, GLvoid *dstImage );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
375
src/mesa/main/texutil_tmp.h
Normal file
375
src/mesa/main/texutil_tmp.h
Normal file
@@ -0,0 +1,375 @@
|
||||
/*
|
||||
* NOTE: All 3D code is untested and most definitely broken...
|
||||
*/
|
||||
|
||||
#define DST_TEXEL_BYTES (4 / DST_TEXELS_PER_DWORD)
|
||||
#define DST_ROW_WIDTH (convert->width * DST_TEXEL_BYTES)
|
||||
#define DST_ROW_STRIDE (convert->imageWidth * DST_TEXEL_BYTES)
|
||||
#define DST_IMG_STRIDE (convert->imageWidth * \
|
||||
convert->imageHeight * DST_TEXEL_BYTES)
|
||||
|
||||
|
||||
/* ================================================================
|
||||
* PRE: No pixelstore attribs, width == imageWidth.
|
||||
*/
|
||||
static GLboolean
|
||||
TAG(texsubimage2d)( struct gl_texture_convert *convert )
|
||||
{
|
||||
const GLubyte *src = (const GLubyte *)convert->srcImage;
|
||||
GLuint *dst = (GLuint *)((GLubyte *)convert->dstImage +
|
||||
(convert->yoffset * convert->imageWidth +
|
||||
convert->xoffset) * DST_TEXEL_BYTES);
|
||||
GLint dwords, i;
|
||||
(void) dwords; (void) i;
|
||||
|
||||
if ( DBG )
|
||||
fprintf( stderr, __FUNCTION__ "\n" );
|
||||
|
||||
#ifdef CONVERT_DIRECT
|
||||
MEMCPY( dst, src, convert->height * DST_ROW_WIDTH );
|
||||
#else
|
||||
dwords = (convert->width * convert->height +
|
||||
DST_TEXELS_PER_DWORD - 1) / DST_TEXELS_PER_DWORD;
|
||||
|
||||
for ( i = 0 ; i < dwords ; i++ ) {
|
||||
*dst++ = CONVERT_TEXEL_DWORD( src );
|
||||
src += SRC_TEXEL_BYTES * DST_TEXELS_PER_DWORD;
|
||||
}
|
||||
#endif
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
/* PRE: As above, height == imageHeight also.
|
||||
*/
|
||||
static GLboolean
|
||||
TAG(texsubimage3d)( struct gl_texture_convert *convert )
|
||||
{
|
||||
const GLubyte *src = (const GLubyte *)convert->srcImage;
|
||||
GLuint *dst = (GLuint *)((GLubyte *)convert->dstImage +
|
||||
((convert->zoffset * convert->height +
|
||||
convert->yoffset) * convert->width +
|
||||
convert->xoffset) * DST_TEXEL_BYTES);
|
||||
GLint dwords, i;
|
||||
(void) dwords; (void) i;
|
||||
|
||||
if ( DBG )
|
||||
fprintf( stderr, __FUNCTION__ "\n" );
|
||||
|
||||
#ifdef CONVERT_DIRECT
|
||||
MEMCPY( dst, src, convert->depth * convert->height * DST_ROW_WIDTH );
|
||||
#else
|
||||
dwords = (convert->width * convert->height * convert->depth +
|
||||
DST_TEXELS_PER_DWORD - 1) / DST_TEXELS_PER_DWORD;
|
||||
|
||||
for ( i = 0 ; i < dwords ; i++ ) {
|
||||
*dst++ = CONVERT_TEXEL_DWORD( src );
|
||||
src += SRC_TEXEL_BYTES * DST_TEXELS_PER_DWORD;
|
||||
}
|
||||
#endif
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ================================================================
|
||||
* PRE: No pixelstore attribs, width != imageWidth.
|
||||
*/
|
||||
static GLboolean
|
||||
TAG(texsubimage2d_stride)( struct gl_texture_convert *convert )
|
||||
{
|
||||
const GLubyte *src = (const GLubyte *)convert->srcImage;
|
||||
DST_TYPE *dst = (DST_TYPE *)((GLubyte *)convert->dstImage +
|
||||
(convert->yoffset * convert->imageWidth +
|
||||
convert->xoffset) * DST_TEXEL_BYTES);
|
||||
GLint adjust;
|
||||
GLint row, col;
|
||||
|
||||
adjust = convert->imageWidth - convert->width;
|
||||
|
||||
if ( DBG ) {
|
||||
fprintf( stderr, __FUNCTION__ ":\n" );
|
||||
fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n",
|
||||
convert->xoffset, convert->yoffset, convert->width,
|
||||
convert->height, convert->imageWidth );
|
||||
fprintf( stderr, " adjust=%d\n", adjust );
|
||||
}
|
||||
|
||||
for ( row = 0 ; row < convert->height ; row++ ) {
|
||||
for ( col = 0 ; col < convert->width ; col++ ) {
|
||||
*dst++ = CONVERT_TEXEL( src );
|
||||
src += SRC_TEXEL_BYTES;
|
||||
}
|
||||
dst += adjust;
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
/* PRE: As above, or height != imageHeight also.
|
||||
*/
|
||||
static GLboolean
|
||||
TAG(texsubimage3d_stride)( struct gl_texture_convert *convert )
|
||||
{
|
||||
const GLubyte *src = (const GLubyte *)convert->srcImage;
|
||||
DST_TYPE *dst = (DST_TYPE *)((GLubyte *)convert->dstImage +
|
||||
((convert->zoffset * convert->imageHeight +
|
||||
convert->yoffset) * convert->imageWidth +
|
||||
convert->xoffset) * DST_TEXEL_BYTES);
|
||||
GLint adjust;
|
||||
GLint row, col, img;
|
||||
|
||||
adjust = convert->imageWidth - convert->width;
|
||||
|
||||
if ( DBG ) {
|
||||
fprintf( stderr, __FUNCTION__ ":\n" );
|
||||
fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n",
|
||||
convert->xoffset, convert->yoffset, convert->width,
|
||||
convert->height, convert->imageWidth );
|
||||
fprintf( stderr, " adjust=%d\n", adjust );
|
||||
}
|
||||
|
||||
for ( img = 0 ; img < convert->depth ; img++ ) {
|
||||
for ( row = 0 ; row < convert->height ; row++ ) {
|
||||
for ( col = 0 ; col < convert->width ; col++ ) {
|
||||
*dst++ = CONVERT_TEXEL( src );
|
||||
src += SRC_TEXEL_BYTES;
|
||||
}
|
||||
dst += adjust;
|
||||
}
|
||||
/* FIXME: ... */
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ================================================================
|
||||
* PRE: Require pixelstore attribs, width == imageWidth.
|
||||
*/
|
||||
static GLboolean
|
||||
TAG(texsubimage2d_pack)( struct gl_texture_convert *convert )
|
||||
{
|
||||
const GLubyte *src = (const GLubyte *)
|
||||
_mesa_image_address( convert->packing, convert->srcImage,
|
||||
convert->width, convert->height,
|
||||
convert->format, convert->type, 0, 0, 0 );
|
||||
const GLint srcRowStride =
|
||||
_mesa_image_row_stride( convert->packing, convert->width,
|
||||
convert->format, convert->type );
|
||||
GLuint *dst = (GLuint *)((GLubyte *)convert->dstImage +
|
||||
(convert->yoffset * convert->width +
|
||||
convert->xoffset) * DST_TEXEL_BYTES);
|
||||
GLint width;
|
||||
GLint row, col;
|
||||
(void) col;
|
||||
|
||||
if ( DBG )
|
||||
fprintf( stderr, __FUNCTION__ "\n" );
|
||||
|
||||
width = ((convert->width + DST_TEXELS_PER_DWORD - 1)
|
||||
& ~(DST_TEXELS_PER_DWORD - 1));
|
||||
|
||||
for ( row = 0 ; row < convert->height ; row++ ) {
|
||||
#ifdef CONVERT_DIRECT
|
||||
MEMCPY( dst, src, DST_ROW_STRIDE );
|
||||
src += srcRowStride;
|
||||
dst = (GLuint *)((GLubyte *)dst + DST_ROW_STRIDE);
|
||||
#else
|
||||
const GLubyte *srcRow = src;
|
||||
for ( col = width / DST_TEXELS_PER_DWORD ; col ; col-- ) {
|
||||
*dst++ = CONVERT_TEXEL_DWORD( src );
|
||||
src += SRC_TEXEL_BYTES * DST_TEXELS_PER_DWORD;
|
||||
}
|
||||
src = srcRow + srcRowStride;
|
||||
#endif
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
/* PRE: as above, height == imageHeight also.
|
||||
*/
|
||||
static GLboolean
|
||||
TAG(texsubimage3d_pack)( struct gl_texture_convert *convert )
|
||||
{
|
||||
const GLubyte *src = (const GLubyte *)
|
||||
_mesa_image_address( convert->packing, convert->srcImage,
|
||||
convert->width, convert->height,
|
||||
convert->format, convert->type, 0, 0, 0 );
|
||||
const GLint srcRowStride =
|
||||
_mesa_image_row_stride( convert->packing, convert->width,
|
||||
convert->format, convert->type );
|
||||
GLuint *dst = (GLuint *)((GLubyte *)convert->dstImage +
|
||||
((convert->zoffset * convert->height +
|
||||
convert->yoffset) * convert->width +
|
||||
convert->xoffset) * DST_TEXEL_BYTES);
|
||||
GLint width;
|
||||
GLint row, col, img;
|
||||
(void) col;
|
||||
|
||||
if ( DBG )
|
||||
fprintf( stderr, __FUNCTION__ "\n" );
|
||||
|
||||
width = ((convert->width + DST_TEXELS_PER_DWORD - 1)
|
||||
& ~(DST_TEXELS_PER_DWORD - 1));
|
||||
|
||||
for ( img = 0 ; img < convert->depth ; img++ ) {
|
||||
for ( row = 0 ; row < convert->height ; row++ ) {
|
||||
#ifdef CONVERT_DIRECT
|
||||
MEMCPY( dst, src, DST_ROW_STRIDE );
|
||||
src += srcRowStride;
|
||||
dst = (GLuint *)((GLubyte *)dst + DST_ROW_STRIDE);
|
||||
#else
|
||||
const GLubyte *srcRow = src;
|
||||
for ( col = width / DST_TEXELS_PER_DWORD ; col ; col-- ) {
|
||||
*dst++ = CONVERT_TEXEL_DWORD( src );
|
||||
src += SRC_TEXEL_BYTES * DST_TEXELS_PER_DWORD;
|
||||
}
|
||||
src = srcRow + srcRowStride;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ================================================================
|
||||
* PRE: Require pixelstore attribs, width != imageWidth.
|
||||
*/
|
||||
static GLboolean
|
||||
TAG(texsubimage2d_stride_pack)( struct gl_texture_convert *convert )
|
||||
{
|
||||
const GLubyte *src = (const GLubyte *)
|
||||
_mesa_image_address( convert->packing, convert->srcImage,
|
||||
convert->width, convert->height,
|
||||
convert->format, convert->type, 0, 0, 0 );
|
||||
const GLint srcRowStride =
|
||||
_mesa_image_row_stride( convert->packing, convert->width,
|
||||
convert->format, convert->type );
|
||||
DST_TYPE *dst = (DST_TYPE *)((GLubyte *)convert->dstImage +
|
||||
(convert->yoffset * convert->imageWidth +
|
||||
convert->xoffset) * DST_TEXEL_BYTES);
|
||||
GLint adjust;
|
||||
GLint row, col;
|
||||
(void) col;
|
||||
|
||||
adjust = convert->imageWidth - convert->width;
|
||||
|
||||
if ( DBG ) {
|
||||
fprintf( stderr, __FUNCTION__ ":\n" );
|
||||
fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n",
|
||||
convert->xoffset, convert->yoffset, convert->width,
|
||||
convert->height, convert->imageWidth );
|
||||
fprintf( stderr, " adjust=%d\n", adjust );
|
||||
}
|
||||
|
||||
for ( row = 0 ; row < convert->height ; row++ ) {
|
||||
#ifdef CONVERT_DIRECT
|
||||
MEMCPY( dst, src, DST_ROW_WIDTH );
|
||||
src += srcRowStride;
|
||||
dst += convert->imageWidth;
|
||||
#else
|
||||
const GLubyte *srcRow = src;
|
||||
for ( col = 0 ; col < convert->width ; col++ ) {
|
||||
*dst++ = CONVERT_TEXEL( src );
|
||||
src += SRC_TEXEL_BYTES;
|
||||
}
|
||||
src = srcRow + srcRowStride;
|
||||
dst += adjust;
|
||||
#endif
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
/* PRE: As above, or height != imageHeight also.
|
||||
*/
|
||||
static GLboolean
|
||||
TAG(texsubimage3d_stride_pack)( struct gl_texture_convert *convert )
|
||||
{
|
||||
const GLubyte *src = (const GLubyte *)
|
||||
_mesa_image_address( convert->packing, convert->srcImage,
|
||||
convert->width, convert->height,
|
||||
convert->format, convert->type, 0, 0, 0 );
|
||||
const GLint srcRowStride =
|
||||
_mesa_image_row_stride( convert->packing, convert->width,
|
||||
convert->format, convert->type );
|
||||
DST_TYPE *dst = (DST_TYPE *)((GLubyte *)convert->dstImage +
|
||||
((convert->zoffset * convert->imageHeight +
|
||||
convert->yoffset) * convert->imageWidth +
|
||||
convert->xoffset) * DST_TEXEL_BYTES);
|
||||
GLint adjust;
|
||||
GLint row, col, img;
|
||||
(void) col;
|
||||
|
||||
adjust = convert->imageWidth - convert->width;
|
||||
|
||||
if ( DBG ) {
|
||||
fprintf( stderr, __FUNCTION__ ":\n" );
|
||||
fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n",
|
||||
convert->xoffset, convert->yoffset, convert->width,
|
||||
convert->height, convert->imageWidth );
|
||||
fprintf( stderr, " adjust=%d\n", adjust );
|
||||
}
|
||||
|
||||
for ( img = 0 ; img < convert->depth ; img++ ) {
|
||||
for ( row = 0 ; row < convert->height ; row++ ) {
|
||||
#ifdef CONVERT_DIRECT
|
||||
MEMCPY( dst, src, DST_ROW_WIDTH );
|
||||
src += srcRowStride;
|
||||
dst += convert->imageWidth;
|
||||
#else
|
||||
const GLubyte *srcRow = src;
|
||||
for ( col = 0 ; col < convert->width ; col++ ) {
|
||||
*dst++ = CONVERT_TEXEL( src );
|
||||
src += SRC_TEXEL_BYTES;
|
||||
}
|
||||
src = srcRow + srcRowStride;
|
||||
dst += adjust;
|
||||
#endif
|
||||
}
|
||||
/* FIXME: ... */
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static convert_func TAG(texsubimage2d_tab)[] = {
|
||||
TAG(texsubimage2d),
|
||||
TAG(texsubimage2d_stride),
|
||||
TAG(texsubimage2d_pack),
|
||||
TAG(texsubimage2d_stride_pack),
|
||||
};
|
||||
|
||||
static convert_func TAG(texsubimage3d_tab)[] = {
|
||||
TAG(texsubimage3d),
|
||||
TAG(texsubimage3d_stride),
|
||||
TAG(texsubimage3d_pack),
|
||||
TAG(texsubimage3d_stride_pack),
|
||||
};
|
||||
|
||||
|
||||
#ifndef PRESERVE_DST_TYPE
|
||||
#undef DST_TYPE
|
||||
#undef DST_TEXELS_PER_DWORD
|
||||
#endif
|
||||
|
||||
#undef SRC_TEXEL_BYTES
|
||||
#undef DST_TEXEL_BYTES
|
||||
#undef DST_ROW_WIDTH
|
||||
#undef DST_ROW_STRIDE
|
||||
|
||||
#undef CONVERT_TEXEL
|
||||
#undef CONVERT_TEXEL_DWORD
|
||||
#undef CONVERT_DIRECT
|
||||
|
||||
#undef TAG
|
||||
|
||||
#undef PRESERVE_DST_TYPE
|
||||
Reference in New Issue
Block a user