summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-15 09:47:35 -0600
committerBrian Paul <[email protected]>2009-09-15 09:47:35 -0600
commit41bbc8395111c6ef37e08a63ee58876d10a09e77 (patch)
treeff42e8359e3894b99da66599f9dc8ef44d9d3307
parentc0cf9dc05e2d887ce6419e6cae1b3606a1779b3f (diff)
parent5d526ed21ac9f1ec9220c2adb4c905893eb9d990 (diff)
Merge branch 'mesa_7_6_branch'
-rw-r--r--configs/default1
-rw-r--r--configure.ac2
-rw-r--r--docs/relnotes-7.5.2.html2
-rw-r--r--docs/relnotes-7.6.html4
-rw-r--r--include/GL/gl.h15
-rw-r--r--progs/vp/vp-tris.c6
-rw-r--r--src/gallium/drivers/llvmpipe/Makefile2
-rw-r--r--src/gallium/include/pipe/p_thread.h10
-rw-r--r--src/gallium/winsys/xlib/Makefile1
-rw-r--r--src/gallium/winsys/xlib/xlib_llvmpipe.c3
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_dma.c2
-rw-r--r--src/mesa/main/texparam.c6
-rw-r--r--src/mesa/shader/shader_api.c15
-rw-r--r--src/mesa/shader/slang/slang_link.c28
14 files changed, 87 insertions, 10 deletions
diff --git a/configs/default b/configs/default
index 9e4bb08ea9e..cb3ca1046f4 100644
--- a/configs/default
+++ b/configs/default
@@ -23,6 +23,7 @@ HOST_CC = $(CC)
CFLAGS = -O
CXXFLAGS = -O
LDFLAGS =
+HOST_CFLAGS = $(CFLAGS)
GLU_CFLAGS =
# Compiler for building demos/tests/etc
diff --git a/configure.ac b/configure.ac
index c5ef676e2e5..75189761ee7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1202,7 +1202,7 @@ if test "x$enable_gallium_radeon" = xyes; then
fi
dnl
-dnl Gallium Radeon configuration
+dnl Gallium Nouveau configuration
dnl
AC_ARG_ENABLE([gallium-nouveau],
[AS_HELP_STRING([--enable-gallium-nouveau],
diff --git a/docs/relnotes-7.5.2.html b/docs/relnotes-7.5.2.html
index 32100142c0c..ecdab29d5f7 100644
--- a/docs/relnotes-7.5.2.html
+++ b/docs/relnotes-7.5.2.html
@@ -45,6 +45,8 @@ tbd
<ul>
<li>Assorted bug fixes for i965/i945 drivers
<li>Fixed Gallium glDrawPixels(GL_STENCIL_INDEX) failure.
+<li>Fixed GLSL linker/preprocessor version directive issue seen in Wine
+ (such as bug 23946)
</ul>
diff --git a/docs/relnotes-7.6.html b/docs/relnotes-7.6.html
index 8a476378e8a..9cd3417e7ea 100644
--- a/docs/relnotes-7.6.html
+++ b/docs/relnotes-7.6.html
@@ -57,6 +57,10 @@ This was written by Zack Rusin at Tungsten Graphics.
GL_ARB_fragment_program.</li>
<li>Added configure --with-max-width=W, --with-max-height=H options to specify
max framebuffer, viewport size.
+<li>Initial version of Gallium llvmpipe driver. This is a new driver based
+ on LLVM which makes exensive use of run-time code generation. This is
+ an "alpha" stage driver. See the src/gallium/drivers/llvmpipe/README
+ file for more information.
</ul>
diff --git a/include/GL/gl.h b/include/GL/gl.h
index 05362b97762..5f8bc2b708c 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -1740,6 +1740,9 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+
/*
@@ -1945,6 +1948,18 @@ GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+
+
+
/*
* GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
*/
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c
index 97995accdd1..1356242d971 100644
--- a/progs/vp/vp-tris.c
+++ b/progs/vp/vp-tris.c
@@ -119,6 +119,12 @@ static void Init( void )
glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
sz, (const GLubyte *) buf);
+ if (glGetError()) {
+ printf("Program failed to compile:\n%s\n", buf);
+ printf("Error: %s\n",
+ (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ exit(1);
+ }
assert(glIsProgramARB(prognum));
}
diff --git a/src/gallium/drivers/llvmpipe/Makefile b/src/gallium/drivers/llvmpipe/Makefile
index 06c586e6bb9..cd7b6356d28 100644
--- a/src/gallium/drivers/llvmpipe/Makefile
+++ b/src/gallium/drivers/llvmpipe/Makefile
@@ -3,6 +3,8 @@ include $(TOP)/configs/current
LIBNAME = llvmpipe
+CFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
+
C_SOURCES = \
lp_bld_alpha.c \
lp_bld_arit.c \
diff --git a/src/gallium/include/pipe/p_thread.h b/src/gallium/include/pipe/p_thread.h
index b1606dc6526..25e41482325 100644
--- a/src/gallium/include/pipe/p_thread.h
+++ b/src/gallium/include/pipe/p_thread.h
@@ -39,7 +39,7 @@
#include "util/u_debug.h" /* for assert */
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
#include <pthread.h> /* POSIX threads headers */
#include <stdio.h> /* for perror() */
@@ -213,7 +213,7 @@ typedef unsigned pipe_condvar;
*/
typedef struct {
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
pthread_key_t key;
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
DWORD key;
@@ -228,7 +228,7 @@ typedef struct {
static INLINE void
pipe_tsd_init(pipe_tsd *tsd)
{
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
perror("pthread_key_create(): failed to allocate key for thread specific data");
exit(-1);
@@ -245,7 +245,7 @@ pipe_tsd_get(pipe_tsd *tsd)
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
return pthread_getspecific(tsd->key);
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
assert(0);
@@ -262,7 +262,7 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
if (pthread_setspecific(tsd->key, value) != 0) {
perror("pthread_set_specific() failed");
exit(-1);
diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile
index 522f6dc5aee..3a1945d92c5 100644
--- a/src/gallium/winsys/xlib/Makefile
+++ b/src/gallium/winsys/xlib/Makefile
@@ -34,6 +34,7 @@ XLIB_WINSYS_SOURCES = \
xlib_brw_aub.c \
xlib_brw_context.c \
xlib_brw_screen.c \
+ xlib_llvmpipe.c \
xlib_softpipe.c \
xlib_trace.c
diff --git a/src/gallium/winsys/xlib/xlib_llvmpipe.c b/src/gallium/winsys/xlib/xlib_llvmpipe.c
index bc876591c0d..3dd15e099b0 100644
--- a/src/gallium/winsys/xlib/xlib_llvmpipe.c
+++ b/src/gallium/winsys/xlib/xlib_llvmpipe.c
@@ -33,6 +33,8 @@
*/
+#if defined(GALLIUM_LLVMPIPE)
+
#include "xm_api.h"
#undef ASSERT
@@ -459,3 +461,4 @@ struct xm_driver xlib_llvmpipe_driver =
+#endif /* GALLIUM_LLVMPIPE */
diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c
index 2eefa3f2b1b..c9a32c808be 100644
--- a/src/mesa/drivers/dri/radeon/radeon_dma.c
+++ b/src/mesa/drivers/dri/radeon/radeon_dma.c
@@ -263,7 +263,7 @@ void radeonAllocDmaRegion(radeonContextPtr rmesa,
void radeonFreeDmaRegions(radeonContextPtr rmesa)
{
- struct radeon_dma_bo *dma_bo = CALLOC_STRUCT(radeon_dma_bo);
+ struct radeon_dma_bo *dma_bo;
struct radeon_dma_bo *temp;
if (RADEON_DEBUG & RADEON_DMA)
fprintf(stderr, "%s\n", __FUNCTION__);
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 05d144270ec..b2fbe2205ba 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -70,7 +70,7 @@ validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap)
return GL_TRUE;
}
- _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param=0x%x)", wrap );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(param=0x%x)", wrap );
return GL_FALSE;
}
@@ -210,7 +210,7 @@ set_tex_parameteri(GLcontext *ctx,
}
/* fall-through */
default:
- _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param=0x%x)",
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(param=0x%x)",
params[0] );
}
return GL_FALSE;
@@ -225,7 +225,7 @@ set_tex_parameteri(GLcontext *ctx,
texObj->MagFilter = params[0];
return GL_TRUE;
default:
- _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param=0x%x)",
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(param=0x%x)",
params[0]);
}
return GL_FALSE;
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 54a25dfaf07..178b7d0dbaf 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -1474,6 +1474,21 @@ _mesa_link_program(GLcontext *ctx, GLuint program)
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
_slang_link(ctx, program, shProg);
+
+ /* debug code */
+ if (0) {
+ GLuint i;
+
+ _mesa_printf("Link %u shaders in program %u: %s\n",
+ shProg->NumShaders, shProg->Name,
+ shProg->LinkStatus ? "Success" : "Failed");
+
+ for (i = 0; i < shProg->NumShaders; i++) {
+ _mesa_printf(" shader %u, type 0x%x\n",
+ shProg->Shaders[i]->Name,
+ shProg->Shaders[i]->Type);
+ }
+ }
}
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 169c07f8cea..8f2b40d5dfb 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -546,6 +546,32 @@ _slang_update_inputs_outputs(struct gl_program *prog)
+/**
+ * Remove extra #version directives from the concatenated source string.
+ * Disable the extra ones by converting first two chars to //, a comment.
+ * This is a bit of hack to work around a preprocessor bug that only
+ * allows one #version directive per source.
+ */
+static void
+remove_extra_version_directives(GLchar *source)
+{
+ GLuint verCount = 0;
+ while (1) {
+ char *ver = _mesa_strstr(source, "#version");
+ if (ver) {
+ verCount++;
+ if (verCount > 1) {
+ ver[0] = '/';
+ ver[1] = '/';
+ }
+ source += 8;
+ }
+ else {
+ break;
+ }
+ }
+}
+
/**
@@ -593,6 +619,8 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType)
_mesa_printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source);
*/
+ remove_extra_version_directives(source);
+
newShader = CALLOC_STRUCT(gl_shader);
newShader->Type = shaderType;
newShader->Source = source;