From 796c96de808790826d9c9077d159390ebee62888 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Fri, 11 Sep 2009 01:28:34 +0300 Subject: radeon: Remove structure allocation from iterator variable. dma_bo varaible is only used for iterating so allocating memory for it only causes memory leaks. --- src/mesa/drivers/dri/radeon/radeon_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c index 2eefa3f2b1..c9a32c808b 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__); -- cgit v1.2.3 From 0fa1692f14f4a64b045bc3f26a5ab401d682b118 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 11 Sep 2009 08:04:37 -0600 Subject: mesa: raise GL_INVALID_ENUM not GL_INVALID_VALUE for glTexParamter errors Signed-off-by: Brian Paul --- src/mesa/main/texparam.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index e60ab6aa12..35c3c920e7 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -69,7 +69,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; } @@ -209,7 +209,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; @@ -224,7 +224,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; -- cgit v1.2.3 From d81086a86bd7c82eae5a8f0d1092a30c23626257 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Sep 2009 13:39:14 -0600 Subject: llvmpipe: asst fixes for 'make linux-llvmpipe' --- src/gallium/drivers/llvmpipe/Makefile | 2 ++ src/gallium/winsys/xlib/Makefile | 1 + src/gallium/winsys/xlib/xlib_llvmpipe.c | 3 +++ 3 files changed, 6 insertions(+) diff --git a/src/gallium/drivers/llvmpipe/Makefile b/src/gallium/drivers/llvmpipe/Makefile index 6e63a0c2b7..5ac09de79e 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/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index 522f6dc5ae..3a1945d92c 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 bc876591c0..3dd15e099b 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 */ -- cgit v1.2.3 From 280933f793d45a5d6a72d56c422ca045abbdb1c2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Sep 2009 13:43:51 -0600 Subject: docs: mention the new Gallium llvmpipe driver --- docs/relnotes-7.6.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/relnotes-7.6.html b/docs/relnotes-7.6.html index 8a476378e8..9cd3417e7e 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.
  • Added configure --with-max-width=W, --with-max-height=H options to specify max framebuffer, viewport size. +
  • 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. -- cgit v1.2.3 From 9c8b69302c2509d9ec8d6f87b7d1c34b6e215227 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Sat, 12 Sep 2009 09:27:01 -0700 Subject: Use CFLAGS as HOST_CFLAGS by default Unless we're cross compiling, the HOST_CFLAGS should be the same as the normal CFLAGS. This allows the x86 and x86_64 asm to be built correctly with a native compiler using -m32/-m64. Signed-off-by: Dan Nicholson --- configs/default | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/default b/configs/default index 773a6204d3..7547703c56 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 -- cgit v1.2.3 From 1402ea8f3984e5d8659ff2d923d438ecbf79042e Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 14 Sep 2009 11:48:51 -0600 Subject: configure: fix comment --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 63cc27eec9..fe54dd5753 100644 --- a/configure.ac +++ b/configure.ac @@ -1188,7 +1188,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], -- cgit v1.2.3 From 2729db89763743b4266520355b24c34d3e332a80 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 14 Sep 2009 11:50:48 -0600 Subject: gallium: Add Mac OS to pipe/p_thread.h. Mac OS also has POSIX threads. --- src/gallium/include/pipe/p_thread.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/include/pipe/p_thread.h b/src/gallium/include/pipe/p_thread.h index b1606dc652..25e4148232 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 /* POSIX threads headers */ #include /* 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); -- cgit v1.2.3 From b8b774c775b672c89f1f4007c7b9575052d85739 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 14 Sep 2009 17:24:25 -0600 Subject: glsl: remove extra #version directives from concatenated shader sources When we concatenate shaders to do our form of poor-man linking, if there's multiple #version directives, preprocessing fails. This change disables the extra #version directives by changing the first two chars to //. This should help with some Wine issues such as bug 23946. --- src/mesa/shader/slang/slang_link.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 387659ff30..3617ce1fb6 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -540,6 +540,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; + } + } +} + /** @@ -587,6 +613,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; -- cgit v1.2.3 From 3129b2403e8430304c054611eebe709ed8b2ed97 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 14 Sep 2009 17:27:47 -0600 Subject: docs: document linker/preprocessor bug fix --- docs/relnotes-7.5.2.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/relnotes-7.5.2.html b/docs/relnotes-7.5.2.html index 32100142c0..ecdab29d5f 100644 --- a/docs/relnotes-7.5.2.html +++ b/docs/relnotes-7.5.2.html @@ -45,6 +45,8 @@ tbd
    • Assorted bug fixes for i965/i945 drivers
    • Fixed Gallium glDrawPixels(GL_STENCIL_INDEX) failure. +
    • Fixed GLSL linker/preprocessor version directive issue seen in Wine + (such as bug 23946)
    -- cgit v1.2.3 From ac3c8e3b53564b659e2ccaf8274b888f1e254511 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 14 Sep 2009 17:32:03 -0600 Subject: glsl: added some link debug code (disabled) --- src/mesa/shader/shader_api.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index c36fc271a0..4d5d1bef3d 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1471,6 +1471,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); + } + } } -- cgit v1.2.3 From 799631acb18be93afab29e27241cde3780672e98 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 14 Sep 2009 17:48:17 -0600 Subject: progs/vp: print program and error info when program does not compile --- progs/vp/vp-tris.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index 97995accdd..1356242d97 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)); } -- cgit v1.2.3 From 2b992dc327e02a412c0cc8c5d015ac534114848c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 15 Sep 2009 09:36:31 -0600 Subject: gl: restore some PFNGL typedefs Commit d33c315d9e32584dea12cea683795b498a9f5eca removed a few too many typedefs. We need the typedefs in glext.h which are protected by #ifdef GL_VERSION_1_2 but we can exclude the ones protected by GL_VERSION_1_2_DEPRECATED. --- include/GL/gl.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/GL/gl.h b/include/GL/gl.h index 05362b9776..5f8bc2b708 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) */ -- cgit v1.2.3