From ff3f09a7feb302daa8ceb01bd7ee6ee8a174fd5b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 14:42:32 -0600 Subject: docs: document cell, glGetTexLevelParameter() fixes --- docs/relnotes-7.6.1.html | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 9d28a5b2b5..2cfa839b20 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -45,6 +45,9 @@ tbd
  • Fake glXQueryDrawable() didn't return good values (bug 24320)
  • Fixed AUX buffer breakage (bug 24426).
  • Fixed locale-dependent float parsing bug in GLSL compiler (bug 24531) +
  • Fixed Gallium Cell driver compilation failure. +
  • Fixed glGetTexLevelParameter(GL_TEXTURE_INTERNAL_FORMAT) query so that + it returns the actual compressed format chosen. -- cgit v1.2.3 From 96d7d66dff5b6dbca1ff6fe48e5449a8107d7781 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 14:49:47 -0600 Subject: docs: document updated GL extension header files --- docs/relnotes-7.6.1.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 2cfa839b20..11421bede6 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -32,6 +32,8 @@ tbd

    New features

      +
    • Upgraded GL/glext.h to version 56, GL/glxext.h to version 25, + GL/wglext.h to version 17
    -- cgit v1.2.3 From 0a4763184971662b23980b533b78d34600ecf06d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Oct 2009 10:58:47 -0600 Subject: docs: document Intel glBitmap fixes --- docs/relnotes-7.6.1.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 11421bede6..e17ee67255 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -50,6 +50,7 @@ tbd
  • Fixed Gallium Cell driver compilation failure.
  • Fixed glGetTexLevelParameter(GL_TEXTURE_INTERNAL_FORMAT) query so that it returns the actual compressed format chosen. +
  • Fixed glBitmap bugs in Intel drivers. -- cgit v1.2.3 From b73c4ad98b74000b7e286ecbd26110dfb40d8bcc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Oct 2009 10:58:47 -0600 Subject: docs: document Intel glBitmap fixes --- docs/relnotes-7.6.1.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 11421bede6..e17ee67255 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -50,6 +50,7 @@ tbd
  • Fixed Gallium Cell driver compilation failure.
  • Fixed glGetTexLevelParameter(GL_TEXTURE_INTERNAL_FORMAT) query so that it returns the actual compressed format chosen. +
  • Fixed glBitmap bugs in Intel drivers. -- cgit v1.2.3 From c5106339d38dfac6652be9788ae8c78efab7667c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 3 Nov 2009 16:12:02 -0700 Subject: docs: fix 7.6 build with Visual Studio --- docs/relnotes-7.6.1.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index e17ee67255..9ee6babc9d 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -51,6 +51,7 @@ tbd
  • Fixed glGetTexLevelParameter(GL_TEXTURE_INTERNAL_FORMAT) query so that it returns the actual compressed format chosen.
  • Fixed glBitmap bugs in Intel drivers. +
  • Fixed a number of Microsoft Visual Studio compilation problems. -- cgit v1.2.3 From 664b7303c2e8ae2c6c5a44d5b30254ddab4eb266 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Nov 2009 23:17:14 -0700 Subject: docs: fixes, changes for Mesa 7.7 --- docs/relnotes-7.7.html | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/relnotes-7.7.html b/docs/relnotes-7.7.html index 856b8fae3d..e640de2941 100644 --- a/docs/relnotes-7.7.html +++ b/docs/relnotes-7.7.html @@ -44,11 +44,14 @@ tbd

    Bug fixes

      +
    • Many assorted i965 driver fixes.

    Changes

      +
    • New Mesa texture/surface format infrastructure +
    • Removed some unused Mesa device driver hooks
    -- cgit v1.2.3 From 0f060250fc95e63e00ebf9eeb603eed470693221 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 16 Nov 2009 10:46:20 -0800 Subject: docs: Update r300g status. --- docs/relnotes-7.7.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/relnotes-7.7.html b/docs/relnotes-7.7.html index e640de2941..7ab278bd08 100644 --- a/docs/relnotes-7.7.html +++ b/docs/relnotes-7.7.html @@ -45,6 +45,7 @@ tbd

    Bug fixes

    • Many assorted i965 driver fixes. +
    • Many r300-gallium driver fixes; this driver is now considered unstable-quality instead of experimental-quality.
    -- cgit v1.2.3 From 63bc736f90e044bdd681d56300e8342582c5a93a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Nov 2009 11:23:03 -0700 Subject: docs: list the new VMware SVGA Gallium driver in release notes --- docs/relnotes-7.7.html | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/relnotes-7.7.html b/docs/relnotes-7.7.html index 7ab278bd08..8c8f763b6f 100644 --- a/docs/relnotes-7.7.html +++ b/docs/relnotes-7.7.html @@ -34,6 +34,9 @@ tbd

    New features

      +
    • VMware "SVGA" Gallium driver. This is a Gallium3D driver which targets the + VMware virtual graphics device. It allows Linux OpenGL guest applications + to utilize the 3D graphics hardware of the host operating system.
    • GL_ARB_draw_elements_base_vertex (supported in Intel i965 and software drivers)
    • GL_ARB_depth_clamp (supported in Intel i965 DRI and software drivers)
    • GL_NV_depth_clamp (supported in Intel i965 DRI and software drivers)
    • -- cgit v1.2.3 From 2b3ea2be906fbe0bf08f08f23ec39c0feb7a8f39 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Nov 2009 15:53:27 -0700 Subject: docs: i965 clipping fix --- docs/relnotes-7.6.1.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 9ee6babc9d..7a809a0c41 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -52,6 +52,7 @@ tbd it returns the actual compressed format chosen.
    • Fixed glBitmap bugs in Intel drivers.
    • Fixed a number of Microsoft Visual Studio compilation problems. +
    • Fixed clipping / provoking vertex bugs in i965 driver.
    -- cgit v1.2.3 From 4440d8adb6f94c9a5c4bc1a913433d88a9ef5324 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Nov 2009 16:32:05 -0700 Subject: docs: libGL documentation, from the xorg-docs tree This is pretty old and needs some updating but might be useful or interesting to some people. --- docs/libGL.txt | 197 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 docs/libGL.txt (limited to 'docs') diff --git a/docs/libGL.txt b/docs/libGL.txt new file mode 100644 index 0000000000..cb98840437 --- /dev/null +++ b/docs/libGL.txt @@ -0,0 +1,197 @@ + + + +Introduction +------------ + +This document describes the implementation of the XFree86 4.0 libGL.so +library defined by the Linux/OpenGL Base specification found at +http://reality.sgi.com/opengl/linux/linuxbase.html. + +The documentation is divided into two sections: + User's Guide + Driver Developer's Guide + +Author: Brian Paul (brian@precisioninsight.com) +Date: February 2000 + + + +User's Guide +------------ + +Using libGL.so + +The libGL.so library defines the gl- and glX-prefixed functions needed to +run OpenGL programs. OpenGL client applications should link with the +-lGL option to use it. + +libGL.so serves two primary functions: GLX protocol generation for indirect +rendering and loading/management of hardware drivers for direct rendering. + +When libGL.so initializes itself it uses the DRI to determine the +appropriate hardware driver for each screen on the local X display. +The hardware drivers are expected to be in the /usr/X11R6/lib/modules/dri/ +directory. Drivers are named with the convention _dri.so where + is a driver such as "tdfx", "i810", "gamma", etc. + +The LIBGL_DRIVERS_DIR environment variable may be used to specify a +different DRI modules directory, overriding /usr/X11R6/lib/modules/dri/. +This environment variable is ignored in setuid programs for security +reasons. + +When libGL.so is unable to locate appropriate hardware drivers it will +fall back to using indirect GLX rendering. + +To aid in solving problems, libGL.so will print diagnostic messages to +stderr if the LIBGL_DEBUG environment variable is defined. + +libGL.so is thread safe. The overhead of thread safety for common, +single-thread clients is negligible. However, the overhead of thread +safety for multi-threaded clients is significant. Each GL API call +requires two calls to pthread_get_specific() which can noticably +impact performance. Warning: libGL.so is thread safe but individual +DRI drivers may not be. Please consult the documentation for a driver +to learn if it is thread safe. + + + +Indirect Rendering + +You can force indirect rendering mode by setting the LIBGL_ALWAYS_INDIRECT +environment variable. Hardware acceleration will not be used. + + + +libGL.so Extensibility + +libGL.so is designed to be extended without upgrading. That is, +drivers may install new OpenGL extension functions into libGL.so +without requiring libGL.so to be replaced. Clients of libGL.so should +use the glXGetProcAddressEXT() function to obtain the address of +functions by name. For more details of GLX_ARB_get_proc_address see +http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.spec + +libGL.so is also designed with flexibility such that it may be used +with many generations of hardware drivers to come. + + + + +Driver Developer's Guide +------------------------ + +This section describes the requirements to make an XFree86 4.0 +libGL.so-compatible hardware driver. It is not intended for end +users of libGL.so. + + +XFree86 source files + +libGL.so is built inside XFree86 with sources found in xc/lib/GL/. +Specifically, libGL.so is built from: + + xc/lib/GL/glx/*.c + xc/lib/dri/XF86dri.c + xc/lib/dri/dri_glx.c + xc/lib/GL/mesa/src/glapi.c + xc/lib/GL/mesa/src/glapitemp.h + xc/lib/GL/mesa/src/glapitable.h + xc/lib/GL/mesa/src/glapioffsets.h + xc/lib/GL/mesa/src/glapinoop.c + xc/lib/GL/mesa/src/glheader.h + xc/lib/GL/mesa/src/glthread.c + xc/lib/GL/mesa/src/glthread.h + xc/lib/GL/mesa/src/X86/glapi_x86.S + xc/lib/GL/mesa/src/X86/assyntax.h + +Understand that the mesa/src/gl*.[ch] files are not tied to Mesa. They +have no dependencies on the rest of Mesa and are designed to be reusable +in a number of projects. + +The glapi_x86.X and assyntax.h files implement x86-optimized dispatch +of GL functions. They are not required; C-based dispatch can be used +instead, with a slight performance penalty. + + + +Driver loading and binding + +When libGL.so initializes itself (via the __glXInitialize function) a +call is made to driCreateDisplay(). This function uses DRI facilities +to determine the driver file appropriate for each screen on the local +display. Each screen's driver is then opened with dlopen() and asked +for its __driCreateScreen() function. The pointers to the __driCreateScreen() +functions are kept in an array, indexed by screen number, in the +__DRIdisplayRec struct. + +When a driver's __driCreateScreen() function is called, it must initialize +a __DRIscreenRec struct. This struct acts as the root of a tree of +function pointers which are called to create and destroy contexts and +drawables and perform all the operations needed by the GLX interface. +See the xc/lib/GL/glx/glxclient.h file for details. + + + +Dynamic Extension Function Registration + +In order to provide forward compatibility with future drivers, libGL.so +allows drivers to register new OpenGL extension functions which weren't +known when libGL.so was built. + +The register_extensions() function in xc/lib/GL/dri/dri_glx.c is called +as soon as libGL.so is loaded. This is done with gcc's constructor +attribute. This mechanism will likely have to be changed for other compilers. + +register_extensions() loops over all local displays and screens, determines +the DRI driver for each, and calls the driver's __driRegisterExtensions() +function, if present. + +The __driRegisterExtensions() function can add new entrypoints to libGL +by calling: + + GLboolean _glapi_add_entrypoint(const char *funcName, GLuint offset) + +The parameters are the name of the function (such as "glFoobarEXT") and the +offset of the dispatch slot in the API dispatch table. The return value +indicates success (GL_TRUE) or failure (GL_FALSE). + +_glapi_add_entrypoint() will synthesize entrypoint code in assembly +language. Assembly languages is required since parameter passing +can't be handled correctly using a C-based solution. + +The address of the new entrypoint is obtained by calling the +glXGetProcAddressARB() function. + +The dispatch offset number MUST be a number allocated by SGI in the same +manner in which new GL_* constants are allocated. Using an arbitrary +offset number will result in many problems. + + + +Dispatch Management + +When a GL context is made current, the driver must install its dispatch +table as the current dispatch table. This is done by calling + + void _glapi_set_dispatch(struct _glapi_table *dispatch); + +This will install the named dispatch table for the calling thread. +The current dispatch table for a thread can be obtained by calling + + struct _glapi_table *_glapi_get_dispatch(void); + +For higher performance in the common single-thread case, the global +variable _glapi_Dispatch will point to the current dispatch table. +This variable will be NULL when in multi-thread mode. + + + +Context Management + +libGL.so uses the XFree86 xthreads package to manage a thread-specific +current context pointer. See __glXGet/SetCurrentContext() in glext.c + +Drivers may use the _glapi_set/get_context() functions to maintain +a private thread-specific context pointer. + -- cgit v1.2.3 From 3ba983bf5d0ae8f9eb5083513e910abf41dd8b73 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Nov 2009 07:46:17 -0700 Subject: docs: setup 7.8 release notes file --- docs/relnotes-7.8.html | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ docs/relnotes.html | 1 + 2 files changed, 54 insertions(+) create mode 100644 docs/relnotes-7.8.html (limited to 'docs') diff --git a/docs/relnotes-7.8.html b/docs/relnotes-7.8.html new file mode 100644 index 0000000000..dc003566c7 --- /dev/null +++ b/docs/relnotes-7.8.html @@ -0,0 +1,53 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.8 Release Notes / date TBD

    + +

    +Mesa 7.8 is a new development release. +People who are concerned with stability and reliability should stick +with a previous release or wait for Mesa 7.8.1. +

    +

    +Mesa 7.8 implements the OpenGL 2.1 API, but the version reported by +glGetString(GL_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 2.1. +

    +

    +See the Compiling/Installing page for prerequisites +for DRI hardware acceleration. +

    + + +

    MD5 checksums

    +
    +tbd
    +
    + + +

    New features

    +
      +
    • TBD +
    + + +

    Bug fixes

    +
      +
    • TBD +
    + + +

    Changes

    +
      +
    • TBD +
    + + + diff --git a/docs/relnotes.html b/docs/relnotes.html index b301ee046a..d0d9b6e5b9 100644 --- a/docs/relnotes.html +++ b/docs/relnotes.html @@ -13,6 +13,7 @@ The release notes summarize what's new or changed in each Mesa release.

      +
    • 7.8 release notes
    • 7.7 release notes
    • 7.6.1 release notes
    • 7.6 release notes -- cgit v1.2.3 From c5add6a46899b87b3f338288cf9744160cf7c464 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 18 Nov 2009 11:32:55 -0500 Subject: docs: Add note about r600 --- docs/relnotes-7.6.1.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 7a809a0c41..5615ed6e08 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -34,6 +34,7 @@ tbd
      • Upgraded GL/glext.h to version 56, GL/glxext.h to version 25, GL/wglext.h to version 17 +
      • New 3D driver, r600, for Radeon R6xx, R7xx hardware
      -- cgit v1.2.3 From 2a1505b42e30eeae20624bd24386198a8d867357 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 09:01:48 -0700 Subject: docs: remove VC6/7 project file info --- docs/README.WIN32 | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'docs') diff --git a/docs/README.WIN32 b/docs/README.WIN32 index 97e1ffb7a7..204b8e6604 100644 --- a/docs/README.WIN32 +++ b/docs/README.WIN32 @@ -27,12 +27,6 @@ using the SDK with Visual Studio Express can be found at http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ -If you are stuck using VC6 or VC7, you may start with these project -files, but you may need to modify them to reflect changes in the -Mesa source code tree. If you sucessfully update the project files, -please submit them to the author of this document so that they may -be included in the next distribution. - The project files to build the core Mesa library, Windows Mesa drivers, OSMesa, and GLU are in the mesa directory. The project files to build GLUT and some demo programs are in the progs directory. @@ -106,23 +100,6 @@ should build all the demos. Build System Notes ----- ------ ----- -VC6 (not actively supported) ---- - -Visual Studio 6 does not recognize files with the .cc extension as C++ -language files, without a lot of unnatural tweaking. So, the VC6 -build process uses custom build steps to compile these files in the -GLU library. - -Two additional configurations are provided, Debug x86 and Release x86 -that activate the shader code compilation by defining SLANG_86. It is -unknown if and how this works. - -VC7 (not actively supported) ---- - -The above-mentioned .cc problem does not exist in this version. - VC8 --- -- cgit v1.2.3 From e16b59df42131452633742a03694bd5132a8895e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 09:07:17 -0700 Subject: docs: update news file for 7.6.1 release --- docs/news.html | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs') diff --git a/docs/news.html b/docs/news.html index 93da56a5c3..2abec2e635 100644 --- a/docs/news.html +++ b/docs/news.html @@ -10,6 +10,13 @@

      News

      +

      November XX, 2009

      +

      +Mesa 7.6.1 is released. This is a bug-fix +release fixing issues found in the 7.6 release. +

      + +

      September 28, 2009

      Mesa 7.6 is released. This is a new feature -- cgit v1.2.3 From 5117725fd0eee7dbd5708bdbbd066bc89c2d35a9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 09:07:34 -0700 Subject: docs: removed VC6/7 project files --- docs/relnotes-7.6.1.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 5615ed6e08..14f9077d9e 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -56,5 +56,11 @@ tbd

    • Fixed clipping / provoking vertex bugs in i965 driver.
    +

    Changes

    +
      +
    • Removed old VC6, VC7 project files for Windows +
    + + -- cgit v1.2.3 From 3128d65fd7da9dc9b7a6823fae9d9b2ca33afca6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 09:35:01 -0700 Subject: docs: document fixes for AIX --- docs/relnotes-7.6.1.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 14f9077d9e..3d19c6cb70 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -54,6 +54,7 @@ tbd
  • Fixed glBitmap bugs in Intel drivers.
  • Fixed a number of Microsoft Visual Studio compilation problems.
  • Fixed clipping / provoking vertex bugs in i965 driver. +
  • Assorted build fixes for AIX.

    Changes

    -- cgit v1.2.3 From 601edbef172f3106b9e4c0b96b24d8b5eea8d2a5 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Mon, 23 Nov 2009 19:33:59 +0100 Subject: Fix the DRI swrast driver for big endian platforms. Too bad I didn't realize earlier how easy this could be... Fixes http://bugs.freedesktop.org/show_bug.cgi?id=22767 . --- docs/relnotes-7.6.1.html | 1 + src/mesa/drivers/dri/swrast/swrast_span.c | 72 +++++++++++++------------------ 2 files changed, 30 insertions(+), 43 deletions(-) (limited to 'docs') diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 3d19c6cb70..d155cf5a67 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -55,6 +55,7 @@ tbd
  • Fixed a number of Microsoft Visual Studio compilation problems.
  • Fixed clipping / provoking vertex bugs in i965 driver.
  • Assorted build fixes for AIX. +
  • Endianness fixes for the DRI swrast driver (bug 22767).
  • Changes

    diff --git a/src/mesa/drivers/dri/swrast/swrast_span.c b/src/mesa/drivers/dri/swrast/swrast_span.c index 2d3c25dcbe..f8e503463f 100644 --- a/src/mesa/drivers/dri/swrast/swrast_span.c +++ b/src/mesa/drivers/dri/swrast/swrast_span.c @@ -63,56 +63,42 @@ static const GLubyte kernel[16] = { /* 32-bit BGRA */ #define STORE_PIXEL_A8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = VALUE[ACOMP]; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = VALUE[ACOMP] << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define STORE_PIXEL_RGB_A8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = 0xff; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = 0xff << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define FETCH_PIXEL_A8R8G8B8(DST, SRC) \ - DST[ACOMP] = SRC[3]; \ - DST[RCOMP] = SRC[2]; \ - DST[GCOMP] = SRC[1]; \ - DST[BCOMP] = SRC[0] + DST[ACOMP] = *SRC >> 24; \ + DST[RCOMP] = (*SRC >> 16) & 0xff; \ + DST[GCOMP] = (*SRC >> 8) & 0xff; \ + DST[BCOMP] = *SRC & 0xff /* 32-bit BGRX */ #define STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = 0xff; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = 0xff << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = 0xff; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = 0xff << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define FETCH_PIXEL_X8R8G8B8(DST, SRC) \ - DST[ACOMP] = 0xff; \ - DST[RCOMP] = SRC[2]; \ - DST[GCOMP] = SRC[1]; \ - DST[BCOMP] = SRC[0] + DST[ACOMP] = 0xff; \ + DST[RCOMP] = (*SRC >> 16) & 0xff; \ + DST[GCOMP] = (*SRC >> 8) & 0xff; \ + DST[BCOMP] = *SRC & 0xff /* 16-bit BGR */ #define STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) \ do { \ int d = DITHER_COMP(X, Y) >> 6; \ - GLushort *p = (GLushort *)DST; \ - *p = ( ((DITHER_CLAMP((VALUE[RCOMP]) + d) & 0xf8) << 8) | \ - ((DITHER_CLAMP((VALUE[GCOMP]) + d) & 0xfc) << 3) | \ - ((DITHER_CLAMP((VALUE[BCOMP]) + d) & 0xf8) >> 3) ); \ + *DST = ( ((DITHER_CLAMP((VALUE[RCOMP]) + d) & 0xf8) << 8) | \ + ((DITHER_CLAMP((VALUE[GCOMP]) + d) & 0xfc) << 3) | \ + ((DITHER_CLAMP((VALUE[BCOMP]) + d) & 0xf8) >> 3) ); \ } while(0) #define FETCH_PIXEL_R5G6B5(DST, SRC) \ do { \ - GLushort p = *(GLushort *)SRC; \ DST[ACOMP] = 0xff; \ - DST[RCOMP] = ((p >> 8) & 0xf8) * 255 / 0xf8; \ - DST[GCOMP] = ((p >> 3) & 0xfc) * 255 / 0xfc; \ - DST[BCOMP] = ((p << 3) & 0xf8) * 255 / 0xf8; \ + DST[RCOMP] = ((*SRC >> 8) & 0xf8) * 255 / 0xf8; \ + DST[GCOMP] = ((*SRC >> 3) & 0xfc) * 255 / 0xfc; \ + DST[BCOMP] = ((*SRC << 3) & 0xf8) * 255 / 0xf8; \ } while(0) @@ -145,8 +131,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X) * 4; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch / 4 + (X) +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_A8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -163,8 +149,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X) * 4; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch / 4 + (X); +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -181,8 +167,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X) * 2; -#define INC_PIXEL_PTR(P) P += 2 + GLushort *P = (GLushort *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch / 2 + (X); +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) #define FETCH_PIXEL(DST, SRC) \ @@ -234,8 +220,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)row; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)row; +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_A8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -252,8 +238,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)row; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)row; +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -270,7 +256,7 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)row; + GLushort *P = (GLushort *)row; #define INC_PIXEL_PTR(P) P += 2 #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) -- cgit v1.2.3