Compare commits
46 Commits
mesa_7_4_r
...
intel_2009
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85396d8ef4 | ||
|
|
f11b84998d | ||
|
|
d2f6791062 | ||
|
|
49e0c74ddd | ||
|
|
83e14773c5 | ||
|
|
4605937843 | ||
|
|
b8ef30c45c | ||
|
|
4f17040cb1 | ||
|
|
98c2c9ef8c | ||
|
|
d805c82068 | ||
|
|
6c3bec4387 | ||
|
|
7d3561c871 | ||
|
|
5c47d53924 | ||
|
|
a18216308a | ||
|
|
14f13fbcfa | ||
|
|
ca24095c1e | ||
|
|
d5e0e03d43 | ||
|
|
775ca8e3fa | ||
|
|
39345a4928 | ||
|
|
7be149cfd1 | ||
|
|
8c9d7b2474 | ||
|
|
6ef0951b17 | ||
|
|
2b33b77337 | ||
|
|
0590edeea0 | ||
|
|
7511d76bd7 | ||
|
|
7f30aba920 | ||
|
|
4fa700260e | ||
|
|
781fb79c59 | ||
|
|
5b7e9f2f3a | ||
|
|
d4d4b63d7f | ||
|
|
9e9fe51acd | ||
|
|
b65bc1b6cb | ||
|
|
6cb796f6fc | ||
|
|
de197cf991 | ||
|
|
bf1e6581a5 | ||
|
|
80ec7843bc | ||
|
|
366d6e8cd1 | ||
|
|
63ed288396 | ||
|
|
88ce34f400 | ||
|
|
f535de8721 | ||
|
|
1db913f687 | ||
|
|
0e5d1f43af | ||
|
|
09c587ae55 | ||
|
|
775d8431e9 | ||
|
|
3217ea8a1d | ||
|
|
00aea5853d |
2
Makefile
2
Makefile
@@ -174,7 +174,7 @@ ultrix-gcc:
|
|||||||
|
|
||||||
# Rules for making release tarballs
|
# Rules for making release tarballs
|
||||||
|
|
||||||
VERSION=7.4-rc2
|
VERSION=7.4
|
||||||
DIRECTORY = Mesa-$(VERSION)
|
DIRECTORY = Mesa-$(VERSION)
|
||||||
LIB_NAME = MesaLib-$(VERSION)
|
LIB_NAME = MesaLib-$(VERSION)
|
||||||
DEMO_NAME = MesaDemos-$(VERSION)
|
DEMO_NAME = MesaDemos-$(VERSION)
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ CONFIG_NAME = darwin
|
|||||||
|
|
||||||
INSTALL_DIR = /usr/X11
|
INSTALL_DIR = /usr/X11
|
||||||
|
|
||||||
|
X11_DIR = $(INSTALL_DIR)
|
||||||
|
|
||||||
# Compiler and flags
|
# Compiler and flags
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = gcc
|
CXX = gcc
|
||||||
@@ -21,9 +23,9 @@ DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
|
|||||||
ARCH_FLAGS += $(RC_CFLAGS)
|
ARCH_FLAGS += $(RC_CFLAGS)
|
||||||
|
|
||||||
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \
|
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \
|
||||||
-I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
|
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
|
||||||
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \
|
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \
|
||||||
-I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
|
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
|
||||||
|
|
||||||
# Library names (actual file names)
|
# Library names (actual file names)
|
||||||
GL_LIB_NAME = libGL.dylib
|
GL_LIB_NAME = libGL.dylib
|
||||||
@@ -39,12 +41,12 @@ GLUT_LIB_GLOB = libglut.*dylib
|
|||||||
GLW_LIB_GLOB = libGLw.*dylib
|
GLW_LIB_GLOB = libGLw.*dylib
|
||||||
OSMESA_LIB_GLOB = libOSMesa.*dylib
|
OSMESA_LIB_GLOB = libOSMesa.*dylib
|
||||||
|
|
||||||
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
|
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
|
||||||
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
|
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
|
||||||
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
|
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
|
||||||
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
|
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
|
||||||
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXt
|
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
|
||||||
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
|
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
|
||||||
|
|
||||||
# omit glw lib for now:
|
# omit glw lib for now:
|
||||||
SRC_DIRS = glx/x11 mesa glu glut/glx
|
SRC_DIRS = glx/x11 mesa glu glut/glx
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<H1>News</H1>
|
<H1>News</H1>
|
||||||
|
|
||||||
|
|
||||||
<h2>March ??, 2009</h2>
|
<h2>March 27, 2009</h2>
|
||||||
<p>
|
<p>
|
||||||
<a href="relnotes-7.4.html">Mesa 7.4</a> is released.
|
<a href="relnotes-7.4.html">Mesa 7.4</a> is released.
|
||||||
This is a stable release fixing bugs since the 7.3 release.
|
This is a stable release fixing bugs since the 7.3 release.
|
||||||
|
|||||||
79
docs/relnotes-7.4.1.html
Normal file
79
docs/relnotes-7.4.1.html
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<HTML>
|
||||||
|
|
||||||
|
<TITLE>Mesa Release Notes</TITLE>
|
||||||
|
|
||||||
|
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||||
|
|
||||||
|
<BODY>
|
||||||
|
|
||||||
|
<body bgcolor="#eeeeee">
|
||||||
|
|
||||||
|
<H1>Mesa 7.4.1 Release Notes / (date TBD)</H1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Mesa 7.4.1 is a stable development release fixing bugs since the 7.4 release.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Mesa 7.4.1 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.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||||
|
for DRI ardware acceleration.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>MD5 checksums</h2>
|
||||||
|
<pre>
|
||||||
|
tbd
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>New features</h2>
|
||||||
|
<ul>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Bug fixes</h2>
|
||||||
|
<ul>
|
||||||
|
<li>Fixed a two-sided lighting bug in fixed-function-to-GPU code generation
|
||||||
|
<li>Fixed some Darwin issues (Jeremy Huddleston)
|
||||||
|
<li>Indexing the GLSL gl_EyePlane[] or gl_ObjectPlane[] arrays with a variable
|
||||||
|
was broken, bug 20986
|
||||||
|
<li>Fixed incorrect texture unit bias in TXB instruction
|
||||||
|
<li>glTexParameter settings weren't always propogated to drivers
|
||||||
|
<li>Assorted vertex/fragment program bug fixes
|
||||||
|
<li>Fixed point rendering in software rasterizer
|
||||||
|
<li>Fixed potential deadlock in object hash functions
|
||||||
|
<li>Fix a couple bugs surrounding front-buffer rendering with DRI2, but this
|
||||||
|
is not quite complete.
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Changes</h2>
|
||||||
|
<ul>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Driver Status</h2>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
Driver Status
|
||||||
|
---------------------- ----------------------
|
||||||
|
DRI drivers varies with the driver
|
||||||
|
XMesa/GLX (on Xlib) implements OpenGL 2.1
|
||||||
|
OSMesa (off-screen) implements OpenGL 2.1
|
||||||
|
Windows/Win32 implements OpenGL 2.1
|
||||||
|
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
|
||||||
|
SVGA unsupported
|
||||||
|
Wind River UGL unsupported
|
||||||
|
DJGPP unsupported
|
||||||
|
GGI unsupported
|
||||||
|
BeOS unsupported
|
||||||
|
Allegro unsupported
|
||||||
|
D3D unsupported
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<body bgcolor="#eeeeee">
|
<body bgcolor="#eeeeee">
|
||||||
|
|
||||||
<H1>Mesa 7.4 Release Notes / date TBD</H1>
|
<H1>Mesa 7.4 Release Notes / 27 March 2009</H1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Mesa 7.4 is a stable development release fixing bugs since the 7.3 release.
|
Mesa 7.4 is a stable development release fixing bugs since the 7.3 release.
|
||||||
@@ -26,7 +26,15 @@ for DRI ardware acceleration.
|
|||||||
|
|
||||||
<h2>MD5 checksums</h2>
|
<h2>MD5 checksums</h2>
|
||||||
<pre>
|
<pre>
|
||||||
tbd
|
ed6bd7437177307e51e16d0c7c381dfa MesaLib-7.4.tar.gz
|
||||||
|
7ecddb341a2691e0dfdb02f697109834 MesaLib-7.4.tar.bz2
|
||||||
|
433e823f8245f9fd5f397e7b719a8e47 MesaLib-7.4.zip
|
||||||
|
656eee6128016fb237e01aa8dabbc703 MesaDemos-7.4.tar.gz
|
||||||
|
02816f10f30b1dc5e069e0f68c177c98 MesaDemos-7.4.tar.bz2
|
||||||
|
44a70d6db4aa4c64ecc47871b6aceee8 MesaDemos-7.4.zip
|
||||||
|
25f80db4f8645cd3e58e2c9af53ec341 MesaGLUT-7.4.tar.gz
|
||||||
|
04ec01caebde44f5b0d619f00716b368 MesaGLUT-7.4.tar.bz2
|
||||||
|
019dc213baecaa3cb1278847d41b8591 MesaGLUT-7.4.zip
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
@@ -53,6 +61,7 @@ tbd
|
|||||||
<h2>Changes</h2>
|
<h2>Changes</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Updated GL/glxext.h to version 48
|
<li>Updated GL/glxext.h to version 48
|
||||||
|
<li>Assorted updates for building on Solaris
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ The release notes summarize what's new or changed in each Mesa release.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<UL>
|
<UL>
|
||||||
|
<LI><A HREF="relnotes-7.4.1.html">7.4.1 release notes</A>
|
||||||
<LI><A HREF="relnotes-7.4.html">7.4 release notes</A>
|
<LI><A HREF="relnotes-7.4.html">7.4 release notes</A>
|
||||||
<LI><A HREF="relnotes-7.3.html">7.3 release notes</A>
|
<LI><A HREF="relnotes-7.3.html">7.3 release notes</A>
|
||||||
<LI><A HREF="relnotes-7.2.html">7.2 release notes</A>
|
<LI><A HREF="relnotes-7.2.html">7.2 release notes</A>
|
||||||
|
|||||||
@@ -636,7 +636,7 @@ struct __DRIbufferRec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
|
#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
|
||||||
#define __DRI_DRI2_LOADER_VERSION 1
|
#define __DRI_DRI2_LOADER_VERSION 2
|
||||||
struct __DRIdri2LoaderExtensionRec {
|
struct __DRIdri2LoaderExtensionRec {
|
||||||
__DRIextension base;
|
__DRIextension base;
|
||||||
|
|
||||||
@@ -644,6 +644,19 @@ struct __DRIdri2LoaderExtensionRec {
|
|||||||
int *width, int *height,
|
int *width, int *height,
|
||||||
unsigned int *attachments, int count,
|
unsigned int *attachments, int count,
|
||||||
int *out_count, void *loaderPrivate);
|
int *out_count, void *loaderPrivate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flush pending front-buffer rendering
|
||||||
|
*
|
||||||
|
* Any rendering that has been performed to the
|
||||||
|
* \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
|
||||||
|
* \c __DRI_BUFFER_FRONT_LEFT.
|
||||||
|
*
|
||||||
|
* \param driDrawable Drawable whose front-buffer is to be flushed
|
||||||
|
* \param loaderPrivate Loader's private data that was previously passed
|
||||||
|
* into __DRIdri2ExtensionRec::createNewDrawable
|
||||||
|
*/
|
||||||
|
void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ DRI2Buffer *DRI2GetBuffers(Display *dpy, XID drawable,
|
|||||||
*height = rep.height;
|
*height = rep.height;
|
||||||
*outCount = rep.count;
|
*outCount = rep.count;
|
||||||
|
|
||||||
buffers = Xmalloc(count * sizeof buffers[0]);
|
buffers = Xmalloc(rep.count * sizeof buffers[0]);
|
||||||
if (buffers == NULL) {
|
if (buffers == NULL) {
|
||||||
_XEatData(dpy, rep.count * sizeof repBuffer);
|
_XEatData(dpy, rep.count * sizeof repBuffer);
|
||||||
UnlockDisplay(dpy);
|
UnlockDisplay(dpy);
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ struct __GLXDRIdrawablePrivateRec {
|
|||||||
int bufferCount;
|
int bufferCount;
|
||||||
int width, height;
|
int width, height;
|
||||||
int have_back;
|
int have_back;
|
||||||
int have_front;
|
|
||||||
int have_fake_front;
|
int have_fake_front;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -195,7 +194,7 @@ static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw,
|
|||||||
XserverRegion region;
|
XserverRegion region;
|
||||||
|
|
||||||
/* Check we have the right attachments */
|
/* Check we have the right attachments */
|
||||||
if (!(priv->have_front && priv->have_back))
|
if (!priv->have_back)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xrect.x = x;
|
xrect.x = x;
|
||||||
@@ -223,7 +222,7 @@ static void dri2WaitX(__GLXDRIdrawable *pdraw)
|
|||||||
XserverRegion region;
|
XserverRegion region;
|
||||||
|
|
||||||
/* Check we have the right attachments */
|
/* Check we have the right attachments */
|
||||||
if (!(priv->have_fake_front && priv->have_front))
|
if (!priv->have_fake_front)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xrect.x = 0;
|
xrect.x = 0;
|
||||||
@@ -243,7 +242,7 @@ static void dri2WaitGL(__GLXDRIdrawable *pdraw)
|
|||||||
XRectangle xrect;
|
XRectangle xrect;
|
||||||
XserverRegion region;
|
XserverRegion region;
|
||||||
|
|
||||||
if (!(priv->have_fake_front && priv->have_front))
|
if (!priv->have_fake_front)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xrect.x = 0;
|
xrect.x = 0;
|
||||||
@@ -257,6 +256,15 @@ static void dri2WaitGL(__GLXDRIdrawable *pdraw)
|
|||||||
XFixesDestroyRegion(pdraw->psc->dpy, region);
|
XFixesDestroyRegion(pdraw->psc->dpy, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void dri2FlushFrontBuffer(__DRIdrawable *driDrawable,
|
||||||
|
void *loaderPrivate)
|
||||||
|
{
|
||||||
|
(void) driDrawable;
|
||||||
|
dri2WaitGL((__GLXDRIdrawable *) loaderPrivate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void dri2DestroyScreen(__GLXscreenConfigs *psc)
|
static void dri2DestroyScreen(__GLXscreenConfigs *psc)
|
||||||
{
|
{
|
||||||
/* Free the direct rendering per screen data */
|
/* Free the direct rendering per screen data */
|
||||||
@@ -283,7 +291,6 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
|
|||||||
pdraw->width = *width;
|
pdraw->width = *width;
|
||||||
pdraw->height = *height;
|
pdraw->height = *height;
|
||||||
pdraw->bufferCount = *out_count;
|
pdraw->bufferCount = *out_count;
|
||||||
pdraw->have_front = 0;
|
|
||||||
pdraw->have_fake_front = 0;
|
pdraw->have_fake_front = 0;
|
||||||
pdraw->have_back = 0;
|
pdraw->have_back = 0;
|
||||||
|
|
||||||
@@ -295,8 +302,6 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
|
|||||||
pdraw->buffers[i].pitch = buffers[i].pitch;
|
pdraw->buffers[i].pitch = buffers[i].pitch;
|
||||||
pdraw->buffers[i].cpp = buffers[i].cpp;
|
pdraw->buffers[i].cpp = buffers[i].cpp;
|
||||||
pdraw->buffers[i].flags = buffers[i].flags;
|
pdraw->buffers[i].flags = buffers[i].flags;
|
||||||
if (pdraw->buffers[i].attachment == __DRI_BUFFER_FRONT_LEFT)
|
|
||||||
pdraw->have_front = 1;
|
|
||||||
if (pdraw->buffers[i].attachment == __DRI_BUFFER_FAKE_FRONT_LEFT)
|
if (pdraw->buffers[i].attachment == __DRI_BUFFER_FAKE_FRONT_LEFT)
|
||||||
pdraw->have_fake_front = 1;
|
pdraw->have_fake_front = 1;
|
||||||
if (pdraw->buffers[i].attachment == __DRI_BUFFER_BACK_LEFT)
|
if (pdraw->buffers[i].attachment == __DRI_BUFFER_BACK_LEFT)
|
||||||
@@ -311,6 +316,7 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
|
|||||||
static const __DRIdri2LoaderExtension dri2LoaderExtension = {
|
static const __DRIdri2LoaderExtension dri2LoaderExtension = {
|
||||||
{ __DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION },
|
{ __DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION },
|
||||||
dri2GetBuffers,
|
dri2GetBuffers,
|
||||||
|
dri2FlushFrontBuffer
|
||||||
};
|
};
|
||||||
|
|
||||||
static const __DRIextension *loader_extensions[] = {
|
static const __DRIextension *loader_extensions[] = {
|
||||||
|
|||||||
@@ -1702,7 +1702,8 @@ PUBLIC GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
*nelements = 0;
|
*nelements = 0;
|
||||||
if ( (priv->screenConfigs != NULL)
|
if ( priv
|
||||||
|
&& (priv->screenConfigs != NULL)
|
||||||
&& (screen >= 0) && (screen <= ScreenCount(dpy))
|
&& (screen >= 0) && (screen <= ScreenCount(dpy))
|
||||||
&& (priv->screenConfigs[screen].configs != NULL)
|
&& (priv->screenConfigs[screen].configs != NULL)
|
||||||
&& (priv->screenConfigs[screen].configs->fbconfigID != GLX_DONT_CARE) ) {
|
&& (priv->screenConfigs[screen].configs->fbconfigID != GLX_DONT_CARE) ) {
|
||||||
|
|||||||
@@ -5198,9 +5198,13 @@ glDeleteTexturesEXT(GLsizei n, const GLuint * textures)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_DeleteTextures(GET_DISPATCH(), (n, textures));
|
CALL_DeleteTextures(GET_DISPATCH(), (n, textures));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
|
const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
|
||||||
@@ -5266,9 +5270,13 @@ glGenTexturesEXT(GLsizei n, GLuint * textures)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GenTextures(GET_DISPATCH(), (n, textures));
|
CALL_GenTextures(GET_DISPATCH(), (n, textures));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
const GLuint cmdlen = 4;
|
const GLuint cmdlen = 4;
|
||||||
@@ -5328,9 +5336,13 @@ glIsTextureEXT(GLuint texture)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
return CALL_IsTexture(GET_DISPATCH(), (texture));
|
return CALL_IsTexture(GET_DISPATCH(), (texture));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
GLboolean retval = (GLboolean) 0;
|
GLboolean retval = (GLboolean) 0;
|
||||||
@@ -5641,9 +5653,13 @@ glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table));
|
CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
const __GLXattribute *const state = gc->client_state_private;
|
const __GLXattribute *const state = gc->client_state_private;
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
@@ -5714,10 +5730,14 @@ glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetColorTableParameterfv(GET_DISPATCH(),
|
CALL_GetColorTableParameterfv(GET_DISPATCH(),
|
||||||
(target, pname, params));
|
(target, pname, params));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
const GLuint cmdlen = 8;
|
const GLuint cmdlen = 8;
|
||||||
@@ -5784,10 +5804,14 @@ glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetColorTableParameteriv(GET_DISPATCH(),
|
CALL_GetColorTableParameteriv(GET_DISPATCH(),
|
||||||
(target, pname, params));
|
(target, pname, params));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
const GLuint cmdlen = 8;
|
const GLuint cmdlen = 8;
|
||||||
@@ -6107,10 +6131,14 @@ gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type,
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetConvolutionFilter(GET_DISPATCH(),
|
CALL_GetConvolutionFilter(GET_DISPATCH(),
|
||||||
(target, format, type, image));
|
(target, format, type, image));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
const __GLXattribute *const state = gc->client_state_private;
|
const __GLXattribute *const state = gc->client_state_private;
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
@@ -6182,10 +6210,14 @@ gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetConvolutionParameterfv(GET_DISPATCH(),
|
CALL_GetConvolutionParameterfv(GET_DISPATCH(),
|
||||||
(target, pname, params));
|
(target, pname, params));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
const GLuint cmdlen = 8;
|
const GLuint cmdlen = 8;
|
||||||
@@ -6252,10 +6284,14 @@ gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetConvolutionParameteriv(GET_DISPATCH(),
|
CALL_GetConvolutionParameteriv(GET_DISPATCH(),
|
||||||
(target, pname, params));
|
(target, pname, params));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
const GLuint cmdlen = 8;
|
const GLuint cmdlen = 8;
|
||||||
@@ -6329,10 +6365,14 @@ gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format,
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetHistogram(GET_DISPATCH(),
|
CALL_GetHistogram(GET_DISPATCH(),
|
||||||
(target, reset, format, type, values));
|
(target, reset, format, type, values));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
const __GLXattribute *const state = gc->client_state_private;
|
const __GLXattribute *const state = gc->client_state_private;
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
@@ -6403,9 +6443,13 @@ gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params));
|
CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
const GLuint cmdlen = 8;
|
const GLuint cmdlen = 8;
|
||||||
@@ -6471,9 +6515,13 @@ gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params));
|
CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
const GLuint cmdlen = 8;
|
const GLuint cmdlen = 8;
|
||||||
@@ -6543,9 +6591,13 @@ gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format,
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values));
|
CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
const __GLXattribute *const state = gc->client_state_private;
|
const __GLXattribute *const state = gc->client_state_private;
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
@@ -6614,9 +6666,13 @@ gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params));
|
CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
const GLuint cmdlen = 8;
|
const GLuint cmdlen = 8;
|
||||||
@@ -6679,9 +6735,13 @@ gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params)
|
|||||||
{
|
{
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
|
|
||||||
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext) {
|
if (gc->driContext) {
|
||||||
CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params));
|
CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params));
|
||||||
} else {
|
} else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
__GLXcontext *const gc = __glXGetCurrentContext();
|
__GLXcontext *const gc = __glXGetCurrentContext();
|
||||||
Display *const dpy = gc->currentDpy;
|
Display *const dpy = gc->currentDpy;
|
||||||
const GLuint cmdlen = 8;
|
const GLuint cmdlen = 8;
|
||||||
|
|||||||
@@ -59,37 +59,6 @@ static GLboolean have_attr(struct brw_sf_compile *c,
|
|||||||
return (c->key.attrs & (1<<attr)) ? 1 : 0;
|
return (c->key.attrs & (1<<attr)) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets VERT_RESULT_FOGC.Y for gl_FrontFacing
|
|
||||||
*
|
|
||||||
* This is currently executed if the fragment program uses VERT_RESULT_FOGC
|
|
||||||
* at all, but this could be eliminated with a scan of the FP contents.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
do_front_facing( struct brw_sf_compile *c )
|
|
||||||
{
|
|
||||||
struct brw_compile *p = &c->func;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (!have_attr(c, VERT_RESULT_FOGC))
|
|
||||||
return;
|
|
||||||
|
|
||||||
brw_push_insn_state(p);
|
|
||||||
brw_CMP(p, brw_null_reg(),
|
|
||||||
c->key.frontface_ccw ? BRW_CONDITIONAL_G : BRW_CONDITIONAL_L,
|
|
||||||
c->det, brw_imm_f(0));
|
|
||||||
brw_set_predicate_control(p, BRW_PREDICATE_NONE);
|
|
||||||
for (i = 0; i < 3; i++) {
|
|
||||||
struct brw_reg fogc = get_vert_attr(c, c->vert[i],FRAG_ATTRIB_FOGC);
|
|
||||||
brw_MOV(p, get_element(fogc, 1), brw_imm_f(0));
|
|
||||||
brw_set_predicate_control(p, BRW_PREDICATE_NORMAL);
|
|
||||||
brw_MOV(p, get_element(fogc, 1), brw_imm_f(1));
|
|
||||||
brw_set_predicate_control(p, BRW_PREDICATE_NONE);
|
|
||||||
}
|
|
||||||
brw_pop_insn_state(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Twoside lighting
|
* Twoside lighting
|
||||||
*/
|
*/
|
||||||
@@ -384,7 +353,6 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate)
|
|||||||
|
|
||||||
invert_det(c);
|
invert_det(c);
|
||||||
copy_z_inv_w(c);
|
copy_z_inv_w(c);
|
||||||
do_front_facing(c);
|
|
||||||
|
|
||||||
if (c->key.do_twoside_color)
|
if (c->key.do_twoside_color)
|
||||||
do_twoside_color(c);
|
do_twoside_color(c);
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
GLuint brw_wm_nr_args( GLuint opcode )
|
GLuint brw_wm_nr_args( GLuint opcode )
|
||||||
{
|
{
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
|
case WM_FRONTFACING:
|
||||||
|
return 0;
|
||||||
case WM_PIXELXY:
|
case WM_PIXELXY:
|
||||||
case WM_CINTERP:
|
case WM_CINTERP:
|
||||||
case WM_WPOSXY:
|
case WM_WPOSXY:
|
||||||
|
|||||||
@@ -172,7 +172,8 @@ struct brw_wm_instruction {
|
|||||||
#define WM_CINTERP (MAX_OPCODE + 5)
|
#define WM_CINTERP (MAX_OPCODE + 5)
|
||||||
#define WM_WPOSXY (MAX_OPCODE + 6)
|
#define WM_WPOSXY (MAX_OPCODE + 6)
|
||||||
#define WM_FB_WRITE (MAX_OPCODE + 7)
|
#define WM_FB_WRITE (MAX_OPCODE + 7)
|
||||||
#define MAX_WM_OPCODE (MAX_OPCODE + 8)
|
#define WM_FRONTFACING (MAX_OPCODE + 8)
|
||||||
|
#define MAX_WM_OPCODE (MAX_OPCODE + 9)
|
||||||
|
|
||||||
#define PROGRAM_PAYLOAD (PROGRAM_FILE_MAX)
|
#define PROGRAM_PAYLOAD (PROGRAM_FILE_MAX)
|
||||||
#define PAYLOAD_DEPTH (FRAG_ATTRIB_MAX)
|
#define PAYLOAD_DEPTH (FRAG_ATTRIB_MAX)
|
||||||
|
|||||||
@@ -130,6 +130,9 @@ void brw_wm_print_insn( struct brw_wm_compile *c,
|
|||||||
case WM_FB_WRITE:
|
case WM_FB_WRITE:
|
||||||
_mesa_printf(" = FB_WRITE");
|
_mesa_printf(" = FB_WRITE");
|
||||||
break;
|
break;
|
||||||
|
case WM_FRONTFACING:
|
||||||
|
_mesa_printf(" = FRONTFACING");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
_mesa_printf(" = %s", _mesa_opcode_string(inst->opcode));
|
_mesa_printf(" = %s", _mesa_opcode_string(inst->opcode));
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -254,6 +254,34 @@ static void emit_cinterp( struct brw_compile *p,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Sets the destination channels to 1.0 or 0.0 according to glFrontFacing. */
|
||||||
|
static void emit_frontfacing( struct brw_compile *p,
|
||||||
|
const struct brw_reg *dst,
|
||||||
|
GLuint mask )
|
||||||
|
{
|
||||||
|
struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD);
|
||||||
|
GLuint i;
|
||||||
|
|
||||||
|
if (!(mask & WRITEMASK_XYZW))
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0; i < 4; i++) {
|
||||||
|
if (mask & (1<<i)) {
|
||||||
|
brw_MOV(p, dst[i], brw_imm_f(0.0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* bit 31 is "primitive is back face", so checking < (1 << 31) gives
|
||||||
|
* us front face
|
||||||
|
*/
|
||||||
|
brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, r1_6ud, brw_imm_ud(1 << 31));
|
||||||
|
for (i = 0; i < 4; i++) {
|
||||||
|
if (mask & (1<<i)) {
|
||||||
|
brw_MOV(p, dst[i], brw_imm_f(1.0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
brw_set_predicate_control_flag_value(p, 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
static void emit_alu1( struct brw_compile *p,
|
static void emit_alu1( struct brw_compile *p,
|
||||||
struct brw_instruction *(*func)(struct brw_compile *,
|
struct brw_instruction *(*func)(struct brw_compile *,
|
||||||
@@ -1158,6 +1186,10 @@ void brw_wm_emit( struct brw_wm_compile *c )
|
|||||||
emit_fb_write(c, args[0], args[1], args[2], inst->target, inst->eot);
|
emit_fb_write(c, args[0], args[1], args[2], inst->target, inst->eot);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_FRONTFACING:
|
||||||
|
emit_frontfacing(p, dst, dst_flags);
|
||||||
|
break;
|
||||||
|
|
||||||
/* Straightforward arithmetic:
|
/* Straightforward arithmetic:
|
||||||
*/
|
*/
|
||||||
case OPCODE_ADD:
|
case OPCODE_ADD:
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ static const char *wm_opcode_strings[] = {
|
|||||||
"PINTERP",
|
"PINTERP",
|
||||||
"CINTERP",
|
"CINTERP",
|
||||||
"WPOSXY",
|
"WPOSXY",
|
||||||
"FB_WRITE"
|
"FB_WRITE",
|
||||||
|
"FRONTFACING",
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -180,7 +181,7 @@ static struct prog_instruction *emit_insn(struct brw_wm_compile *c,
|
|||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct prog_instruction * emit_op(struct brw_wm_compile *c,
|
static struct prog_instruction * emit_tex_op(struct brw_wm_compile *c,
|
||||||
GLuint op,
|
GLuint op,
|
||||||
struct prog_dst_register dest,
|
struct prog_dst_register dest,
|
||||||
GLuint saturate,
|
GLuint saturate,
|
||||||
@@ -206,6 +207,20 @@ static struct prog_instruction * emit_op(struct brw_wm_compile *c,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static struct prog_instruction * emit_op(struct brw_wm_compile *c,
|
||||||
|
GLuint op,
|
||||||
|
struct prog_dst_register dest,
|
||||||
|
GLuint saturate,
|
||||||
|
struct prog_src_register src0,
|
||||||
|
struct prog_src_register src1,
|
||||||
|
struct prog_src_register src2 )
|
||||||
|
{
|
||||||
|
return emit_tex_op(c, op, dest, saturate,
|
||||||
|
0, 0, /* tex unit, target */
|
||||||
|
src0, src1, src2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
@@ -227,7 +242,7 @@ static struct prog_src_register get_pixel_xy( struct brw_wm_compile *c )
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
WM_PIXELXY,
|
WM_PIXELXY,
|
||||||
dst_mask(pixel_xy, WRITEMASK_XY),
|
dst_mask(pixel_xy, WRITEMASK_XY),
|
||||||
0, 0, 0,
|
0,
|
||||||
payload_r0_depth,
|
payload_r0_depth,
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -250,7 +265,7 @@ static struct prog_src_register get_delta_xy( struct brw_wm_compile *c )
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
WM_DELTAXY,
|
WM_DELTAXY,
|
||||||
dst_mask(delta_xy, WRITEMASK_XY),
|
dst_mask(delta_xy, WRITEMASK_XY),
|
||||||
0, 0, 0,
|
0,
|
||||||
pixel_xy,
|
pixel_xy,
|
||||||
payload_r0_depth,
|
payload_r0_depth,
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -274,7 +289,7 @@ static struct prog_src_register get_pixel_w( struct brw_wm_compile *c )
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
WM_PIXELW,
|
WM_PIXELW,
|
||||||
dst_mask(pixel_w, WRITEMASK_W),
|
dst_mask(pixel_w, WRITEMASK_W),
|
||||||
0, 0, 0,
|
0,
|
||||||
interp_wpos,
|
interp_wpos,
|
||||||
deltas,
|
deltas,
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -292,24 +307,19 @@ static void emit_interp( struct brw_wm_compile *c,
|
|||||||
struct prog_dst_register dst = dst_reg(PROGRAM_INPUT, idx);
|
struct prog_dst_register dst = dst_reg(PROGRAM_INPUT, idx);
|
||||||
struct prog_src_register interp = src_reg(PROGRAM_PAYLOAD, idx);
|
struct prog_src_register interp = src_reg(PROGRAM_PAYLOAD, idx);
|
||||||
struct prog_src_register deltas = get_delta_xy(c);
|
struct prog_src_register deltas = get_delta_xy(c);
|
||||||
struct prog_src_register arg2;
|
|
||||||
GLuint opcode;
|
|
||||||
|
|
||||||
/* Need to use PINTERP on attributes which have been
|
/* Need to use PINTERP on attributes which have been
|
||||||
* multiplied by 1/W in the SF program, and LINTERP on those
|
* multiplied by 1/W in the SF program, and LINTERP on those
|
||||||
* which have not:
|
* which have not:
|
||||||
*/
|
*/
|
||||||
switch (idx) {
|
switch (idx) {
|
||||||
case FRAG_ATTRIB_WPOS:
|
case FRAG_ATTRIB_WPOS:
|
||||||
opcode = WM_LINTERP;
|
|
||||||
arg2 = src_undef();
|
|
||||||
|
|
||||||
/* Have to treat wpos.xy specially:
|
/* Have to treat wpos.xy specially:
|
||||||
*/
|
*/
|
||||||
emit_op(c,
|
emit_op(c,
|
||||||
WM_WPOSXY,
|
WM_WPOSXY,
|
||||||
dst_mask(dst, WRITEMASK_XY),
|
dst_mask(dst, WRITEMASK_XY),
|
||||||
0, 0, 0,
|
0,
|
||||||
get_pixel_xy(c),
|
get_pixel_xy(c),
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -321,10 +331,10 @@ static void emit_interp( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
WM_LINTERP,
|
WM_LINTERP,
|
||||||
dst,
|
dst,
|
||||||
0, 0, 0,
|
0,
|
||||||
interp,
|
interp,
|
||||||
deltas,
|
deltas,
|
||||||
arg2);
|
src_undef());
|
||||||
break;
|
break;
|
||||||
case FRAG_ATTRIB_COL0:
|
case FRAG_ATTRIB_COL0:
|
||||||
case FRAG_ATTRIB_COL1:
|
case FRAG_ATTRIB_COL1:
|
||||||
@@ -332,7 +342,7 @@ static void emit_interp( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
WM_CINTERP,
|
WM_CINTERP,
|
||||||
dst,
|
dst,
|
||||||
0, 0, 0,
|
0,
|
||||||
interp,
|
interp,
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -341,17 +351,67 @@ static void emit_interp( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
WM_LINTERP,
|
WM_LINTERP,
|
||||||
dst,
|
dst,
|
||||||
0, 0, 0,
|
0,
|
||||||
interp,
|
interp,
|
||||||
deltas,
|
deltas,
|
||||||
src_undef());
|
src_undef());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case FRAG_ATTRIB_FOGC:
|
||||||
|
/* The FOGC input is really special. When a program uses glFogFragCoord,
|
||||||
|
* the results returned are supposed to be (f,0,0,1). But for Mesa GLSL,
|
||||||
|
* the glFrontFacing and glPointCoord values are also stashed in FOGC.
|
||||||
|
* So, write the interpolated fog value to X, then either 0, 1, or the
|
||||||
|
* stashed values to Y, Z, W. Note that this means that
|
||||||
|
* glFogFragCoord.yzw can be wrong in those cases!
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Interpolate the fog coordinate */
|
||||||
|
emit_op(c,
|
||||||
|
WM_PINTERP,
|
||||||
|
dst_mask(dst, WRITEMASK_X),
|
||||||
|
0,
|
||||||
|
interp,
|
||||||
|
deltas,
|
||||||
|
get_pixel_w(c));
|
||||||
|
|
||||||
|
/* Move the front facing value into FOGC.y if it's needed. */
|
||||||
|
if (c->fp->program.UsesFrontFacing) {
|
||||||
|
emit_op(c,
|
||||||
|
WM_FRONTFACING,
|
||||||
|
dst_mask(dst, WRITEMASK_Y),
|
||||||
|
0,
|
||||||
|
src_undef(),
|
||||||
|
src_undef(),
|
||||||
|
src_undef());
|
||||||
|
} else {
|
||||||
|
emit_op(c,
|
||||||
|
OPCODE_MOV,
|
||||||
|
dst_mask(dst, WRITEMASK_Y),
|
||||||
|
0,
|
||||||
|
src_swizzle1(interp, SWIZZLE_ZERO),
|
||||||
|
src_undef(),
|
||||||
|
src_undef());
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Should do the PointCoord thing here. */
|
||||||
|
emit_op(c,
|
||||||
|
OPCODE_MOV,
|
||||||
|
dst_mask(dst, WRITEMASK_ZW),
|
||||||
|
0,
|
||||||
|
src_swizzle(interp,
|
||||||
|
SWIZZLE_ZERO,
|
||||||
|
SWIZZLE_ZERO,
|
||||||
|
SWIZZLE_ZERO,
|
||||||
|
SWIZZLE_ONE),
|
||||||
|
src_undef(),
|
||||||
|
src_undef());
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
emit_op(c,
|
emit_op(c,
|
||||||
WM_PINTERP,
|
WM_PINTERP,
|
||||||
dst,
|
dst,
|
||||||
0, 0, 0,
|
0,
|
||||||
interp,
|
interp,
|
||||||
deltas,
|
deltas,
|
||||||
get_pixel_w(c));
|
get_pixel_w(c));
|
||||||
@@ -371,7 +431,7 @@ static void emit_ddx( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_DDX,
|
OPCODE_DDX,
|
||||||
inst->DstReg,
|
inst->DstReg,
|
||||||
0, 0, 0,
|
0,
|
||||||
interp,
|
interp,
|
||||||
get_pixel_w(c),
|
get_pixel_w(c),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -387,7 +447,7 @@ static void emit_ddy( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_DDY,
|
OPCODE_DDY,
|
||||||
inst->DstReg,
|
inst->DstReg,
|
||||||
0, 0, 0,
|
0,
|
||||||
interp,
|
interp,
|
||||||
get_pixel_w(c),
|
get_pixel_w(c),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -482,7 +542,7 @@ static void precalc_dst( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_MUL,
|
OPCODE_MUL,
|
||||||
dst_mask(dst, WRITEMASK_Y),
|
dst_mask(dst, WRITEMASK_Y),
|
||||||
inst->SaturateMode, 0, 0,
|
inst->SaturateMode,
|
||||||
src0,
|
src0,
|
||||||
src1,
|
src1,
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -498,7 +558,7 @@ static void precalc_dst( struct brw_wm_compile *c,
|
|||||||
swz = emit_op(c,
|
swz = emit_op(c,
|
||||||
OPCODE_SWZ,
|
OPCODE_SWZ,
|
||||||
dst_mask(dst, WRITEMASK_XZ),
|
dst_mask(dst, WRITEMASK_XZ),
|
||||||
inst->SaturateMode, 0, 0,
|
inst->SaturateMode,
|
||||||
src_swizzle(src0, SWIZZLE_ONE, z, z, z),
|
src_swizzle(src0, SWIZZLE_ONE, z, z, z),
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -511,7 +571,7 @@ static void precalc_dst( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_MOV,
|
OPCODE_MOV,
|
||||||
dst_mask(dst, WRITEMASK_W),
|
dst_mask(dst, WRITEMASK_W),
|
||||||
inst->SaturateMode, 0, 0,
|
inst->SaturateMode,
|
||||||
src1,
|
src1,
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -533,7 +593,7 @@ static void precalc_lit( struct brw_wm_compile *c,
|
|||||||
swz = emit_op(c,
|
swz = emit_op(c,
|
||||||
OPCODE_SWZ,
|
OPCODE_SWZ,
|
||||||
dst_mask(dst, WRITEMASK_XW),
|
dst_mask(dst, WRITEMASK_XW),
|
||||||
0, 0, 0,
|
0,
|
||||||
src_swizzle1(src0, SWIZZLE_ONE),
|
src_swizzle1(src0, SWIZZLE_ONE),
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -546,19 +606,26 @@ static void precalc_lit( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_LIT,
|
OPCODE_LIT,
|
||||||
dst_mask(dst, WRITEMASK_YZ),
|
dst_mask(dst, WRITEMASK_YZ),
|
||||||
inst->SaturateMode, 0, 0,
|
inst->SaturateMode,
|
||||||
src0,
|
src0,
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Some TEX instructions require extra code, cube map coordinate
|
||||||
|
* normalization, or coordinate scaling for RECT textures, etc.
|
||||||
|
* This function emits those extra instructions and the TEX
|
||||||
|
* instruction itself.
|
||||||
|
*/
|
||||||
static void precalc_tex( struct brw_wm_compile *c,
|
static void precalc_tex( struct brw_wm_compile *c,
|
||||||
const struct prog_instruction *inst )
|
const struct prog_instruction *inst )
|
||||||
{
|
{
|
||||||
struct prog_src_register coord;
|
struct prog_src_register coord;
|
||||||
struct prog_dst_register tmpcoord;
|
struct prog_dst_register tmpcoord;
|
||||||
GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit];
|
const GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit];
|
||||||
|
|
||||||
if (inst->TexSrcTarget == TEXTURE_CUBE_INDEX) {
|
if (inst->TexSrcTarget == TEXTURE_CUBE_INDEX) {
|
||||||
struct prog_instruction *out;
|
struct prog_instruction *out;
|
||||||
@@ -568,49 +635,56 @@ static void precalc_tex( struct brw_wm_compile *c,
|
|||||||
struct prog_src_register tmp1src = src_reg_from_dst(tmp1);
|
struct prog_src_register tmp1src = src_reg_from_dst(tmp1);
|
||||||
struct prog_src_register src0 = inst->SrcReg[0];
|
struct prog_src_register src0 = inst->SrcReg[0];
|
||||||
|
|
||||||
|
/* find longest component of coord vector and normalize it */
|
||||||
tmpcoord = get_temp(c);
|
tmpcoord = get_temp(c);
|
||||||
coord = src_reg_from_dst(tmpcoord);
|
coord = src_reg_from_dst(tmpcoord);
|
||||||
|
|
||||||
|
/* tmpcoord = src0 (i.e.: coord = src0) */
|
||||||
out = emit_op(c, OPCODE_MOV,
|
out = emit_op(c, OPCODE_MOV,
|
||||||
tmpcoord,
|
tmpcoord,
|
||||||
0, 0, 0,
|
0,
|
||||||
src0,
|
src0,
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
out->SrcReg[0].NegateBase = 0;
|
out->SrcReg[0].NegateBase = 0;
|
||||||
out->SrcReg[0].Abs = 1;
|
out->SrcReg[0].Abs = 1;
|
||||||
|
|
||||||
|
/* tmp0 = MAX(coord.X, coord.Y) */
|
||||||
emit_op(c, OPCODE_MAX,
|
emit_op(c, OPCODE_MAX,
|
||||||
tmp0,
|
tmp0,
|
||||||
0, 0, 0,
|
0,
|
||||||
src_swizzle1(coord, X),
|
src_swizzle1(coord, X),
|
||||||
src_swizzle1(coord, Y),
|
src_swizzle1(coord, Y),
|
||||||
src_undef());
|
src_undef());
|
||||||
|
|
||||||
|
/* tmp1 = MAX(tmp0, coord.Z) */
|
||||||
emit_op(c, OPCODE_MAX,
|
emit_op(c, OPCODE_MAX,
|
||||||
tmp1,
|
tmp1,
|
||||||
0, 0, 0,
|
0,
|
||||||
tmp0src,
|
tmp0src,
|
||||||
src_swizzle1(coord, Z),
|
src_swizzle1(coord, Z),
|
||||||
src_undef());
|
src_undef());
|
||||||
|
|
||||||
|
/* tmp0 = 1 / tmp1 */
|
||||||
emit_op(c, OPCODE_RCP,
|
emit_op(c, OPCODE_RCP,
|
||||||
tmp0,
|
tmp0,
|
||||||
0, 0, 0,
|
0,
|
||||||
tmp1src,
|
tmp1src,
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
|
|
||||||
|
/* tmpCoord = src0 * tmp0 */
|
||||||
emit_op(c, OPCODE_MUL,
|
emit_op(c, OPCODE_MUL,
|
||||||
tmpcoord,
|
tmpcoord,
|
||||||
0, 0, 0,
|
0,
|
||||||
src0,
|
src0,
|
||||||
tmp0src,
|
tmp0src,
|
||||||
src_undef());
|
src_undef());
|
||||||
|
|
||||||
release_temp(c, tmp0);
|
release_temp(c, tmp0);
|
||||||
release_temp(c, tmp1);
|
release_temp(c, tmp1);
|
||||||
} else if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) {
|
}
|
||||||
|
else if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) {
|
||||||
struct prog_src_register scale =
|
struct prog_src_register scale =
|
||||||
search_or_add_param5( c,
|
search_or_add_param5( c,
|
||||||
STATE_INTERNAL,
|
STATE_INTERNAL,
|
||||||
@@ -625,7 +699,7 @@ static void precalc_tex( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_MUL,
|
OPCODE_MUL,
|
||||||
tmpcoord,
|
tmpcoord,
|
||||||
0, 0, 0,
|
0,
|
||||||
inst->SrcReg[0],
|
inst->SrcReg[0],
|
||||||
scale,
|
scale,
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -641,19 +715,9 @@ static void precalc_tex( struct brw_wm_compile *c,
|
|||||||
* conversion requires allocating a temporary variable which we
|
* conversion requires allocating a temporary variable which we
|
||||||
* don't have the facility to do that late in the compilation.
|
* don't have the facility to do that late in the compilation.
|
||||||
*/
|
*/
|
||||||
if (!(c->key.yuvtex_mask & (1<<unit))) {
|
if (c->key.yuvtex_mask & (1 << unit)) {
|
||||||
emit_op(c,
|
/* convert ycbcr to RGBA */
|
||||||
OPCODE_TEX,
|
GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<<unit);
|
||||||
inst->DstReg,
|
|
||||||
inst->SaturateMode,
|
|
||||||
unit,
|
|
||||||
inst->TexSrcTarget,
|
|
||||||
coord,
|
|
||||||
src_undef(),
|
|
||||||
src_undef());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<<unit);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
CONST C0 = { -.5, -.0625, -.5, 1.164 }
|
CONST C0 = { -.5, -.0625, -.5, 1.164 }
|
||||||
@@ -675,22 +739,22 @@ static void precalc_tex( struct brw_wm_compile *c,
|
|||||||
|
|
||||||
/* tmp = TEX ...
|
/* tmp = TEX ...
|
||||||
*/
|
*/
|
||||||
emit_op(c,
|
emit_tex_op(c,
|
||||||
OPCODE_TEX,
|
OPCODE_TEX,
|
||||||
tmp,
|
tmp,
|
||||||
inst->SaturateMode,
|
inst->SaturateMode,
|
||||||
unit,
|
unit,
|
||||||
inst->TexSrcTarget,
|
inst->TexSrcTarget,
|
||||||
coord,
|
coord,
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
|
|
||||||
/* tmp.xyz = ADD TMP, C0
|
/* tmp.xyz = ADD TMP, C0
|
||||||
*/
|
*/
|
||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_ADD,
|
OPCODE_ADD,
|
||||||
dst_mask(tmp, WRITEMASK_XYZ),
|
dst_mask(tmp, WRITEMASK_XYZ),
|
||||||
0, 0, 0,
|
0,
|
||||||
tmpsrc,
|
tmpsrc,
|
||||||
C0,
|
C0,
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -701,7 +765,7 @@ static void precalc_tex( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_MUL,
|
OPCODE_MUL,
|
||||||
dst_mask(tmp, WRITEMASK_Y),
|
dst_mask(tmp, WRITEMASK_Y),
|
||||||
0, 0, 0,
|
0,
|
||||||
tmpsrc,
|
tmpsrc,
|
||||||
src_swizzle1(C0, W),
|
src_swizzle1(C0, W),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -716,7 +780,7 @@ static void precalc_tex( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_MAD,
|
OPCODE_MAD,
|
||||||
dst_mask(dst, WRITEMASK_XYZ),
|
dst_mask(dst, WRITEMASK_XYZ),
|
||||||
0, 0, 0,
|
0,
|
||||||
swap_uv?src_swizzle(tmpsrc, Z,Z,X,X):src_swizzle(tmpsrc, X,X,Z,Z),
|
swap_uv?src_swizzle(tmpsrc, Z,Z,X,X):src_swizzle(tmpsrc, X,X,Z,Z),
|
||||||
C1,
|
C1,
|
||||||
src_swizzle1(tmpsrc, Y));
|
src_swizzle1(tmpsrc, Y));
|
||||||
@@ -726,13 +790,25 @@ static void precalc_tex( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_MAD,
|
OPCODE_MAD,
|
||||||
dst_mask(dst, WRITEMASK_Y),
|
dst_mask(dst, WRITEMASK_Y),
|
||||||
0, 0, 0,
|
0,
|
||||||
src_swizzle1(tmpsrc, Z),
|
src_swizzle1(tmpsrc, Z),
|
||||||
src_swizzle1(C1, W),
|
src_swizzle1(C1, W),
|
||||||
src_swizzle1(src_reg_from_dst(dst), Y));
|
src_swizzle1(src_reg_from_dst(dst), Y));
|
||||||
|
|
||||||
release_temp(c, tmp);
|
release_temp(c, tmp);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
/* ordinary RGBA tex instruction */
|
||||||
|
emit_tex_op(c,
|
||||||
|
OPCODE_TEX,
|
||||||
|
inst->DstReg,
|
||||||
|
inst->SaturateMode,
|
||||||
|
unit,
|
||||||
|
inst->TexSrcTarget,
|
||||||
|
coord,
|
||||||
|
src_undef(),
|
||||||
|
src_undef());
|
||||||
|
}
|
||||||
|
|
||||||
if ((inst->TexSrcTarget == TEXTURE_RECT_INDEX) ||
|
if ((inst->TexSrcTarget == TEXTURE_RECT_INDEX) ||
|
||||||
(inst->TexSrcTarget == TEXTURE_CUBE_INDEX))
|
(inst->TexSrcTarget == TEXTURE_CUBE_INDEX))
|
||||||
@@ -777,7 +853,7 @@ static void precalc_txp( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_RCP,
|
OPCODE_RCP,
|
||||||
dst_mask(tmp, WRITEMASK_W),
|
dst_mask(tmp, WRITEMASK_W),
|
||||||
0, 0, 0,
|
0,
|
||||||
src_swizzle1(src0, GET_SWZ(src0.Swizzle, W)),
|
src_swizzle1(src0, GET_SWZ(src0.Swizzle, W)),
|
||||||
src_undef(),
|
src_undef(),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -787,7 +863,7 @@ static void precalc_txp( struct brw_wm_compile *c,
|
|||||||
emit_op(c,
|
emit_op(c,
|
||||||
OPCODE_MUL,
|
OPCODE_MUL,
|
||||||
dst_mask(tmp, WRITEMASK_XYZ),
|
dst_mask(tmp, WRITEMASK_XYZ),
|
||||||
0, 0, 0,
|
0,
|
||||||
src0,
|
src0,
|
||||||
src_swizzle1(src_reg_from_dst(tmp), W),
|
src_swizzle1(src_reg_from_dst(tmp), W),
|
||||||
src_undef());
|
src_undef());
|
||||||
@@ -827,13 +903,13 @@ static void emit_fb_write( struct brw_wm_compile *c )
|
|||||||
for (i = 0 ; i < brw->state.nr_draw_regions; i++) {
|
for (i = 0 ; i < brw->state.nr_draw_regions; i++) {
|
||||||
outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DATA0 + i);
|
outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DATA0 + i);
|
||||||
last_inst = inst = emit_op(c,
|
last_inst = inst = emit_op(c,
|
||||||
WM_FB_WRITE, dst_mask(dst_undef(),0), 0, 0, 0,
|
WM_FB_WRITE, dst_mask(dst_undef(),0), 0,
|
||||||
outcolor, payload_r0_depth, outdepth);
|
outcolor, payload_r0_depth, outdepth);
|
||||||
inst->Sampler = (i<<1);
|
inst->Sampler = (i<<1);
|
||||||
if (c->fp_fragcolor_emitted) {
|
if (c->fp_fragcolor_emitted) {
|
||||||
outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR);
|
outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR);
|
||||||
last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0),
|
last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0),
|
||||||
0, 0, 0, outcolor, payload_r0_depth, outdepth);
|
0, outcolor, payload_r0_depth, outdepth);
|
||||||
inst->Sampler = (i<<1);
|
inst->Sampler = (i<<1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -847,7 +923,7 @@ static void emit_fb_write( struct brw_wm_compile *c )
|
|||||||
outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR);
|
outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR);
|
||||||
|
|
||||||
inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0),
|
inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0),
|
||||||
0, 0, 0, outcolor, payload_r0_depth, outdepth);
|
0, outcolor, payload_r0_depth, outdepth);
|
||||||
inst->Sampler = 1|(0<<1);
|
inst->Sampler = 1|(0<<1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -564,6 +564,36 @@ static void emit_pinterp(struct brw_wm_compile *c,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Sets the destination channels to 1.0 or 0.0 according to glFrontFacing. */
|
||||||
|
static void emit_frontfacing(struct brw_wm_compile *c,
|
||||||
|
struct prog_instruction *inst)
|
||||||
|
{
|
||||||
|
struct brw_compile *p = &c->func;
|
||||||
|
struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD);
|
||||||
|
struct brw_reg dst;
|
||||||
|
GLuint mask = inst->DstReg.WriteMask;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 4; i++) {
|
||||||
|
if (mask & (1<<i)) {
|
||||||
|
dst = get_dst_reg(c, inst, i, 1);
|
||||||
|
brw_MOV(p, dst, brw_imm_f(0.0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* bit 31 is "primitive is back face", so checking < (1 << 31) gives
|
||||||
|
* us front face
|
||||||
|
*/
|
||||||
|
brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, r1_6ud, brw_imm_ud(1 << 31));
|
||||||
|
for (i = 0; i < 4; i++) {
|
||||||
|
if (mask & (1<<i)) {
|
||||||
|
dst = get_dst_reg(c, inst, i, 1);
|
||||||
|
brw_MOV(p, dst, brw_imm_f(1.0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
brw_set_predicate_control_flag_value(p, 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
static void emit_xpd(struct brw_wm_compile *c,
|
static void emit_xpd(struct brw_wm_compile *c,
|
||||||
struct prog_instruction *inst)
|
struct prog_instruction *inst)
|
||||||
{
|
{
|
||||||
@@ -2342,6 +2372,9 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c)
|
|||||||
case WM_FB_WRITE:
|
case WM_FB_WRITE:
|
||||||
emit_fb_write(c, inst);
|
emit_fb_write(c, inst);
|
||||||
break;
|
break;
|
||||||
|
case WM_FRONTFACING:
|
||||||
|
emit_frontfacing(c, inst);
|
||||||
|
break;
|
||||||
case OPCODE_ABS:
|
case OPCODE_ABS:
|
||||||
emit_abs(c, inst);
|
emit_abs(c, inst);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -260,6 +260,7 @@ void brw_wm_pass1( struct brw_wm_compile *c )
|
|||||||
|
|
||||||
case OPCODE_DST:
|
case OPCODE_DST:
|
||||||
case OPCODE_TXP:
|
case OPCODE_TXP:
|
||||||
|
case WM_FRONTFACING:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,6 +204,8 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
|
|||||||
intel_batchbuffer_flush(intel->batch);
|
intel_batchbuffer_flush(intel->batch);
|
||||||
intel->front_cliprects = GL_TRUE;
|
intel->front_cliprects = GL_TRUE;
|
||||||
colorRegions[0] = intel_get_rb_region(fb, BUFFER_FRONT_LEFT);
|
colorRegions[0] = intel_get_rb_region(fb, BUFFER_FRONT_LEFT);
|
||||||
|
|
||||||
|
intel->front_buffer_dirty = GL_TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!intel->constant_cliprect && intel->front_cliprects)
|
if (!intel->constant_cliprect && intel->front_cliprects)
|
||||||
@@ -328,6 +330,12 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
|
|||||||
static void
|
static void
|
||||||
intelDrawBuffer(GLcontext * ctx, GLenum mode)
|
intelDrawBuffer(GLcontext * ctx, GLenum mode)
|
||||||
{
|
{
|
||||||
|
if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) {
|
||||||
|
struct intel_context *const intel = intel_context(ctx);
|
||||||
|
|
||||||
|
intel->is_front_buffer_rendering = (mode == GL_FRONT_LEFT);
|
||||||
|
}
|
||||||
|
|
||||||
intel_draw_buffer(ctx, ctx->DrawBuffer);
|
intel_draw_buffer(ctx, ctx->DrawBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ int INTEL_DEBUG = (0);
|
|||||||
|
|
||||||
#include "extension_helper.h"
|
#include "extension_helper.h"
|
||||||
|
|
||||||
#define DRIVER_DATE "20090316 2009Q1 RC1"
|
#define DRIVER_DATE "20090415 2009Q1 RC3"
|
||||||
#define DRIVER_DATE_GEM "GEM " DRIVER_DATE
|
#define DRIVER_DATE_GEM "GEM " DRIVER_DATE
|
||||||
|
|
||||||
static const GLubyte *
|
static const GLubyte *
|
||||||
@@ -265,6 +265,11 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
|
|||||||
region_name = "dri2 front buffer";
|
region_name = "dri2 front buffer";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case __DRI_BUFFER_FAKE_FRONT_LEFT:
|
||||||
|
rb = intel_fb->color_rb[0];
|
||||||
|
region_name = "dri2 fake front buffer";
|
||||||
|
break;
|
||||||
|
|
||||||
case __DRI_BUFFER_BACK_LEFT:
|
case __DRI_BUFFER_BACK_LEFT:
|
||||||
rb = intel_fb->color_rb[1];
|
rb = intel_fb->color_rb[1];
|
||||||
region_name = "dri2 back buffer";
|
region_name = "dri2 back buffer";
|
||||||
@@ -525,6 +530,26 @@ intel_flush(GLcontext *ctx, GLboolean needs_mi_flush)
|
|||||||
|
|
||||||
if (intel->batch->map != intel->batch->ptr)
|
if (intel->batch->map != intel->batch->ptr)
|
||||||
intel_batchbuffer_flush(intel->batch);
|
intel_batchbuffer_flush(intel->batch);
|
||||||
|
|
||||||
|
if ((ctx->DrawBuffer->Name == 0) && intel->front_buffer_dirty) {
|
||||||
|
__DRIscreen *const screen = intel->intelScreen->driScrnPriv;
|
||||||
|
|
||||||
|
if ((screen->dri2.loader->base.version >= 2)
|
||||||
|
&& (screen->dri2.loader->flushFrontBuffer != NULL)) {
|
||||||
|
(*screen->dri2.loader->flushFrontBuffer)(intel->driDrawable,
|
||||||
|
intel->driDrawable->loaderPrivate);
|
||||||
|
|
||||||
|
/* Only clear the dirty bit if front-buffer rendering is no longer
|
||||||
|
* enabled. This is done so that the dirty bit can only be set in
|
||||||
|
* glDrawBuffer. Otherwise the dirty bit would have to be set at
|
||||||
|
* each of N places that do rendering. This has worse performances,
|
||||||
|
* but it is much easier to get correct.
|
||||||
|
*/
|
||||||
|
if (intel->is_front_buffer_rendering) {
|
||||||
|
intel->front_buffer_dirty = GL_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -533,7 +558,7 @@ intelFlush(GLcontext * ctx)
|
|||||||
intel_flush(ctx, GL_FALSE);
|
intel_flush(ctx, GL_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
intel_glFlush(GLcontext *ctx)
|
intel_glFlush(GLcontext *ctx)
|
||||||
{
|
{
|
||||||
intel_flush(ctx, GL_TRUE);
|
intel_flush(ctx, GL_TRUE);
|
||||||
|
|||||||
@@ -260,11 +260,29 @@ struct intel_context
|
|||||||
* flush time while the lock is held.
|
* flush time while the lock is held.
|
||||||
*/
|
*/
|
||||||
GLboolean constant_cliprect;
|
GLboolean constant_cliprect;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In !constant_cliprect mode, set to true if the front cliprects should be
|
* In !constant_cliprect mode, set to true if the front cliprects should be
|
||||||
* used instead of back.
|
* used instead of back.
|
||||||
*/
|
*/
|
||||||
GLboolean front_cliprects;
|
GLboolean front_cliprects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set if rendering has occured to the drawable's front buffer.
|
||||||
|
*
|
||||||
|
* This is used in the DRI2 case to detect that glFlush should also copy
|
||||||
|
* the contents of the fake front buffer to the real front buffer.
|
||||||
|
*/
|
||||||
|
GLboolean front_buffer_dirty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Track whether front-buffer rendering is currently enabled
|
||||||
|
*
|
||||||
|
* A separate flag is used to track this in order to support MRT more
|
||||||
|
* easily.
|
||||||
|
*/
|
||||||
|
GLboolean is_front_buffer_rendering;
|
||||||
|
|
||||||
drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */
|
drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */
|
||||||
|
|
||||||
int perf_boxes;
|
int perf_boxes;
|
||||||
@@ -440,6 +458,7 @@ extern void intelGetLock(struct intel_context *intel, GLuint flags);
|
|||||||
|
|
||||||
extern void intelFinish(GLcontext * ctx);
|
extern void intelFinish(GLcontext * ctx);
|
||||||
extern void intelFlush(GLcontext * ctx);
|
extern void intelFlush(GLcontext * ctx);
|
||||||
|
extern void intel_glFlush(GLcontext *ctx);
|
||||||
|
|
||||||
extern void intelInitDriverFunctions(struct dd_function_table *functions);
|
extern void intelInitDriverFunctions(struct dd_function_table *functions);
|
||||||
extern void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging);
|
extern void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging);
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ do_copy_texsubimage(struct intel_context *intel,
|
|||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
intelFlush(ctx);
|
intel_glFlush(ctx);
|
||||||
LOCK_HARDWARE(intel);
|
LOCK_HARDWARE(intel);
|
||||||
{
|
{
|
||||||
GLuint image_offset = intel_miptree_image_offset(intelImage->mt,
|
GLuint image_offset = intel_miptree_image_offset(intelImage->mt,
|
||||||
@@ -155,6 +155,7 @@ do_copy_texsubimage(struct intel_context *intel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNLOCK_HARDWARE(intel);
|
UNLOCK_HARDWARE(intel);
|
||||||
|
intel_glFlush(ctx);
|
||||||
|
|
||||||
/* GL_SGIS_generate_mipmap */
|
/* GL_SGIS_generate_mipmap */
|
||||||
if (intelImage->level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
if (intelImage->level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||||
|
|||||||
@@ -259,8 +259,6 @@ radeonFillInModes( __DRIscreenPrivate *psp,
|
|||||||
__GLcontextModes *m;
|
__GLcontextModes *m;
|
||||||
unsigned depth_buffer_factor;
|
unsigned depth_buffer_factor;
|
||||||
unsigned back_buffer_factor;
|
unsigned back_buffer_factor;
|
||||||
GLenum fb_format;
|
|
||||||
GLenum fb_type;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
|
/* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
|
||||||
@@ -289,19 +287,24 @@ radeonFillInModes( __DRIscreenPrivate *psp,
|
|||||||
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
|
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
|
||||||
back_buffer_factor = (have_back_buffer) ? 2 : 1;
|
back_buffer_factor = (have_back_buffer) ? 2 : 1;
|
||||||
|
|
||||||
if ( pixel_bits == 16 ) {
|
if (pixel_bits == 16) {
|
||||||
fb_format = GL_RGB;
|
__DRIconfig **configs_a8r8g8b8;
|
||||||
fb_type = GL_UNSIGNED_SHORT_5_6_5;
|
__DRIconfig **configs_r5g6b5;
|
||||||
}
|
|
||||||
else {
|
configs_r5g6b5 = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
|
||||||
fb_format = GL_BGRA;
|
depth_bits_array, stencil_bits_array,
|
||||||
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
depth_buffer_factor, back_buffer_modes,
|
||||||
}
|
back_buffer_factor);
|
||||||
|
configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||||
|
depth_bits_array, stencil_bits_array,
|
||||||
|
1, back_buffer_modes, 1);
|
||||||
|
configs = driConcatConfigs(configs_r5g6b5, configs_a8r8g8b8);
|
||||||
|
} else
|
||||||
|
configs = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||||
|
depth_bits_array, stencil_bits_array,
|
||||||
|
depth_buffer_factor,
|
||||||
|
back_buffer_modes, back_buffer_factor);
|
||||||
|
|
||||||
configs = driCreateConfigs(fb_format, fb_type,
|
|
||||||
depth_bits_array, stencil_bits_array,
|
|
||||||
depth_buffer_factor,
|
|
||||||
back_buffer_modes, back_buffer_factor);
|
|
||||||
if (configs == NULL) {
|
if (configs == NULL) {
|
||||||
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
|
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
|
||||||
__func__, __LINE__ );
|
__func__, __LINE__ );
|
||||||
|
|||||||
@@ -166,17 +166,27 @@ swrastFillInModes(__DRIscreen *psp,
|
|||||||
depth_buffer_factor = 4;
|
depth_buffer_factor = 4;
|
||||||
back_buffer_factor = 2;
|
back_buffer_factor = 2;
|
||||||
|
|
||||||
if (pixel_bits == 8) {
|
switch (pixel_bits) {
|
||||||
|
case 8:
|
||||||
fb_format = GL_RGB;
|
fb_format = GL_RGB;
|
||||||
fb_type = GL_UNSIGNED_BYTE_2_3_3_REV;
|
fb_type = GL_UNSIGNED_BYTE_2_3_3_REV;
|
||||||
}
|
break;
|
||||||
else if (pixel_bits == 16) {
|
case 16:
|
||||||
fb_format = GL_RGB;
|
fb_format = GL_RGB;
|
||||||
fb_type = GL_UNSIGNED_SHORT_5_6_5;
|
fb_type = GL_UNSIGNED_SHORT_5_6_5;
|
||||||
}
|
break;
|
||||||
else {
|
case 24:
|
||||||
|
fb_format = GL_BGR;
|
||||||
|
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||||
|
break;
|
||||||
|
case 32:
|
||||||
fb_format = GL_BGRA;
|
fb_format = GL_BGRA;
|
||||||
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fprintf(stderr, "[%s:%u] bad depth %d\n", __func__, __LINE__,
|
||||||
|
pixel_bits);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
configs = driCreateConfigs(fb_format, fb_type,
|
configs = driCreateConfigs(fb_format, fb_type,
|
||||||
@@ -198,7 +208,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions,
|
|||||||
{
|
{
|
||||||
static const __DRIextension *emptyExtensionList[] = { NULL };
|
static const __DRIextension *emptyExtensionList[] = { NULL };
|
||||||
__DRIscreen *psp;
|
__DRIscreen *psp;
|
||||||
__DRIconfig **configs8, **configs16, **configs32;
|
const __DRIconfig **configs8, **configs16, **configs24, **configs32;
|
||||||
|
|
||||||
(void) data;
|
(void) data;
|
||||||
|
|
||||||
@@ -215,11 +225,12 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions,
|
|||||||
|
|
||||||
configs8 = swrastFillInModes(psp, 8, 8, 0, 1);
|
configs8 = swrastFillInModes(psp, 8, 8, 0, 1);
|
||||||
configs16 = swrastFillInModes(psp, 16, 16, 0, 1);
|
configs16 = swrastFillInModes(psp, 16, 16, 0, 1);
|
||||||
|
configs24 = swrastFillInModes(psp, 24, 24, 8, 1);
|
||||||
configs32 = swrastFillInModes(psp, 32, 24, 8, 1);
|
configs32 = swrastFillInModes(psp, 32, 24, 8, 1);
|
||||||
|
|
||||||
configs16 = (__DRIconfig **)driConcatConfigs(configs8, configs16);
|
configs16 = driConcatConfigs(configs8, configs16);
|
||||||
|
configs24 = driConcatConfigs(configs16, configs24);
|
||||||
*driver_configs = driConcatConfigs(configs16, configs32);
|
*driver_configs = driConcatConfigs(configs24, configs32);
|
||||||
|
|
||||||
driInitExtensions( NULL, card_extensions, GL_FALSE );
|
driInitExtensions( NULL, card_extensions, GL_FALSE );
|
||||||
|
|
||||||
@@ -251,19 +262,24 @@ static GLuint
|
|||||||
choose_pixel_format(const GLvisual *v)
|
choose_pixel_format(const GLvisual *v)
|
||||||
{
|
{
|
||||||
if (v->rgbMode) {
|
if (v->rgbMode) {
|
||||||
int bpp = v->rgbBits;
|
int depth = v->rgbBits;
|
||||||
|
|
||||||
if (bpp == 32
|
if (depth == 32
|
||||||
&& v->redMask == 0xff0000
|
&& v->redMask == 0xff0000
|
||||||
&& v->greenMask == 0x00ff00
|
&& v->greenMask == 0x00ff00
|
||||||
&& v->blueMask == 0x0000ff)
|
&& v->blueMask == 0x0000ff)
|
||||||
return PF_A8R8G8B8;
|
return PF_A8R8G8B8;
|
||||||
else if (bpp == 16
|
else if (depth == 24
|
||||||
|
&& v->redMask == 0xff0000
|
||||||
|
&& v->greenMask == 0x00ff00
|
||||||
|
&& v->blueMask == 0x0000ff)
|
||||||
|
return PF_X8R8G8B8;
|
||||||
|
else if (depth == 16
|
||||||
&& v->redMask == 0xf800
|
&& v->redMask == 0xf800
|
||||||
&& v->greenMask == 0x07e0
|
&& v->greenMask == 0x07e0
|
||||||
&& v->blueMask == 0x001f)
|
&& v->blueMask == 0x001f)
|
||||||
return PF_R5G6B5;
|
return PF_R5G6B5;
|
||||||
else if (bpp == 8
|
else if (depth == 8
|
||||||
&& v->redMask == 0x07
|
&& v->redMask == 0x07
|
||||||
&& v->greenMask == 0x38
|
&& v->greenMask == 0x38
|
||||||
&& v->blueMask == 0xc0)
|
&& v->blueMask == 0xc0)
|
||||||
@@ -292,7 +308,6 @@ swrast_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
|
|||||||
GLenum internalFormat, GLuint width, GLuint height)
|
GLenum internalFormat, GLuint width, GLuint height)
|
||||||
{
|
{
|
||||||
struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
|
struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
|
||||||
int bpp;
|
|
||||||
unsigned mask = PITCH_ALIGN_BITS - 1;
|
unsigned mask = PITCH_ALIGN_BITS - 1;
|
||||||
|
|
||||||
TRACE;
|
TRACE;
|
||||||
@@ -301,23 +316,8 @@ swrast_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
|
|||||||
rb->Width = width;
|
rb->Width = width;
|
||||||
rb->Height = height;
|
rb->Height = height;
|
||||||
|
|
||||||
switch (internalFormat) {
|
|
||||||
case GL_RGB:
|
|
||||||
bpp = rb->RedBits + rb->GreenBits + rb->BlueBits;
|
|
||||||
break;
|
|
||||||
case GL_RGBA:
|
|
||||||
bpp = rb->RedBits + rb->GreenBits + rb->BlueBits + rb->AlphaBits;
|
|
||||||
break;
|
|
||||||
case GL_COLOR_INDEX8_EXT:
|
|
||||||
bpp = rb->IndexBits;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_mesa_problem( NULL, "unexpected format in %s", __FUNCTION__ );
|
|
||||||
return GL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* always pad to PITCH_ALIGN_BITS */
|
/* always pad to PITCH_ALIGN_BITS */
|
||||||
xrb->pitch = ((width * bpp + mask) & ~mask) / 8;
|
xrb->pitch = ((width * xrb->bpp + mask) & ~mask) / 8;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
@@ -373,6 +373,17 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front)
|
|||||||
xrb->Base.GreenBits = 8 * sizeof(GLubyte);
|
xrb->Base.GreenBits = 8 * sizeof(GLubyte);
|
||||||
xrb->Base.BlueBits = 8 * sizeof(GLubyte);
|
xrb->Base.BlueBits = 8 * sizeof(GLubyte);
|
||||||
xrb->Base.AlphaBits = 8 * sizeof(GLubyte);
|
xrb->Base.AlphaBits = 8 * sizeof(GLubyte);
|
||||||
|
xrb->bpp = 32;
|
||||||
|
break;
|
||||||
|
case PF_X8R8G8B8:
|
||||||
|
xrb->Base.InternalFormat = GL_RGB;
|
||||||
|
xrb->Base._BaseFormat = GL_RGB;
|
||||||
|
xrb->Base.DataType = GL_UNSIGNED_BYTE;
|
||||||
|
xrb->Base.RedBits = 8 * sizeof(GLubyte);
|
||||||
|
xrb->Base.GreenBits = 8 * sizeof(GLubyte);
|
||||||
|
xrb->Base.BlueBits = 8 * sizeof(GLubyte);
|
||||||
|
xrb->Base.AlphaBits = 0;
|
||||||
|
xrb->bpp = 32;
|
||||||
break;
|
break;
|
||||||
case PF_R5G6B5:
|
case PF_R5G6B5:
|
||||||
xrb->Base.InternalFormat = GL_RGB;
|
xrb->Base.InternalFormat = GL_RGB;
|
||||||
@@ -382,6 +393,7 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front)
|
|||||||
xrb->Base.GreenBits = 6 * sizeof(GLubyte);
|
xrb->Base.GreenBits = 6 * sizeof(GLubyte);
|
||||||
xrb->Base.BlueBits = 5 * sizeof(GLubyte);
|
xrb->Base.BlueBits = 5 * sizeof(GLubyte);
|
||||||
xrb->Base.AlphaBits = 0;
|
xrb->Base.AlphaBits = 0;
|
||||||
|
xrb->bpp = 16;
|
||||||
break;
|
break;
|
||||||
case PF_R3G3B2:
|
case PF_R3G3B2:
|
||||||
xrb->Base.InternalFormat = GL_RGB;
|
xrb->Base.InternalFormat = GL_RGB;
|
||||||
@@ -391,12 +403,14 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front)
|
|||||||
xrb->Base.GreenBits = 3 * sizeof(GLubyte);
|
xrb->Base.GreenBits = 3 * sizeof(GLubyte);
|
||||||
xrb->Base.BlueBits = 2 * sizeof(GLubyte);
|
xrb->Base.BlueBits = 2 * sizeof(GLubyte);
|
||||||
xrb->Base.AlphaBits = 0;
|
xrb->Base.AlphaBits = 0;
|
||||||
|
xrb->bpp = 8;
|
||||||
break;
|
break;
|
||||||
case PF_CI8:
|
case PF_CI8:
|
||||||
xrb->Base.InternalFormat = GL_COLOR_INDEX8_EXT;
|
xrb->Base.InternalFormat = GL_COLOR_INDEX8_EXT;
|
||||||
xrb->Base._BaseFormat = GL_COLOR_INDEX;
|
xrb->Base._BaseFormat = GL_COLOR_INDEX;
|
||||||
xrb->Base.DataType = GL_UNSIGNED_BYTE;
|
xrb->Base.DataType = GL_UNSIGNED_BYTE;
|
||||||
xrb->Base.IndexBits = 8 * sizeof(GLubyte);
|
xrb->Base.IndexBits = 8 * sizeof(GLubyte);
|
||||||
|
xrb->bpp = 8;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ struct swrast_renderbuffer {
|
|||||||
|
|
||||||
/* renderbuffer pitch (in bytes) */
|
/* renderbuffer pitch (in bytes) */
|
||||||
GLuint pitch;
|
GLuint pitch;
|
||||||
|
/* bits per pixel of storage */
|
||||||
|
GLuint bpp;
|
||||||
};
|
};
|
||||||
|
|
||||||
static INLINE __DRIcontext *
|
static INLINE __DRIcontext *
|
||||||
@@ -115,10 +117,10 @@ swrast_renderbuffer(struct gl_renderbuffer *rb)
|
|||||||
* Pixel formats we support
|
* Pixel formats we support
|
||||||
*/
|
*/
|
||||||
#define PF_CI8 1 /**< Color Index mode */
|
#define PF_CI8 1 /**< Color Index mode */
|
||||||
#define PF_A8R8G8B8 2 /**< 32-bit TrueColor: 8-A, 8-R, 8-G, 8-B bits */
|
#define PF_A8R8G8B8 2 /**< 32bpp TrueColor: 8-A, 8-R, 8-G, 8-B bits */
|
||||||
#define PF_R5G6B5 3 /**< 16-bit TrueColor: 5-R, 6-G, 5-B bits */
|
#define PF_R5G6B5 3 /**< 16bpp TrueColor: 5-R, 6-G, 5-B bits */
|
||||||
#define PF_R3G3B2 4 /**< 8-bit TrueColor: 3-R, 3-G, 2-B bits */
|
#define PF_R3G3B2 4 /**< 8bpp TrueColor: 3-R, 3-G, 2-B bits */
|
||||||
|
#define PF_X8R8G8B8 5 /**< 32bpp TrueColor: 8-R, 8-G, 8-B bits */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renderbuffer pitch alignment (in bits).
|
* Renderbuffer pitch alignment (in bits).
|
||||||
|
|||||||
@@ -79,6 +79,24 @@ static const GLubyte kernel[16] = {
|
|||||||
DST[BCOMP] = SRC[0]
|
DST[BCOMP] = SRC[0]
|
||||||
|
|
||||||
|
|
||||||
|
/* 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]
|
||||||
|
#define STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE) \
|
||||||
|
DST[3] = 0xff; \
|
||||||
|
DST[2] = VALUE[RCOMP]; \
|
||||||
|
DST[1] = VALUE[GCOMP]; \
|
||||||
|
DST[0] = VALUE[BCOMP]
|
||||||
|
#define FETCH_PIXEL_X8R8G8B8(DST, SRC) \
|
||||||
|
DST[ACOMP] = 0xff; \
|
||||||
|
DST[RCOMP] = SRC[2]; \
|
||||||
|
DST[GCOMP] = SRC[1]; \
|
||||||
|
DST[BCOMP] = SRC[0]
|
||||||
|
|
||||||
|
|
||||||
/* 16-bit BGR */
|
/* 16-bit BGR */
|
||||||
#define STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) \
|
#define STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) \
|
||||||
do { \
|
do { \
|
||||||
@@ -139,6 +157,24 @@ static const GLubyte kernel[16] = {
|
|||||||
#include "swrast/s_spantemp.h"
|
#include "swrast/s_spantemp.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* 32-bit BGRX */
|
||||||
|
#define NAME(FUNC) FUNC##_X8R8G8B8
|
||||||
|
#define RB_TYPE GLubyte
|
||||||
|
#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
|
||||||
|
#define STORE_PIXEL(DST, X, Y, VALUE) \
|
||||||
|
STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE)
|
||||||
|
#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
|
||||||
|
STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE)
|
||||||
|
#define FETCH_PIXEL(DST, SRC) \
|
||||||
|
FETCH_PIXEL_X8R8G8B8(DST, SRC)
|
||||||
|
|
||||||
|
#include "swrast/s_spantemp.h"
|
||||||
|
|
||||||
|
|
||||||
/* 16-bit BGR */
|
/* 16-bit BGR */
|
||||||
#define NAME(FUNC) FUNC##_R5G6B5
|
#define NAME(FUNC) FUNC##_R5G6B5
|
||||||
#define RB_TYPE GLubyte
|
#define RB_TYPE GLubyte
|
||||||
@@ -210,6 +246,24 @@ static const GLubyte kernel[16] = {
|
|||||||
#include "swrast_spantemp.h"
|
#include "swrast_spantemp.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* 32-bit BGRX */
|
||||||
|
#define NAME(FUNC) FUNC##_X8R8G8B8_front
|
||||||
|
#define RB_TYPE GLubyte
|
||||||
|
#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
|
||||||
|
#define STORE_PIXEL(DST, X, Y, VALUE) \
|
||||||
|
STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE)
|
||||||
|
#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
|
||||||
|
STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE)
|
||||||
|
#define FETCH_PIXEL(DST, SRC) \
|
||||||
|
FETCH_PIXEL_X8R8G8B8(DST, SRC)
|
||||||
|
|
||||||
|
#include "swrast_spantemp.h"
|
||||||
|
|
||||||
|
|
||||||
/* 16-bit BGR */
|
/* 16-bit BGR */
|
||||||
#define NAME(FUNC) FUNC##_R5G6B5_front
|
#define NAME(FUNC) FUNC##_R5G6B5_front
|
||||||
#define RB_TYPE GLubyte
|
#define RB_TYPE GLubyte
|
||||||
@@ -279,6 +333,15 @@ swrast_set_span_funcs_back(struct swrast_renderbuffer *xrb,
|
|||||||
xrb->Base.PutValues = put_values_A8R8G8B8;
|
xrb->Base.PutValues = put_values_A8R8G8B8;
|
||||||
xrb->Base.PutMonoValues = put_mono_values_A8R8G8B8;
|
xrb->Base.PutMonoValues = put_mono_values_A8R8G8B8;
|
||||||
break;
|
break;
|
||||||
|
case PF_X8R8G8B8:
|
||||||
|
xrb->Base.GetRow = get_row_X8R8G8B8;
|
||||||
|
xrb->Base.GetValues = get_values_X8R8G8B8;
|
||||||
|
xrb->Base.PutRow = put_row_X8R8G8B8;
|
||||||
|
xrb->Base.PutRowRGB = put_row_rgb_X8R8G8B8;
|
||||||
|
xrb->Base.PutMonoRow = put_mono_row_X8R8G8B8;
|
||||||
|
xrb->Base.PutValues = put_values_X8R8G8B8;
|
||||||
|
xrb->Base.PutMonoValues = put_mono_values_X8R8G8B8;
|
||||||
|
break;
|
||||||
case PF_R5G6B5:
|
case PF_R5G6B5:
|
||||||
xrb->Base.GetRow = get_row_R5G6B5;
|
xrb->Base.GetRow = get_row_R5G6B5;
|
||||||
xrb->Base.GetValues = get_values_R5G6B5;
|
xrb->Base.GetValues = get_values_R5G6B5;
|
||||||
@@ -334,6 +397,15 @@ swrast_set_span_funcs_front(struct swrast_renderbuffer *xrb,
|
|||||||
xrb->Base.PutValues = put_values_A8R8G8B8_front;
|
xrb->Base.PutValues = put_values_A8R8G8B8_front;
|
||||||
xrb->Base.PutMonoValues = put_mono_values_A8R8G8B8_front;
|
xrb->Base.PutMonoValues = put_mono_values_A8R8G8B8_front;
|
||||||
break;
|
break;
|
||||||
|
case PF_X8R8G8B8:
|
||||||
|
xrb->Base.GetRow = get_row_X8R8G8B8_front;
|
||||||
|
xrb->Base.GetValues = get_values_X8R8G8B8_front;
|
||||||
|
xrb->Base.PutRow = put_row_X8R8G8B8_front;
|
||||||
|
xrb->Base.PutRowRGB = put_row_rgb_X8R8G8B8_front;
|
||||||
|
xrb->Base.PutMonoRow = put_mono_row_X8R8G8B8_front;
|
||||||
|
xrb->Base.PutValues = put_values_X8R8G8B8_front;
|
||||||
|
xrb->Base.PutMonoValues = put_mono_values_X8R8G8B8_front;
|
||||||
|
break;
|
||||||
case PF_R5G6B5:
|
case PF_R5G6B5:
|
||||||
xrb->Base.GetRow = get_row_R5G6B5_front;
|
xrb->Base.GetRow = get_row_R5G6B5_front;
|
||||||
xrb->Base.GetValues = get_values_R5G6B5_front;
|
xrb->Base.GetValues = get_values_R5G6B5_front;
|
||||||
|
|||||||
@@ -77,28 +77,30 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->RenderMode == GL_RENDER) {
|
if (ctx->RenderMode == GL_RENDER) {
|
||||||
/* Round, to satisfy conformance tests (matches SGI's OpenGL) */
|
if (width > 0 && height > 0) {
|
||||||
GLint x = IROUND(ctx->Current.RasterPos[0]);
|
/* Round, to satisfy conformance tests (matches SGI's OpenGL) */
|
||||||
GLint y = IROUND(ctx->Current.RasterPos[1]);
|
GLint x = IROUND(ctx->Current.RasterPos[0]);
|
||||||
|
GLint y = IROUND(ctx->Current.RasterPos[1]);
|
||||||
|
|
||||||
if (ctx->Unpack.BufferObj->Name) {
|
if (ctx->Unpack.BufferObj->Name) {
|
||||||
/* unpack from PBO */
|
/* unpack from PBO */
|
||||||
if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1,
|
if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1,
|
||||||
format, type, pixels)) {
|
format, type, pixels)) {
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||||
"glDrawPixels(invalid PBO access)");
|
"glDrawPixels(invalid PBO access)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ctx->Unpack.BufferObj->Pointer) {
|
if (ctx->Unpack.BufferObj->Pointer) {
|
||||||
/* buffer is mapped - that's an error */
|
/* buffer is mapped - that's an error */
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||||
"glDrawPixels(PBO is mapped)");
|
"glDrawPixels(PBO is mapped)");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
|
||||||
|
&ctx->Unpack, pixels);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
|
|
||||||
&ctx->Unpack, pixels);
|
|
||||||
}
|
}
|
||||||
else if (ctx->RenderMode == GL_FEEDBACK) {
|
else if (ctx->RenderMode == GL_FEEDBACK) {
|
||||||
/* Feedback the current raster pos info */
|
/* Feedback the current raster pos info */
|
||||||
@@ -159,10 +161,12 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
|
|||||||
|
|
||||||
if (ctx->RenderMode == GL_RENDER) {
|
if (ctx->RenderMode == GL_RENDER) {
|
||||||
/* Round to satisfy conformance tests (matches SGI's OpenGL) */
|
/* Round to satisfy conformance tests (matches SGI's OpenGL) */
|
||||||
GLint destx = IROUND(ctx->Current.RasterPos[0]);
|
if (width > 0 && height > 0) {
|
||||||
GLint desty = IROUND(ctx->Current.RasterPos[1]);
|
GLint destx = IROUND(ctx->Current.RasterPos[0]);
|
||||||
ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
|
GLint desty = IROUND(ctx->Current.RasterPos[1]);
|
||||||
type );
|
ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
|
||||||
|
type );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (ctx->RenderMode == GL_FEEDBACK) {
|
else if (ctx->RenderMode == GL_FEEDBACK) {
|
||||||
FLUSH_CURRENT( ctx, 0 );
|
FLUSH_CURRENT( ctx, 0 );
|
||||||
|
|||||||
@@ -1104,6 +1104,9 @@ static void build_lighting( struct tnl_program *p )
|
|||||||
|
|
||||||
if (twoside) {
|
if (twoside) {
|
||||||
if (!p->state->material_shininess_is_zero) {
|
if (!p->state->material_shininess_is_zero) {
|
||||||
|
/* Note that we negate the back-face specular exponent here.
|
||||||
|
* The negation will be un-done later in the back-face code below.
|
||||||
|
*/
|
||||||
struct ureg shininess = get_material(p, 1, STATE_SHININESS);
|
struct ureg shininess = get_material(p, 1, STATE_SHININESS);
|
||||||
emit_op1(p, OPCODE_MOV, dots, WRITEMASK_Z,
|
emit_op1(p, OPCODE_MOV, dots, WRITEMASK_Z,
|
||||||
negate(swizzle1(shininess,X)));
|
negate(swizzle1(shininess,X)));
|
||||||
@@ -1309,6 +1312,11 @@ static void build_lighting( struct tnl_program *p )
|
|||||||
mask1 = 0;
|
mask1 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* For the back face we need to negate the X and Y component
|
||||||
|
* dot products. dots.Z has the negated back-face specular
|
||||||
|
* exponent. We swizzle that into the W position. This
|
||||||
|
* negation makes the back-face specular term positive again.
|
||||||
|
*/
|
||||||
dots = negate(swizzle(dots,X,Y,W,Z));
|
dots = negate(swizzle(dots,X,Y,W,Z));
|
||||||
|
|
||||||
if (!is_undef(att)) {
|
if (!is_undef(att)) {
|
||||||
@@ -1327,8 +1335,10 @@ static void build_lighting( struct tnl_program *p )
|
|||||||
|
|
||||||
emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _bfc0);
|
emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _bfc0);
|
||||||
emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _bfc1);
|
emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _bfc1);
|
||||||
/* restore negate flag for next lighting */
|
/* restore dots to its original state for subsequent lights
|
||||||
dots = negate(dots);
|
* by negating and swizzling again.
|
||||||
|
*/
|
||||||
|
dots = negate(swizzle(dots,X,Y,W,Z));
|
||||||
|
|
||||||
release_temp(p, ambient);
|
release_temp(p, ambient);
|
||||||
release_temp(p, diffuse);
|
release_temp(p, diffuse);
|
||||||
|
|||||||
@@ -145,7 +145,10 @@
|
|||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#define CPU_TO_LE32( x ) bswap_32( x )
|
#define CPU_TO_LE32( x ) bswap_32( x )
|
||||||
#else /*__linux__*/
|
#elif defined(__APPLE__)
|
||||||
|
#include <CoreFoundation/CFByteOrder.h>
|
||||||
|
#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x )
|
||||||
|
#else /*__linux__ __APPLE__*/
|
||||||
#include <sys/endian.h>
|
#include <sys/endian.h>
|
||||||
#define CPU_TO_LE32( x ) bswap32( x )
|
#define CPU_TO_LE32( x ) bswap32( x )
|
||||||
#endif /*__linux__*/
|
#endif /*__linux__*/
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ struct _mesa_HashTable {
|
|||||||
struct HashEntry *Table[TABLE_SIZE]; /**< the lookup table */
|
struct HashEntry *Table[TABLE_SIZE]; /**< the lookup table */
|
||||||
GLuint MaxKey; /**< highest key inserted so far */
|
GLuint MaxKey; /**< highest key inserted so far */
|
||||||
_glthread_Mutex Mutex; /**< mutual exclusion lock */
|
_glthread_Mutex Mutex; /**< mutual exclusion lock */
|
||||||
|
_glthread_Mutex WalkMutex; /**< for _mesa_HashWalk() */
|
||||||
GLboolean InDeleteAll; /**< Debug check */
|
GLboolean InDeleteAll; /**< Debug check */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -79,6 +80,7 @@ _mesa_NewHashTable(void)
|
|||||||
struct _mesa_HashTable *table = CALLOC_STRUCT(_mesa_HashTable);
|
struct _mesa_HashTable *table = CALLOC_STRUCT(_mesa_HashTable);
|
||||||
if (table) {
|
if (table) {
|
||||||
_glthread_INIT_MUTEX(table->Mutex);
|
_glthread_INIT_MUTEX(table->Mutex);
|
||||||
|
_glthread_INIT_MUTEX(table->WalkMutex);
|
||||||
}
|
}
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
@@ -111,6 +113,7 @@ _mesa_DeleteHashTable(struct _mesa_HashTable *table)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
_glthread_DESTROY_MUTEX(table->Mutex);
|
_glthread_DESTROY_MUTEX(table->Mutex);
|
||||||
|
_glthread_DESTROY_MUTEX(table->WalkMutex);
|
||||||
_mesa_free(table);
|
_mesa_free(table);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,6 +288,11 @@ _mesa_HashDeleteAll(struct _mesa_HashTable *table,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Walk over all entries in a hash table, calling callback function for each.
|
* Walk over all entries in a hash table, calling callback function for each.
|
||||||
|
* Note: we use a separate mutex in this function to avoid a recursive
|
||||||
|
* locking deadlock (in case the callback calls _mesa_HashRemove()) and to
|
||||||
|
* prevent multiple threads/contexts from getting tangled up.
|
||||||
|
* A lock-less version of this function could be used when the table will
|
||||||
|
* not be modified.
|
||||||
* \param table the hash table to walk
|
* \param table the hash table to walk
|
||||||
* \param callback the callback function
|
* \param callback the callback function
|
||||||
* \param userData arbitrary pointer to pass along to the callback
|
* \param userData arbitrary pointer to pass along to the callback
|
||||||
@@ -300,14 +308,16 @@ _mesa_HashWalk(const struct _mesa_HashTable *table,
|
|||||||
GLuint pos;
|
GLuint pos;
|
||||||
ASSERT(table);
|
ASSERT(table);
|
||||||
ASSERT(callback);
|
ASSERT(callback);
|
||||||
_glthread_LOCK_MUTEX(table2->Mutex);
|
_glthread_LOCK_MUTEX(table2->WalkMutex);
|
||||||
for (pos = 0; pos < TABLE_SIZE; pos++) {
|
for (pos = 0; pos < TABLE_SIZE; pos++) {
|
||||||
struct HashEntry *entry;
|
struct HashEntry *entry, *next;
|
||||||
for (entry = table->Table[pos]; entry; entry = entry->Next) {
|
for (entry = table->Table[pos]; entry; entry = next) {
|
||||||
|
/* save 'next' pointer now in case the callback deletes the entry */
|
||||||
|
next = entry->Next;
|
||||||
callback(entry->Key, entry->Data, userData);
|
callback(entry->Key, entry->Data, userData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_glthread_UNLOCK_MUTEX(table2->Mutex);
|
_glthread_UNLOCK_MUTEX(table2->WalkMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,6 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
|
|||||||
_math_matrix_analyse(ctx->ModelviewMatrixStack.Top);
|
_math_matrix_analyse(ctx->ModelviewMatrixStack.Top);
|
||||||
}
|
}
|
||||||
TRANSFORM_DIRECTION(temp, params, ctx->ModelviewMatrixStack.Top->m);
|
TRANSFORM_DIRECTION(temp, params, ctx->ModelviewMatrixStack.Top->m);
|
||||||
NORMALIZE_3FV(temp);
|
|
||||||
params = temp;
|
params = temp;
|
||||||
break;
|
break;
|
||||||
case GL_SPOT_EXPONENT:
|
case GL_SPOT_EXPONENT:
|
||||||
@@ -1137,12 +1136,18 @@ compute_light_positions( GLcontext *ctx )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (light->_Flags & LIGHT_SPOT) {
|
if (light->_Flags & LIGHT_SPOT) {
|
||||||
|
/* Note: we normalize the spot direction now */
|
||||||
|
|
||||||
if (ctx->_NeedEyeCoords) {
|
if (ctx->_NeedEyeCoords) {
|
||||||
COPY_3V( light->_NormDirection, light->EyeDirection );
|
COPY_3V( light->_NormDirection, light->EyeDirection );
|
||||||
|
NORMALIZE_3FV( light->_NormDirection );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
GLfloat spotDir[3];
|
||||||
|
COPY_3V(spotDir, light->EyeDirection);
|
||||||
|
NORMALIZE_3FV(spotDir);
|
||||||
TRANSFORM_NORMAL( light->_NormDirection,
|
TRANSFORM_NORMAL( light->_NormDirection,
|
||||||
light->EyeDirection,
|
spotDir,
|
||||||
ctx->ModelviewMatrixStack.Top->m);
|
ctx->ModelviewMatrixStack.Top->m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,6 +170,9 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (width == 0 || height == 0)
|
||||||
|
return; /* nothing to do */
|
||||||
|
|
||||||
if (ctx->Pack.BufferObj->Name) {
|
if (ctx->Pack.BufferObj->Name) {
|
||||||
if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1,
|
if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1,
|
||||||
format, type, pixels)) {
|
format, type, pixels)) {
|
||||||
|
|||||||
@@ -139,8 +139,11 @@ flush(GLcontext *ctx, struct gl_texture_object *texObj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Set an integer-valued texture parameter */
|
/**
|
||||||
static void
|
* Set an integer-valued texture parameter
|
||||||
|
* \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise
|
||||||
|
*/
|
||||||
|
static GLboolean
|
||||||
set_tex_parameteri(GLcontext *ctx,
|
set_tex_parameteri(GLcontext *ctx,
|
||||||
struct gl_texture_object *texObj,
|
struct gl_texture_object *texObj,
|
||||||
GLenum pname, const GLint *params)
|
GLenum pname, const GLint *params)
|
||||||
@@ -148,13 +151,13 @@ set_tex_parameteri(GLcontext *ctx,
|
|||||||
switch (pname) {
|
switch (pname) {
|
||||||
case GL_TEXTURE_MIN_FILTER:
|
case GL_TEXTURE_MIN_FILTER:
|
||||||
if (texObj->MinFilter == params[0])
|
if (texObj->MinFilter == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
switch (params[0]) {
|
switch (params[0]) {
|
||||||
case GL_NEAREST:
|
case GL_NEAREST:
|
||||||
case GL_LINEAR:
|
case GL_LINEAR:
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->MinFilter = params[0];
|
texObj->MinFilter = params[0];
|
||||||
return;
|
return GL_TRUE;
|
||||||
case GL_NEAREST_MIPMAP_NEAREST:
|
case GL_NEAREST_MIPMAP_NEAREST:
|
||||||
case GL_LINEAR_MIPMAP_NEAREST:
|
case GL_LINEAR_MIPMAP_NEAREST:
|
||||||
case GL_NEAREST_MIPMAP_LINEAR:
|
case GL_NEAREST_MIPMAP_LINEAR:
|
||||||
@@ -162,77 +165,80 @@ set_tex_parameteri(GLcontext *ctx,
|
|||||||
if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) {
|
if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) {
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->MinFilter = params[0];
|
texObj->MinFilter = params[0];
|
||||||
return;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
default:
|
default:
|
||||||
_mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
|
_mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_MAG_FILTER:
|
case GL_TEXTURE_MAG_FILTER:
|
||||||
if (texObj->MagFilter == params[0])
|
if (texObj->MagFilter == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
switch (params[0]) {
|
switch (params[0]) {
|
||||||
case GL_NEAREST:
|
case GL_NEAREST:
|
||||||
case GL_LINEAR:
|
case GL_LINEAR:
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->MagFilter = params[0];
|
texObj->MagFilter = params[0];
|
||||||
return;
|
return GL_TRUE;
|
||||||
default:
|
default:
|
||||||
_mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
|
_mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_WRAP_S:
|
case GL_TEXTURE_WRAP_S:
|
||||||
if (texObj->WrapS == params[0])
|
if (texObj->WrapS == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
|
if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->WrapS = params[0];
|
texObj->WrapS = params[0];
|
||||||
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_WRAP_T:
|
case GL_TEXTURE_WRAP_T:
|
||||||
if (texObj->WrapT == params[0])
|
if (texObj->WrapT == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
|
if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->WrapT = params[0];
|
texObj->WrapT = params[0];
|
||||||
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_WRAP_R:
|
case GL_TEXTURE_WRAP_R:
|
||||||
if (texObj->WrapR == params[0])
|
if (texObj->WrapR == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
|
if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->WrapR = params[0];
|
texObj->WrapR = params[0];
|
||||||
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_BASE_LEVEL:
|
case GL_TEXTURE_BASE_LEVEL:
|
||||||
if (texObj->BaseLevel == params[0])
|
if (texObj->BaseLevel == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
if (params[0] < 0 ||
|
if (params[0] < 0 ||
|
||||||
(texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0)) {
|
(texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0)) {
|
||||||
_mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)");
|
_mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)");
|
||||||
return;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->BaseLevel = params[0];
|
texObj->BaseLevel = params[0];
|
||||||
return;
|
return GL_TRUE;
|
||||||
|
|
||||||
case GL_TEXTURE_MAX_LEVEL:
|
case GL_TEXTURE_MAX_LEVEL:
|
||||||
if (texObj->MaxLevel == params[0])
|
if (texObj->MaxLevel == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) {
|
if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) {
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)");
|
_mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)");
|
||||||
return;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->MaxLevel = params[0];
|
texObj->MaxLevel = params[0];
|
||||||
return;
|
return GL_TRUE;
|
||||||
|
|
||||||
case GL_TEXTURE_COMPARE_SGIX:
|
case GL_TEXTURE_COMPARE_SGIX:
|
||||||
if (ctx->Extensions.SGIX_shadow) {
|
if (ctx->Extensions.SGIX_shadow) {
|
||||||
@@ -243,7 +249,7 @@ set_tex_parameteri(GLcontext *ctx,
|
|||||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
"glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)");
|
"glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)");
|
||||||
}
|
}
|
||||||
return;
|
return GL_TRUE;
|
||||||
|
|
||||||
case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
|
case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
|
||||||
if (ctx->Extensions.SGIX_shadow &&
|
if (ctx->Extensions.SGIX_shadow &&
|
||||||
@@ -256,20 +262,22 @@ set_tex_parameteri(GLcontext *ctx,
|
|||||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
"glTexParameter(GL_TEXTURE_COMPARE_OPERATOR_SGIX)");
|
"glTexParameter(GL_TEXTURE_COMPARE_OPERATOR_SGIX)");
|
||||||
}
|
}
|
||||||
return;
|
return GL_TRUE;
|
||||||
|
|
||||||
case GL_GENERATE_MIPMAP_SGIS:
|
case GL_GENERATE_MIPMAP_SGIS:
|
||||||
if (ctx->Extensions.SGIS_generate_mipmap) {
|
if (ctx->Extensions.SGIS_generate_mipmap) {
|
||||||
if (texObj->GenerateMipmap != params[0]) {
|
if (texObj->GenerateMipmap != params[0]) {
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE;
|
texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE;
|
||||||
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
"glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)");
|
"glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)");
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_COMPARE_MODE_ARB:
|
case GL_TEXTURE_COMPARE_MODE_ARB:
|
||||||
if (ctx->Extensions.ARB_shadow &&
|
if (ctx->Extensions.ARB_shadow &&
|
||||||
@@ -278,24 +286,26 @@ set_tex_parameteri(GLcontext *ctx,
|
|||||||
if (texObj->CompareMode != params[0]) {
|
if (texObj->CompareMode != params[0]) {
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->CompareMode = params[0];
|
texObj->CompareMode = params[0];
|
||||||
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
"glTexParameter(GL_TEXTURE_COMPARE_MODE_ARB)");
|
"glTexParameter(GL_TEXTURE_COMPARE_MODE_ARB)");
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_COMPARE_FUNC_ARB:
|
case GL_TEXTURE_COMPARE_FUNC_ARB:
|
||||||
if (ctx->Extensions.ARB_shadow) {
|
if (ctx->Extensions.ARB_shadow) {
|
||||||
if (texObj->CompareFunc == params[0])
|
if (texObj->CompareFunc == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
switch (params[0]) {
|
switch (params[0]) {
|
||||||
case GL_LEQUAL:
|
case GL_LEQUAL:
|
||||||
case GL_GEQUAL:
|
case GL_GEQUAL:
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->CompareFunc = params[0];
|
texObj->CompareFunc = params[0];
|
||||||
return;
|
return GL_TRUE;
|
||||||
case GL_EQUAL:
|
case GL_EQUAL:
|
||||||
case GL_NOTEQUAL:
|
case GL_NOTEQUAL:
|
||||||
case GL_LESS:
|
case GL_LESS:
|
||||||
@@ -305,7 +315,7 @@ set_tex_parameteri(GLcontext *ctx,
|
|||||||
if (ctx->Extensions.EXT_shadow_funcs) {
|
if (ctx->Extensions.EXT_shadow_funcs) {
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->CompareFunc = params[0];
|
texObj->CompareFunc = params[0];
|
||||||
return;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
default:
|
default:
|
||||||
@@ -316,7 +326,7 @@ set_tex_parameteri(GLcontext *ctx,
|
|||||||
else {
|
else {
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)");
|
_mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)");
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_DEPTH_TEXTURE_MODE_ARB:
|
case GL_DEPTH_TEXTURE_MODE_ARB:
|
||||||
if (ctx->Extensions.ARB_depth_texture &&
|
if (ctx->Extensions.ARB_depth_texture &&
|
||||||
@@ -326,13 +336,14 @@ set_tex_parameteri(GLcontext *ctx,
|
|||||||
if (texObj->DepthMode != params[0]) {
|
if (texObj->DepthMode != params[0]) {
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->DepthMode = params[0];
|
texObj->DepthMode = params[0];
|
||||||
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
"glTexParameter(GL_DEPTH_TEXTURE_MODE_ARB)");
|
"glTexParameter(GL_DEPTH_TEXTURE_MODE_ARB)");
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
#ifdef FEATURE_OES_draw_texture
|
#ifdef FEATURE_OES_draw_texture
|
||||||
case GL_TEXTURE_CROP_RECT_OES:
|
case GL_TEXTURE_CROP_RECT_OES:
|
||||||
@@ -340,17 +351,21 @@ set_tex_parameteri(GLcontext *ctx,
|
|||||||
texObj->CropRect[1] = params[1];
|
texObj->CropRect[1] = params[1];
|
||||||
texObj->CropRect[2] = params[2];
|
texObj->CropRect[2] = params[2];
|
||||||
texObj->CropRect[3] = params[3];
|
texObj->CropRect[3] = params[3];
|
||||||
break;
|
return GL_TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
|
_mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
|
||||||
}
|
}
|
||||||
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Set a float-valued texture parameter */
|
/**
|
||||||
static void
|
* Set a float-valued texture parameter
|
||||||
|
* \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise
|
||||||
|
*/
|
||||||
|
static GLboolean
|
||||||
set_tex_parameterf(GLcontext *ctx,
|
set_tex_parameterf(GLcontext *ctx,
|
||||||
struct gl_texture_object *texObj,
|
struct gl_texture_object *texObj,
|
||||||
GLenum pname, const GLfloat *params)
|
GLenum pname, const GLfloat *params)
|
||||||
@@ -358,54 +373,56 @@ set_tex_parameterf(GLcontext *ctx,
|
|||||||
switch (pname) {
|
switch (pname) {
|
||||||
case GL_TEXTURE_MIN_LOD:
|
case GL_TEXTURE_MIN_LOD:
|
||||||
if (texObj->MinLod == params[0])
|
if (texObj->MinLod == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->MinLod = params[0];
|
texObj->MinLod = params[0];
|
||||||
return;
|
return GL_TRUE;
|
||||||
|
|
||||||
case GL_TEXTURE_MAX_LOD:
|
case GL_TEXTURE_MAX_LOD:
|
||||||
if (texObj->MaxLod == params[0])
|
if (texObj->MaxLod == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->MaxLod = params[0];
|
texObj->MaxLod = params[0];
|
||||||
return;
|
return GL_TRUE;
|
||||||
|
|
||||||
case GL_TEXTURE_PRIORITY:
|
case GL_TEXTURE_PRIORITY:
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->Priority = CLAMP(params[0], 0.0F, 1.0F);
|
texObj->Priority = CLAMP(params[0], 0.0F, 1.0F);
|
||||||
return;
|
return GL_TRUE;
|
||||||
|
|
||||||
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
|
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
|
||||||
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
|
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
|
||||||
if (texObj->MaxAnisotropy == params[0])
|
if (texObj->MaxAnisotropy == params[0])
|
||||||
return;
|
return GL_FALSE;
|
||||||
if (params[0] < 1.0) {
|
if (params[0] < 1.0) {
|
||||||
_mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
|
_mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
|
||||||
return;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
/* clamp to max, that's what NVIDIA does */
|
/* clamp to max, that's what NVIDIA does */
|
||||||
texObj->MaxAnisotropy = MIN2(params[0],
|
texObj->MaxAnisotropy = MIN2(params[0],
|
||||||
ctx->Const.MaxTextureMaxAnisotropy);
|
ctx->Const.MaxTextureMaxAnisotropy);
|
||||||
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
"glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)");
|
"glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)");
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
|
case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
|
||||||
if (ctx->Extensions.SGIX_shadow_ambient) {
|
if (ctx->Extensions.SGIX_shadow_ambient) {
|
||||||
if (texObj->ShadowAmbient != params[0]) {
|
if (texObj->ShadowAmbient != params[0]) {
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F);
|
texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F);
|
||||||
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||||
"glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)");
|
"glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)");
|
||||||
}
|
}
|
||||||
return;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_LOD_BIAS:
|
case GL_TEXTURE_LOD_BIAS:
|
||||||
/* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */
|
/* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */
|
||||||
@@ -413,7 +430,9 @@ set_tex_parameterf(GLcontext *ctx,
|
|||||||
if (texObj->LodBias != params[0]) {
|
if (texObj->LodBias != params[0]) {
|
||||||
flush(ctx, texObj);
|
flush(ctx, texObj);
|
||||||
texObj->LodBias = params[0];
|
texObj->LodBias = params[0];
|
||||||
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -427,17 +446,19 @@ set_tex_parameterf(GLcontext *ctx,
|
|||||||
UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]);
|
UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]);
|
||||||
UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]);
|
UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]);
|
||||||
UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]);
|
UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]);
|
||||||
return;
|
return GL_TRUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
|
_mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
|
||||||
}
|
}
|
||||||
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
|
_mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
|
||||||
{
|
{
|
||||||
|
GLboolean need_update;
|
||||||
struct gl_texture_object *texObj;
|
struct gl_texture_object *texObj;
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||||
@@ -463,15 +484,15 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
|
|||||||
{
|
{
|
||||||
/* convert float param to int */
|
/* convert float param to int */
|
||||||
GLint p = (GLint) param;
|
GLint p = (GLint) param;
|
||||||
set_tex_parameteri(ctx, texObj, pname, &p);
|
need_update = set_tex_parameteri(ctx, texObj, pname, &p);
|
||||||
}
|
}
|
||||||
return;
|
break;
|
||||||
default:
|
default:
|
||||||
/* this will generate an error if pname is illegal */
|
/* this will generate an error if pname is illegal */
|
||||||
set_tex_parameterf(ctx, texObj, pname, ¶m);
|
need_update = set_tex_parameterf(ctx, texObj, pname, ¶m);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
|
if (ctx->Driver.TexParameter && need_update) {
|
||||||
ctx->Driver.TexParameter(ctx, target, texObj, pname, ¶m);
|
ctx->Driver.TexParameter(ctx, target, texObj, pname, ¶m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -480,6 +501,7 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
|
|||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
|
_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
|
||||||
{
|
{
|
||||||
|
GLboolean need_update;
|
||||||
struct gl_texture_object *texObj;
|
struct gl_texture_object *texObj;
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||||
@@ -505,7 +527,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
|
|||||||
{
|
{
|
||||||
/* convert float param to int */
|
/* convert float param to int */
|
||||||
GLint p = (GLint) params[0];
|
GLint p = (GLint) params[0];
|
||||||
set_tex_parameteri(ctx, texObj, pname, &p);
|
need_update = set_tex_parameteri(ctx, texObj, pname, &p);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -518,17 +540,17 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
|
|||||||
iparams[1] = (GLint) params[1];
|
iparams[1] = (GLint) params[1];
|
||||||
iparams[2] = (GLint) params[2];
|
iparams[2] = (GLint) params[2];
|
||||||
iparams[3] = (GLint) params[3];
|
iparams[3] = (GLint) params[3];
|
||||||
set_tex_parameteri(ctx, target, iparams);
|
need_update = set_tex_parameteri(ctx, target, iparams);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* this will generate an error if pname is illegal */
|
/* this will generate an error if pname is illegal */
|
||||||
set_tex_parameterf(ctx, texObj, pname, params);
|
need_update = set_tex_parameterf(ctx, texObj, pname, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
|
if (ctx->Driver.TexParameter && need_update) {
|
||||||
ctx->Driver.TexParameter(ctx, target, texObj, pname, params);
|
ctx->Driver.TexParameter(ctx, target, texObj, pname, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -537,6 +559,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
|
|||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
|
_mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
|
||||||
{
|
{
|
||||||
|
GLboolean need_update;
|
||||||
struct gl_texture_object *texObj;
|
struct gl_texture_object *texObj;
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||||
@@ -555,15 +578,15 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
|
|||||||
{
|
{
|
||||||
GLfloat fparam = (GLfloat) param;
|
GLfloat fparam = (GLfloat) param;
|
||||||
/* convert int param to float */
|
/* convert int param to float */
|
||||||
set_tex_parameterf(ctx, texObj, pname, &fparam);
|
need_update = set_tex_parameterf(ctx, texObj, pname, &fparam);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* this will generate an error if pname is illegal */
|
/* this will generate an error if pname is illegal */
|
||||||
set_tex_parameteri(ctx, texObj, pname, ¶m);
|
need_update = set_tex_parameteri(ctx, texObj, pname, ¶m);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
|
if (ctx->Driver.TexParameter && need_update) {
|
||||||
GLfloat fparam = (GLfloat) param;
|
GLfloat fparam = (GLfloat) param;
|
||||||
ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam);
|
ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam);
|
||||||
}
|
}
|
||||||
@@ -573,6 +596,7 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
|
|||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
|
_mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
|
||||||
{
|
{
|
||||||
|
GLboolean need_update;
|
||||||
struct gl_texture_object *texObj;
|
struct gl_texture_object *texObj;
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||||
@@ -590,7 +614,7 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
|
|||||||
fparams[1] = INT_TO_FLOAT(params[1]);
|
fparams[1] = INT_TO_FLOAT(params[1]);
|
||||||
fparams[2] = INT_TO_FLOAT(params[2]);
|
fparams[2] = INT_TO_FLOAT(params[2]);
|
||||||
fparams[3] = INT_TO_FLOAT(params[3]);
|
fparams[3] = INT_TO_FLOAT(params[3]);
|
||||||
set_tex_parameterf(ctx, texObj, pname, fparams);
|
need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GL_TEXTURE_MIN_LOD:
|
case GL_TEXTURE_MIN_LOD:
|
||||||
@@ -602,15 +626,15 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
|
|||||||
{
|
{
|
||||||
/* convert int param to float */
|
/* convert int param to float */
|
||||||
GLfloat fparam = (GLfloat) params[0];
|
GLfloat fparam = (GLfloat) params[0];
|
||||||
set_tex_parameterf(ctx, texObj, pname, &fparam);
|
need_update = set_tex_parameterf(ctx, texObj, pname, &fparam);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* this will generate an error if pname is illegal */
|
/* this will generate an error if pname is illegal */
|
||||||
set_tex_parameteri(ctx, texObj, pname, params);
|
need_update = set_tex_parameteri(ctx, texObj, pname, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
|
if (ctx->Driver.TexParameter && need_update) {
|
||||||
GLfloat fparams[4];
|
GLfloat fparams[4];
|
||||||
fparams[0] = INT_TO_FLOAT(params[0]);
|
fparams[0] = INT_TO_FLOAT(params[0]);
|
||||||
if (pname == GL_TEXTURE_BORDER_COLOR ||
|
if (pname == GL_TEXTURE_BORDER_COLOR ||
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
#define MESA_MAJOR 7
|
#define MESA_MAJOR 7
|
||||||
#define MESA_MINOR 4
|
#define MESA_MINOR 4
|
||||||
#define MESA_PATCH 0
|
#define MESA_PATCH 0
|
||||||
#define MESA_VERSION_STRING "7.4-rc2"
|
#define MESA_VERSION_STRING "7.4"
|
||||||
|
|
||||||
/* To make version comparison easy */
|
/* To make version comparison easy */
|
||||||
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
||||||
|
|||||||
@@ -1379,11 +1379,10 @@ _math_matrix_analyse( GLmatrix *mat )
|
|||||||
|
|
||||||
if (mat->inv && (mat->flags & MAT_DIRTY_INVERSE)) {
|
if (mat->inv && (mat->flags & MAT_DIRTY_INVERSE)) {
|
||||||
matrix_invert( mat );
|
matrix_invert( mat );
|
||||||
|
mat->flags &= ~MAT_DIRTY_INVERSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
mat->flags &= ~(MAT_DIRTY_FLAGS|
|
mat->flags &= ~(MAT_DIRTY_FLAGS | MAT_DIRTY_TYPE);
|
||||||
MAT_DIRTY_TYPE|
|
|
||||||
MAT_DIRTY_INVERSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|||||||
@@ -1823,7 +1823,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
|
|||||||
if (param_var->param_binding_begin == ~0U)
|
if (param_var->param_binding_begin == ~0U)
|
||||||
param_var->param_binding_begin = idx;
|
param_var->param_binding_begin = idx;
|
||||||
param_var->param_binding_length++;
|
param_var->param_binding_length++;
|
||||||
Program->Base.NumParameters++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1832,7 +1831,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
|
|||||||
if (param_var->param_binding_begin == ~0U)
|
if (param_var->param_binding_begin == ~0U)
|
||||||
param_var->param_binding_begin = idx;
|
param_var->param_binding_begin = idx;
|
||||||
param_var->param_binding_length++;
|
param_var->param_binding_length++;
|
||||||
Program->Base.NumParameters++;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1843,7 +1841,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
|
|||||||
if (param_var->param_binding_begin == ~0U)
|
if (param_var->param_binding_begin == ~0U)
|
||||||
param_var->param_binding_begin = idx;
|
param_var->param_binding_begin = idx;
|
||||||
param_var->param_binding_length++;
|
param_var->param_binding_length++;
|
||||||
Program->Base.NumParameters++;
|
|
||||||
|
|
||||||
/* Check if there is more: 0 -> we're done, else its an integer */
|
/* Check if there is more: 0 -> we're done, else its an integer */
|
||||||
if (**inst) {
|
if (**inst) {
|
||||||
@@ -1879,7 +1876,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
|
|||||||
idx = _mesa_add_state_reference(Program->Base.Parameters,
|
idx = _mesa_add_state_reference(Program->Base.Parameters,
|
||||||
state_tokens);
|
state_tokens);
|
||||||
param_var->param_binding_length++;
|
param_var->param_binding_length++;
|
||||||
Program->Base.NumParameters++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1897,7 +1893,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
|
|||||||
param_var->param_binding_begin = idx;
|
param_var->param_binding_begin = idx;
|
||||||
param_var->param_binding_type = PROGRAM_CONSTANT;
|
param_var->param_binding_type = PROGRAM_CONSTANT;
|
||||||
param_var->param_binding_length++;
|
param_var->param_binding_length++;
|
||||||
Program->Base.NumParameters++;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1906,12 +1901,14 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Program->Base.NumParameters = Program->Base.Parameters->NumParameters;
|
||||||
|
|
||||||
/* Make sure we haven't blown past our parameter limits */
|
/* Make sure we haven't blown past our parameter limits */
|
||||||
if (((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) &&
|
if (((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) &&
|
||||||
(Program->Base.NumParameters >=
|
(Program->Base.NumParameters >
|
||||||
ctx->Const.VertexProgram.MaxLocalParams))
|
ctx->Const.VertexProgram.MaxLocalParams))
|
||||||
|| ((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB)
|
|| ((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB)
|
||||||
&& (Program->Base.NumParameters >=
|
&& (Program->Base.NumParameters >
|
||||||
ctx->Const.FragmentProgram.MaxLocalParams))) {
|
ctx->Const.FragmentProgram.MaxLocalParams))) {
|
||||||
program_error(ctx, Program->Position, "Too many parameter variables");
|
program_error(ctx, Program->Position, "Too many parameter variables");
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -873,7 +873,7 @@ _mesa_execute_program(GLcontext * ctx,
|
|||||||
* result.z = result.x * APPX(result.y)
|
* result.z = result.x * APPX(result.y)
|
||||||
* We do what the ARB extension says.
|
* We do what the ARB extension says.
|
||||||
*/
|
*/
|
||||||
q[2] = (GLfloat) pow(2.0, t[0]);
|
q[2] = (GLfloat) _mesa_pow(2.0, t[0]);
|
||||||
}
|
}
|
||||||
q[1] = t[0] - floor_t0;
|
q[1] = t[0] - floor_t0;
|
||||||
q[3] = 1.0F;
|
q[3] = 1.0F;
|
||||||
@@ -986,7 +986,7 @@ _mesa_execute_program(GLcontext * ctx,
|
|||||||
if (a[1] == 0.0 && a[3] == 0.0)
|
if (a[1] == 0.0 && a[3] == 0.0)
|
||||||
result[2] = 1.0;
|
result[2] = 1.0;
|
||||||
else
|
else
|
||||||
result[2] = EXPF(a[3] * LOGF(a[1]));
|
result[2] = (GLfloat) _mesa_pow(a[1], a[3]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result[2] = 0.0;
|
result[2] = 0.0;
|
||||||
@@ -1577,8 +1577,8 @@ _mesa_execute_program(GLcontext * ctx,
|
|||||||
case OPCODE_TXB: /* GL_ARB_fragment_program only */
|
case OPCODE_TXB: /* GL_ARB_fragment_program only */
|
||||||
/* Texel lookup with LOD bias */
|
/* Texel lookup with LOD bias */
|
||||||
{
|
{
|
||||||
const struct gl_texture_unit *texUnit
|
const GLuint unit = machine->Samplers[inst->TexSrcUnit];
|
||||||
= &ctx->Texture.Unit[inst->TexSrcUnit];
|
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
|
||||||
GLfloat texcoord[4], color[4], lodBias;
|
GLfloat texcoord[4], color[4], lodBias;
|
||||||
|
|
||||||
fetch_vector4(&inst->SrcReg[0], machine, texcoord);
|
fetch_vector4(&inst->SrcReg[0], machine, texcoord);
|
||||||
|
|||||||
@@ -178,15 +178,20 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList,
|
|||||||
const char *name, const GLfloat values[4],
|
const char *name, const GLfloat values[4],
|
||||||
GLuint size)
|
GLuint size)
|
||||||
{
|
{
|
||||||
#if 0 /* disable this for now -- we need to save the name! */
|
/* first check if this is a duplicate constant */
|
||||||
GLint pos;
|
GLint pos;
|
||||||
GLuint swizzle;
|
for (pos = 0; pos < paramList->NumParameters; pos++) {
|
||||||
ASSERT(size == 4); /* XXX future feature */
|
const GLfloat *pvals = paramList->ParameterValues[pos];
|
||||||
/* check if we already have this constant */
|
if (pvals[0] == values[0] &&
|
||||||
if (_mesa_lookup_parameter_constant(paramList, values, 4, &pos, &swizzle)) {
|
pvals[1] == values[1] &&
|
||||||
return pos;
|
pvals[2] == values[2] &&
|
||||||
|
pvals[3] == values[3] &&
|
||||||
|
_mesa_strcmp(paramList->Parameters[pos].Name, name) == 0) {
|
||||||
|
/* Same name and value is already in the param list - reuse it */
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
/* not found, add new parameter */
|
||||||
return _mesa_add_parameter(paramList, PROGRAM_CONSTANT, name,
|
return _mesa_add_parameter(paramList, PROGRAM_CONSTANT, name,
|
||||||
size, GL_NONE, values, NULL, 0x0);
|
size, GL_NONE, values, NULL, 0x0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -457,28 +457,36 @@ emit_statevars(const char *name, int array_len,
|
|||||||
tokens[0] = STATE_TEXENV_COLOR;
|
tokens[0] = STATE_TEXENV_COLOR;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "gl_EyePlaneS") == 0) {
|
else if (strcmp(name, "gl_EyePlaneS") == 0) {
|
||||||
tokens[0] = STATE_TEXGEN_EYE_S;
|
tokens[0] = STATE_TEXGEN;
|
||||||
|
tokens[2] = STATE_TEXGEN_EYE_S;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "gl_EyePlaneT") == 0) {
|
else if (strcmp(name, "gl_EyePlaneT") == 0) {
|
||||||
tokens[0] = STATE_TEXGEN_EYE_T;
|
tokens[0] = STATE_TEXGEN;
|
||||||
|
tokens[2] = STATE_TEXGEN_EYE_T;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "gl_EyePlaneR") == 0) {
|
else if (strcmp(name, "gl_EyePlaneR") == 0) {
|
||||||
tokens[0] = STATE_TEXGEN_EYE_R;
|
tokens[0] = STATE_TEXGEN;
|
||||||
|
tokens[2] = STATE_TEXGEN_EYE_R;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "gl_EyePlaneQ") == 0) {
|
else if (strcmp(name, "gl_EyePlaneQ") == 0) {
|
||||||
tokens[0] = STATE_TEXGEN_EYE_Q;
|
tokens[0] = STATE_TEXGEN;
|
||||||
|
tokens[2] = STATE_TEXGEN_EYE_Q;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "gl_ObjectPlaneS") == 0) {
|
else if (strcmp(name, "gl_ObjectPlaneS") == 0) {
|
||||||
tokens[0] = STATE_TEXGEN_OBJECT_S;
|
tokens[0] = STATE_TEXGEN;
|
||||||
|
tokens[2] = STATE_TEXGEN_OBJECT_S;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "gl_ObjectPlaneT") == 0) {
|
else if (strcmp(name, "gl_ObjectPlaneT") == 0) {
|
||||||
tokens[0] = STATE_TEXGEN_OBJECT_T;
|
tokens[0] = STATE_TEXGEN;
|
||||||
|
tokens[2] = STATE_TEXGEN_OBJECT_T;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "gl_ObjectPlaneR") == 0) {
|
else if (strcmp(name, "gl_ObjectPlaneR") == 0) {
|
||||||
tokens[0] = STATE_TEXGEN_OBJECT_R;
|
tokens[0] = STATE_TEXGEN;
|
||||||
|
tokens[2] = STATE_TEXGEN_OBJECT_R;
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "gl_ObjectPlaneQ") == 0) {
|
else if (strcmp(name, "gl_ObjectPlaneQ") == 0) {
|
||||||
tokens[0] = STATE_TEXGEN_OBJECT_Q;
|
tokens[0] = STATE_TEXGEN;
|
||||||
|
tokens[2] = STATE_TEXGEN_OBJECT_Q;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return -1; /* invalid array name */
|
return -1; /* invalid array name */
|
||||||
|
|||||||
@@ -570,6 +570,9 @@ void
|
|||||||
_swrast_choose_point(GLcontext *ctx)
|
_swrast_choose_point(GLcontext *ctx)
|
||||||
{
|
{
|
||||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||||
|
const GLfloat size = CLAMP(ctx->Point.Size,
|
||||||
|
ctx->Point.MinSize,
|
||||||
|
ctx->Point.MaxSize);
|
||||||
|
|
||||||
if (ctx->RenderMode == GL_RENDER) {
|
if (ctx->RenderMode == GL_RENDER) {
|
||||||
if (ctx->Point.PointSprite) {
|
if (ctx->Point.PointSprite) {
|
||||||
@@ -578,7 +581,7 @@ _swrast_choose_point(GLcontext *ctx)
|
|||||||
else if (ctx->Point.SmoothFlag) {
|
else if (ctx->Point.SmoothFlag) {
|
||||||
swrast->Point = smooth_point;
|
swrast->Point = smooth_point;
|
||||||
}
|
}
|
||||||
else if (ctx->Point.Size > 1.0 ||
|
else if (size > 1.0 ||
|
||||||
ctx->Point._Attenuated ||
|
ctx->Point._Attenuated ||
|
||||||
ctx->VertexProgram.PointSizeEnabled) {
|
ctx->VertexProgram.PointSizeEnabled) {
|
||||||
swrast->Point = large_point;
|
swrast->Point = large_point;
|
||||||
|
|||||||
@@ -1399,11 +1399,17 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write to renderbuffers
|
* Write to renderbuffers.
|
||||||
|
* Depending on glDrawBuffer() state and the which color outputs are
|
||||||
|
* written by the fragment shader, we may either replicate one color to
|
||||||
|
* all renderbuffers or write a different color to each renderbuffer.
|
||||||
|
* multiFragOutputs=TRUE for the later case.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
const GLuint numBuffers = fb->_NumColorDrawBuffers;
|
const GLuint numBuffers = fb->_NumColorDrawBuffers;
|
||||||
const GLboolean multiFragOutputs = numBuffers > 1;
|
const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
|
||||||
|
const GLboolean multiFragOutputs =
|
||||||
|
(fp && fp->Base.OutputsWritten >= (1 << FRAG_RESULT_DATA0));
|
||||||
GLuint buf;
|
GLuint buf;
|
||||||
|
|
||||||
for (buf = 0; buf < numBuffers; buf++) {
|
for (buf = 0; buf < numBuffers; buf++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user