Makefile | 9 bin/mklib | 91 ++++- configs/darwin | 23 - debian/changelog | 3 docs/fbdev-dri.html | 201 ++++++++---- docs/relnotes-7.0.3.html | 13 progs/demos/engine.c | 4 progs/xdemos/Makefile | 25 + progs/xdemos/glxinfo.c | 2 progs/xdemos/shape.c | 1 src/glut/mini/Makefile | 17 + src/glut/mini/glut.pc.in | 11 src/glx/x11/indirect_vertex_array.c | 8 src/mesa/drivers/dri/i965/brw_aub_playback.c | 7 src/mesa/drivers/dri/i965/brw_clip.c | 2 src/mesa/drivers/dri/i965/brw_clip_state.c | 4 src/mesa/drivers/dri/i965/brw_clip_tri.c | 2 src/mesa/drivers/dri/i965/brw_clip_util.c | 16 - src/mesa/drivers/dri/i965/brw_defines.h | 12 src/mesa/drivers/dri/i965/brw_eu.c | 3 src/mesa/drivers/dri/i965/brw_eu.h | 3 src/mesa/drivers/dri/i965/brw_eu_emit.c | 31 + src/mesa/drivers/dri/i965/brw_gs.c | 2 src/mesa/drivers/dri/i965/brw_misc_state.c | 33 +- src/mesa/drivers/dri/i965/brw_sf.c | 2 src/mesa/drivers/dri/i965/brw_sf_state.c | 3 src/mesa/drivers/dri/i965/brw_state.h | 1 src/mesa/drivers/dri/i965/brw_state_batch.c | 1 src/mesa/drivers/dri/i965/brw_state_upload.c | 2 src/mesa/drivers/dri/i965/brw_structs.h | 105 +++++- src/mesa/drivers/dri/i965/brw_urb.c | 8 src/mesa/drivers/dri/i965/brw_vs.c | 2 src/mesa/drivers/dri/i965/brw_vs_emit.c | 2 src/mesa/drivers/dri/i965/brw_wm.c | 3 src/mesa/drivers/dri/i965/bufmgr_fake.c | 3 src/mesa/drivers/dri/i965/intel_context.c | 3 src/mesa/drivers/dri/i965/intel_context.h | 2 src/mesa/drivers/dri/r300/r300_cmdbuf.c | 13 src/mesa/drivers/dri/r300/r300_context.h | 10 src/mesa/drivers/dri/r300/r300_ioctl.c | 4 src/mesa/drivers/dri/r300/r300_reg.h | 21 + src/mesa/drivers/dri/r300/r300_state.c | 63 +++ src/mesa/drivers/dri/radeon/radeon_chipset.h | 1 src/mesa/drivers/dri/radeon/radeon_screen.c | 10 src/mesa/drivers/x11/xm_dd.c | 256 ++++++++++------ src/mesa/glapi/gl_API.xml | 4 src/mesa/main/context.c | 7 src/mesa/main/texenvprogram.c | 4 src/mesa/main/texobj.c | 4 src/mesa/main/texstore.c | 1 src/mesa/main/version.h | 4 src/mesa/shader/arbprogparse.c | 2 src/mesa/shader/slang/library/slang_common_builtin.gc | 1 src/mesa/shader/slang/library/slang_common_builtin_gc.h | 83 ++--- src/mesa/swrast/s_drawpix.c | 8 src/mesa/swrast/s_pointtemp.h | 8 src/mesa/swrast/s_readpix.c | 11 src/mesa/vbo/vbo_exec.h | 3 src/mesa/vbo/vbo_exec_api.c | 31 + src/mesa/vbo/vbo_exec_array.c | 15 60 files changed, 891 insertions(+), 333 deletions(-)
New commits: commit eaac94c35af22606047dd22f8238406134a795c9 Author: Julien Cristau <[EMAIL PROTECTED]> Date: Fri Feb 22 12:16:27 2008 +0100 Update changelog. diff --git a/debian/changelog b/debian/changelog index cb2edef..34fbf40 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -mesa (7.0.2-5) UNRELEASED; urgency=low +mesa (7.0.3~rc2-1) UNRELEASED; urgency=low + * New upstream release candidate. * Stop building with -O0 on hppa. Bug #451047 should be fixed in recent gcc versions. commit 4716670de9d6c396883d1d7df2831efdc5362bdd Author: Brian <[EMAIL PROTECTED]> Date: Thu Feb 21 16:59:20 2008 -0700 prep for 7.0.3 rc-2 diff --git a/Makefile b/Makefile index 1da2d95..e905e41 100644 --- a/Makefile +++ b/Makefile @@ -166,10 +166,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-7.0.3-rc1 -LIB_NAME = MesaLib-7.0.3-rc1 -DEMO_NAME = MesaDemos-7.0.3-rc1 -GLUT_NAME = MesaGLUT-7.0.3-rc1 +DIRECTORY = Mesa-7.0.3-rc2 +LIB_NAME = MesaLib-7.0.3-rc2 +DEMO_NAME = MesaDemos-7.0.3-rc2 +GLUT_NAME = MesaGLUT-7.0.3-rc2 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ diff --git a/docs/relnotes-7.0.3.html b/docs/relnotes-7.0.3.html index 16cbaa0..c1b7b5e 100644 --- a/docs/relnotes-7.0.3.html +++ b/docs/relnotes-7.0.3.html @@ -8,7 +8,7 @@ <body bgcolor="#eeeeee"> -<H1>Mesa 7.0.3 Release Notes / January TBD, 2007</H1> +<H1>Mesa 7.0.3 Release Notes / February TBD, 2008</H1> <p> Mesa 7.0.3 is a stable release with bug fixes since version 7.0.2. diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index e8e7d90..12ca583 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -31,7 +31,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 0 #define MESA_PATCH 3 -#define MESA_VERSION_STRING "7.0.3-rc1" +#define MESA_VERSION_STRING "7.0.3-rc2" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) commit 33c5b380347f0922b1a8cf4d42a9192b00573c81 Author: Brian <[EMAIL PROTECTED]> Date: Wed Feb 20 09:39:59 2008 -0700 latest bug fixes diff --git a/docs/relnotes-7.0.3.html b/docs/relnotes-7.0.3.html index 4268f5d..16cbaa0 100644 --- a/docs/relnotes-7.0.3.html +++ b/docs/relnotes-7.0.3.html @@ -37,6 +37,8 @@ Mesa 7.0.3 is a stable release with bug fixes since version 7.0.2. <li>User-defined clip planes enabled for R300 (bug 9871) <li>Fixed glBindTexture() crash upon bad target (bug 14514) <li>Fixed potential crash in glDrawPixels(GL_DEPTH_COMPONENT) (bug 13915) +<li>Bad strings given to glProgramStringARB() didn't generate GL_INVALID_OPERATION +<li>Fixed minor point rasterization regression (bug 11016) </ul> commit 5737d6c5656ee50075973a3eeb8e863946701602 Author: Brian <[EMAIL PROTECTED]> Date: Wed Feb 20 09:38:16 2008 -0700 Fix point rasterization regression caused by commit 95a2eb97673fa3139218347a8eb2c1d34f585dbe Even-sized, non-AA points need 0.5 bias in position to hit the right pixels. Test program from bug report 11016 retested and is OK. diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h index 7dcc1fc..891ff22 100644 --- a/src/mesa/swrast/s_pointtemp.h +++ b/src/mesa/swrast/s_pointtemp.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.0.3 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -218,9 +218,9 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) } else { /* even size */ - xmin = (GLint) vert->win[0] - iRadius; + xmin = (GLint) (vert->win[0] + 0.5) - iRadius; xmax = xmin + iSize - 1; - ymin = (GLint) vert->win[1] - iRadius; + ymin = (GLint) (vert->win[1] + 0.5) - iRadius; ymax = ymin + iSize - 1; } #endif /*SMOOTH*/ commit 08a7f56c6ad8046e80d117ab1af3c46134366fbd Author: Brian <[EMAIL PROTECTED]> Date: Wed Feb 20 09:00:49 2008 -0700 raise GL_INVALID_OPERATION if glProgramString compilation fails cherry picked from master. diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index e787524..4de8ccf 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -3916,7 +3916,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, ASSERT(target == GL_VERTEX_PROGRAM_ARB); if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len, &ap)) { - /* Error in the program. Just return. */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramString(bad program)"); return; } commit 7916f2b4aaaeb2107abbfa1342a8b886f9a1e8ca Author: Brian <[EMAIL PROTECTED]> Date: Wed Feb 20 08:56:20 2008 -0700 Fix glBegin-time test for invalid programs/shaders. Cherry picked from master. diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index a9b01e0..9a9e892 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -162,4 +162,7 @@ void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, void vbo_exec_do_EvalCoord1f( struct vbo_exec_context *exec, GLfloat u); +extern GLboolean +vbo_validate_shaders(GLcontext *ctx); + #endif diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 2d4ded0..6812f88 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -477,6 +477,23 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) } +/** + * Check if programs/shaders are enabled and valid at glBegin time. + */ +GLboolean +vbo_validate_shaders(GLcontext *ctx) +{ + if ((ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) || + (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled)) { + return GL_FALSE; + } + if (ctx->Shader.CurrentProgram && !ctx->Shader.CurrentProgram->LinkStatus) { + return GL_FALSE; + } + return GL_TRUE; +} + + /* Build a list of primitives on the fly. Keep * ctx->Driver.CurrentExecPrimitive uptodate as well. */ @@ -491,18 +508,16 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) if (ctx->NewState) { _mesa_update_state( ctx ); - /* XXX also need to check if shader enabled, but invalid */ - if ((ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) || - (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBegin (invalid vertex/fragment program)"); - return; - } - CALL_Begin(ctx->Exec, (mode)); return; } + if (!vbo_validate_shaders(ctx)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBegin (invalid vertex/fragment program)"); + return; + } + /* Heuristic: attempt to isolate attributes occuring outside * begin/end pairs. */ diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 1e4c310..8f70e35 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -245,6 +245,11 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) if (ctx->NewState) _mesa_update_state( ctx ); + if (!vbo_validate_shaders(ctx)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawArrays(bad shader)"); + return; + } + bind_arrays( ctx ); prim[0].begin = 1; @@ -280,6 +285,11 @@ vbo_exec_DrawRangeElements(GLenum mode, if (ctx->NewState) _mesa_update_state( ctx ); + if (!vbo_validate_shaders(ctx)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawRangeElements(bad shader)"); + return; + } + bind_arrays( ctx ); ib.count = count; @@ -340,6 +350,11 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *ind if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) return; + if (!vbo_validate_shaders(ctx)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawElements(bad shader)"); + return; + } + if (ctx->Array.ElementArrayBufferObj->Name) { const GLvoid *map = ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, commit 193d303ac759fc41cdb7f82a681f1b0e5939d03b Author: Brian <[EMAIL PROTECTED]> Date: Tue Feb 19 08:46:39 2008 -0700 Added <size name="Get" mode="get"/> lines for point parameter tokens. Cherry picked from master diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index dc2e323..51be320 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -4529,15 +4529,19 @@ </enum> <enum name="POINT_SIZE_MIN" count="1" value="0x8126"> <size name="PointParameterfvEXT"/> + <size name="Get" mode="get"/> </enum> <enum name="POINT_SIZE_MAX" count="1" value="0x8127"> <size name="PointParameterfvEXT"/> + <size name="Get" mode="get"/> </enum> <enum name="POINT_FADE_THRESHOLD_SIZE" count="1" value="0x8128"> <size name="PointParameterfvEXT"/> + <size name="Get" mode="get"/> </enum> <enum name="POINT_DISTANCE_ATTENUATION" count="3" value="0x8129"> <size name="PointParameterfvEXT"/> + <size name="Get" mode="get"/> </enum> <enum name="GENERATE_MIPMAP" count="1" value="0x8191"> <size name="TexParameterfv"/> commit e70609b7b877dc0d8e67c958c453305e78f831df Author: Jeremy Huddleston <[EMAIL PROTECTED]> Date: Tue Feb 19 00:54:35 2008 -0800 Apple: Pulled in changes from Apple's patchset to allow mesa to build on darwin again diff --git a/bin/mklib b/bin/mklib index b216587..90bf834 100755 --- a/bin/mklib +++ b/bin/mklib @@ -624,19 +624,33 @@ case $ARCH in LIBSUFFIX="dylib" OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" fi - LINKNAME="lib${LIBNAME}.${LIBSUFFIX}" - LIBNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" + + if [ ${EXPORTS} ] ; then + OPTS="${OPTS} -exported_symbols_list ${EXPORTS}" + fi + + LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" + LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}" + LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}" # examine first object to determine ABI set ${OBJECTS} - ABI_PPC=`file $1 | grep 'object ppc'` - ABI_I386=`file $1 | grep 'object i386'` - if [ "${ABI_PPC}" ] ; then - OPTS="${OPTS} -arch ppc" - fi - if [ "${ABI_I386}" ] ; then - OPTS="${OPTS} -arch i386" - fi + ABI_PPC=`file $1 | grep ' ppc'` + ABI_I386=`file $1 | grep ' i386'` + ABI_PPC64=`file $1 | grep ' ppc64'` + ABI_X86_64=`file $1 | grep ' x86_64'` + if [ "${ABI_PPC}" ] ; then + OPTS="${OPTS} -arch ppc" + fi + if [ "${ABI_I386}" ] ; then + OPTS="${OPTS} -arch i386" + fi + if [ "${ABI_PPC64}" ] ; then + OPTS="${OPTS} -arch ppc64" + fi + if [ "${ABI_X86_64}" ] ; then + OPTS="${OPTS} -arch x86_64" + fi if [ "${ALTOPTS}" ] ; then OPTS=${ALTOPTS} @@ -653,9 +667,11 @@ case $ARCH in fi echo "mklib: Making Darwin shared library: " ${LIBNAME} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} ln -s ${LIBNAME} ${LINKNAME} - FINAL_LIBS="${LIBNAME} ${LINKNAME}" + ln -s ${LIBNAME} ${LINKNAME2} + FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}" fi ;; diff --git a/configs/darwin b/configs/darwin index 76f3f74..438abd9 100644 --- a/configs/darwin +++ b/configs/darwin @@ -4,11 +4,19 @@ include $(TOP)/configs/default CONFIG_NAME = darwin +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ + -D_BSD_SOURCE -D_GNU_SOURCE \ + -DGLX_INDIRECT_RENDERING \ + -DPTHREADS -DGLX_ALIAS_UNSUPPORTED -DHAVE_POSIX_MEMALIGN + # Compiler and flags -CC = cc -CXX = cc -CFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin -CXXFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin +CC = gcc +CXX = gcc +CFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES) +CXXFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES) + +CFLAGS += $(RC_CFLAGS) +CXXFLAGS += $(RC_CFLAGS) # Work around aliasing bugs - developers should comment this out CFLAGS += -fno-strict-aliasing @@ -21,13 +29,12 @@ GLUT_LIB_NAME = libglut.dylib GLW_LIB_NAME = libGLw.dylib OSMESA_LIB_NAME = libOSMesa.dylib -GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread +GL_LIB_DEPS = -L/usr/X11/lib -lX11 -lXext -lm -lpthread OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXmu -lXi -lXext GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib -APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm +APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11/lib -lX11 -lXmu -lXt -lXi -lm # omit glw lib for now: -SRC_DIRS = mesa glu glut/glx - +SRC_DIRS = glx/x11 glu glut/glx commit da476ff02dd357d9909a2df9891ee645f5f776a0 Author: Xiang, Haihao <[EMAIL PROTECTED]> Date: Tue Feb 19 15:59:50 2008 +0800 i965: new integrated graphics chipset support diff --git a/src/mesa/drivers/dri/i965/brw_aub_playback.c b/src/mesa/drivers/dri/i965/brw_aub_playback.c index 2433d50..99d9475 100644 --- a/src/mesa/drivers/dri/i965/brw_aub_playback.c +++ b/src/mesa/drivers/dri/i965/brw_aub_playback.c @@ -143,13 +143,15 @@ static struct { { CMD_CONST_BUFFER, "CONST_BUFFER", 1 }, { CMD_STATE_BASE_ADDRESS, "STATE_BASE_ADDRESS", 1 }, { CMD_STATE_INSN_POINTER, "STATE_INSN_POINTER", 1 }, - { CMD_PIPELINE_SELECT, "PIPELINE_SELECT", 0, }, + { CMD_PIPELINE_SELECT_965, "PIPELINE_SELECT", 0, }, + { CMD_PIPELINE_SELECT_IGD, "PIPELINE_SELECT", 0,}, { CMD_PIPELINED_STATE_POINTERS, "PIPELINED_STATE_POINTERS", 1 }, { CMD_BINDING_TABLE_PTRS, "BINDING_TABLE_PTRS", 1 }, { CMD_VERTEX_BUFFER, "VERTEX_BUFFER", 1 }, { CMD_VERTEX_ELEMENT, "VERTEX_ELEMENT", 1 }, { CMD_INDEX_BUFFER, "INDEX_BUFFER", 1 }, - { CMD_VF_STATISTICS, "VF_STATISTICS", 0 }, + { CMD_VF_STATISTICS_965, "VF_STATISTICS", 0 }, + { CMD_VF_STATISTICS_IGD, "VF_STATISTICS", 0 }, { CMD_DRAW_RECT, "DRAW_RECT", 1 }, { CMD_BLEND_CONSTANT_COLOR, "BLEND_CONSTANT_COLOR", 1 }, { CMD_CHROMA_KEY, "CHROMA_KEY", 1 }, @@ -157,6 +159,7 @@ static struct { { CMD_POLY_STIPPLE_OFFSET, "POLY_STIPPLE_OFFSET", 1 }, { CMD_POLY_STIPPLE_PATTERN, "POLY_STIPPLE_PATTERN", 1 }, { CMD_LINE_STIPPLE_PATTERN, "LINE_STIPPLE_PATTERN", 1 }, + { CMD_AA_LINE_PARAMETERS, "AA_LINE_PARAMETERS", 1}, { CMD_GLOBAL_DEPTH_OFFSET_CLAMP, "GLOBAL_DEPTH_OFFSET_CLAMP", 1 }, { CMD_PIPE_CONTROL, "PIPE_CONTROL", 1 }, { CMD_MI_FLUSH, "MI_FLUSH", 0 }, diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index 8287fd9..8f907be 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -60,7 +60,7 @@ static void compile_clip_prog( struct brw_context *brw, /* Begin the compilation: */ - brw_init_compile(&c.func); + brw_init_compile(brw, &c.func); c.func.single_program_flow = 1; diff --git a/src/mesa/drivers/dri/i965/brw_clip_state.c b/src/mesa/drivers/dri/i965/brw_clip_state.c index 1e6d6fa..37a25a9 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_state.c +++ b/src/mesa/drivers/dri/i965/brw_clip_state.c @@ -72,6 +72,10 @@ static void upload_clip_unit( struct brw_context *brw ) clip.clip5.viewport_xy_clip_enable = 1; clip.clip5.vertex_position_space = BRW_CLIP_NDCSPACE; clip.clip5.api_mode = BRW_CLIP_API_OGL; + + if (BRW_IS_IGD(brw)) + clip.clip5.negative_w_clip_test = 1; + clip.clip6.clipper_viewport_state_ptr = 0; clip.viewport_xmin = -1; clip.viewport_xmax = 1; diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c index e61f55c..fc484a7 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_util.c +++ b/src/mesa/drivers/dri/i965/brw_clip_util.c @@ -343,12 +343,14 @@ void brw_clip_init_clipmask( struct brw_clip_compile *c ) release_tmp(c, tmp); } - /* Test for -ve rhw workaround - */ - brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); - brw_AND(p, vec1(brw_null_reg()), incoming, brw_imm_ud(1<<20)); - brw_OR(p, c->reg.planemask, c->reg.planemask, brw_imm_ud(0x3f)); - brw_set_predicate_control(p, BRW_PREDICATE_NONE); + if (BRW_IS_IGD(p->brw)) { + /* Test for -ve rhw workaround + */ + brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); + brw_AND(p, vec1(brw_null_reg()), incoming, brw_imm_ud(1<<20)); + brw_OR(p, c->reg.planemask, c->reg.planemask, brw_imm_ud(0x3f)); + } + brw_set_predicate_control(p, BRW_PREDICATE_NONE); } diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index e8f878a..101828b 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -815,14 +815,16 @@ #define CMD_STATE_BASE_ADDRESS 0x6101 #define CMD_STATE_INSN_POINTER 0x6102 -#define CMD_PIPELINE_SELECT 0x6104 +#define CMD_PIPELINE_SELECT_965 0x6104 +#define CMD_PIPELINE_SELECT_IGD 0x6904 #define CMD_PIPELINED_STATE_POINTERS 0x7800 #define CMD_BINDING_TABLE_PTRS 0x7801 #define CMD_VERTEX_BUFFER 0x7808 #define CMD_VERTEX_ELEMENT 0x7809 #define CMD_INDEX_BUFFER 0x780a -#define CMD_VF_STATISTICS 0x780b +#define CMD_VF_STATISTICS_965 0x780b +#define CMD_VF_STATISTICS_IGD 0x680b #define CMD_DRAW_RECT 0x7900 #define CMD_BLEND_CONSTANT_COLOR 0x7901 @@ -832,6 +834,7 @@ #define CMD_POLY_STIPPLE_PATTERN 0x7907 #define CMD_LINE_STIPPLE_PATTERN 0x7908 #define CMD_GLOBAL_DEPTH_OFFSET_CLAMP 0x7909 +#define CMD_AA_LINE_PARAMETERS 0x790a #define CMD_PIPE_CONTROL 0x7a00 @@ -845,6 +848,9 @@ #define R02_PRIM_END 0x1 #define R02_PRIM_START 0x2 - +#define BRW_IS_IGD(brw) ((brw)->intel.intelScreen->deviceID == PCI_CHIP_IGD_GM) +#define CMD_PIPELINE_SELECT(brw) ((BRW_IS_IGD(brw)) ? CMD_PIPELINE_SELECT_IGD : CMD_PIPELINE_SELECT_965) +#define CMD_VF_STATISTICS(brw) ((BRW_IS_IGD(brw)) ? CMD_VF_STATISTICS_IGD : CMD_VF_STATISTICS_965) +#define URB_SIZES(brw) ((BRW_IS_IGD(brw)) ? 384 : 256) /* 512 bit unit */ #endif diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c index d1244be..b3ae4ee 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.c +++ b/src/mesa/drivers/dri/i965/brw_eu.c @@ -101,8 +101,9 @@ void brw_pop_insn_state( struct brw_compile *p ) /*********************************************************************** */ -void brw_init_compile( struct brw_compile *p ) +void brw_init_compile( struct brw_context *brw, struct brw_compile *p ) { + p->brw = brw; p->nr_insn = 0; p->current = p->stack; memset(p->current, 0, sizeof(p->current[0])); diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index 52f89d5..9d46aac 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -105,6 +105,7 @@ struct brw_compile { GLuint flag_value; GLboolean single_program_flow; + struct brw_context *brw; }; @@ -680,7 +681,7 @@ void brw_set_predicate_control_flag_value( struct brw_compile *p, GLuint value ) void brw_set_predicate_control( struct brw_compile *p, GLuint pc ); void brw_set_conditionalmod( struct brw_compile *p, GLuint conditional ); -void brw_init_compile( struct brw_compile *p ); +void brw_init_compile( struct brw_context *, struct brw_compile *p ); const GLuint *brw_get_program( struct brw_compile *p, GLuint *sz ); diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 9992b47..1c717e4 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -318,7 +318,8 @@ static void brw_set_dp_read_message( struct brw_instruction *insn, insn->bits3.dp_read.end_of_thread = end_of_thread; } -static void brw_set_sampler_message( struct brw_instruction *insn, +static void brw_set_sampler_message(struct brw_context *brw, + struct brw_instruction *insn, GLuint binding_table_index, GLuint sampler, GLuint msg_type, @@ -328,14 +329,24 @@ static void brw_set_sampler_message( struct brw_instruction *insn, { brw_set_src1(insn, brw_imm_d(0)); - insn->bits3.sampler.binding_table_index = binding_table_index; - insn->bits3.sampler.sampler = sampler; - insn->bits3.sampler.msg_type = msg_type; - insn->bits3.sampler.return_format = BRW_SAMPLER_RETURN_FORMAT_FLOAT32; - insn->bits3.sampler.response_length = response_length; - insn->bits3.sampler.msg_length = msg_length; - insn->bits3.sampler.end_of_thread = eot; - insn->bits3.sampler.msg_target = BRW_MESSAGE_TARGET_SAMPLER; + if (BRW_IS_IGD(brw)) { + insn->bits3.sampler_igd.binding_table_index = binding_table_index; + insn->bits3.sampler_igd.sampler = sampler; + insn->bits3.sampler_igd.msg_type = msg_type; + insn->bits3.sampler_igd.response_length = response_length; + insn->bits3.sampler_igd.msg_length = msg_length; + insn->bits3.sampler_igd.end_of_thread = eot; + insn->bits3.sampler_igd.msg_target = BRW_MESSAGE_TARGET_SAMPLER; + } else { + insn->bits3.sampler.binding_table_index = binding_table_index; + insn->bits3.sampler.sampler = sampler; + insn->bits3.sampler.msg_type = msg_type; + insn->bits3.sampler.return_format = BRW_SAMPLER_RETURN_FORMAT_FLOAT32; + insn->bits3.sampler.response_length = response_length; + insn->bits3.sampler.msg_length = msg_length; + insn->bits3.sampler.end_of_thread = eot; + insn->bits3.sampler.msg_target = BRW_MESSAGE_TARGET_SAMPLER; + } } @@ -985,7 +996,7 @@ void brw_SAMPLE(struct brw_compile *p, brw_set_dest(insn, dest); brw_set_src0(insn, src0); - brw_set_sampler_message(insn, + brw_set_sampler_message(p->brw, insn, binding_table_index, sampler, msg_type, diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index 73263a5..119d07d 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -65,7 +65,7 @@ static void compile_gs_prog( struct brw_context *brw, /* Begin the compilation: */ - brw_init_compile(&c.func); + brw_init_compile(brw, &c.func); c.func.single_program_flow = 1; diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index d577968..fe476c9 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -249,7 +249,7 @@ static void upload_depthbuffer(struct brw_context *brw) memset(&bd, 0, sizeof(bd)); bd.header.bits.opcode = CMD_DEPTH_BUFFER; - bd.header.bits.length = sizeof(bd)/4-2; + bd.header.bits.length = BRW_IS_IGD(brw) ? (sizeof(bd)/4-2) : (sizeof(bd)/4-3); bd.dword1.bits.pitch = (region->pitch * region->cpp) - 1; switch (region->cpp) { @@ -359,6 +359,33 @@ const struct brw_tracked_state brw_polygon_stipple_offset = { .update = upload_polygon_stipple_offset }; +/********************************************************************** + * AA Line parameters + */ +static void upload_aa_line_parameters(struct brw_context *brw) +{ + struct brw_aa_line_parameters balp; + + if (!BRW_IS_IGD(brw)) + return; + + /* use legacy aa line coverage computation */ + memset(&balp, 0, sizeof(balp)); + balp.header.opcode = CMD_AA_LINE_PARAMETERS; + balp.header.length = sizeof(balp) / 4 - 2; + + BRW_CACHED_BATCH_STRUCT(brw, &balp); +} + +const struct brw_tracked_state brw_aa_line_parameters = { + .dirty = { + .mesa = 0, + .brw = BRW_NEW_CONTEXT, + .cache = 0 + }, + .update = upload_aa_line_parameters +}; + /*********************************************************************** * Line stipple packet */ @@ -441,7 +468,7 @@ static void upload_invarient_state( struct brw_context *brw ) struct brw_pipeline_select ps; memset(&ps, 0, sizeof(ps)); - ps.header.opcode = CMD_PIPELINE_SELECT; + ps.header.opcode = CMD_PIPELINE_SELECT(brw); ps.header.pipeline_select = 0; BRW_BATCH_STRUCT(brw, &ps); } @@ -477,7 +504,7 @@ static void upload_invarient_state( struct brw_context *brw ) struct brw_vf_statistics vfs; memset(&vfs, 0, sizeof(vfs)); - vfs.opcode = CMD_VF_STATISTICS; + vfs.opcode = CMD_VF_STATISTICS(brw); if (INTEL_DEBUG & DEBUG_STATS) vfs.statistics_enable = 1; diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c index df18a48..6dcfa62 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.c +++ b/src/mesa/drivers/dri/i965/brw_sf.c @@ -57,7 +57,7 @@ static void compile_sf_prog( struct brw_context *brw, /* Begin the compilation: */ - brw_init_compile(&c.func); + brw_init_compile(brw, &c.func); c.key = *key; c.nr_attrs = brw_count_bits(c.key.attrs); diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index bfac52d..2fd75a0 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -185,7 +185,8 @@ static void upload_sf_unit( struct brw_context *brw ) sf.sf6.point_rast_rule = 1; /* opengl conventions */ sf.sf7.point_size = brw->attribs.Point->_Size * (1<<3); sf.sf7.use_point_size_state = !brw->attribs.Point->_Attenuated; - + sf.sf7.aa_line_distance_mode = 0; + /* might be BRW_NEW_PRIMITIVE if we have to adjust pv for polygons: */ sf.sf7.trifan_pv = 2; diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index b4cbdd7..41ac095 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -50,6 +50,7 @@ const struct brw_tracked_state brw_gs_prog; const struct brw_tracked_state brw_gs_unit; const struct brw_tracked_state brw_drawing_rect; const struct brw_tracked_state brw_line_stipple; +const struct brw_tracked_state brw_aa_line_parameters; const struct brw_tracked_state brw_pipelined_state_pointers; const struct brw_tracked_state brw_binding_table_pointers; const struct brw_tracked_state brw_depthbuffer; diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c b/src/mesa/drivers/dri/i965/brw_state_batch.c index 909b0ac..c93d66a 100644 --- a/src/mesa/drivers/dri/i965/brw_state_batch.c +++ b/src/mesa/drivers/dri/i965/brw_state_batch.c @@ -103,6 +103,7 @@ static void clear_batch_cache( struct brw_context *brw ) void brw_clear_batch_cache_flush( struct brw_context *brw ) { + bmFinishFenceLock(&(brw->intel), bmSetFenceLock(&(brw->intel))); clear_batch_cache(brw); brw->wrap = 0; diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 92c07c2..9bd2881 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -92,7 +92,7 @@ const struct brw_tracked_state *atoms[] = &brw_polygon_stipple_offset, &brw_line_stipple, - + &brw_aa_line_parameters, /* Ordering of the commands below is documented as fixed. */ #if 0 diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h index 10fee94..a799122 100644 --- a/src/mesa/drivers/dri/i965/brw_structs.h +++ b/src/mesa/drivers/dri/i965/brw_structs.h @@ -141,7 +141,8 @@ struct brw_depthbuffer struct { GLuint pitch:18; GLuint format:3; - GLuint pad:4; + GLuint pad:2; + GLuint software_tiled_rendering_mode:2; GLuint depth_offset_disable:1; GLuint tile_walk:1; GLuint tiled_surface:1; @@ -166,12 +167,20 @@ struct brw_depthbuffer union { struct { - GLuint pad:12; - GLuint min_array_element:9; + GLuint pad:10; + GLuint min_array_element:11; GLuint depth:11; } bits; GLuint dword; } dword4; + + union { + struct { + GLuint xoffset:16; + GLuint yoffset:16; + } bits; + GLuint dword; + } dword5; /* NEW in Integrated Graphics Device */ }; struct brw_drawrect @@ -213,6 +222,25 @@ struct brw_indexbuffer GLuint buffer_end; }; +/* NEW in Integrated Graphics Device */ +struct brw_aa_line_parameters +{ + struct header header; + + struct { + GLuint aa_coverage_scope:8; + GLuint pad0:8; + GLuint aa_coverage_bias:8; + GLuint pad1:8; + } bits0; + + struct { + GLuint aa_coverage_endcap_slope:8; + GLuint pad0:8; + GLuint aa_coverage_endcap_bias:8; + GLuint pad1:8; + } bits1; +}; struct brw_line_stipple { @@ -315,7 +343,8 @@ struct brw_pipe_control { GLuint length:8; GLuint notify_enable:1; - GLuint pad:2; + GLuint texture_cache_flush_enable:1; + GLuint indirect_state_pointers_disable:1; GLuint instruction_state_cache_flush_enable:1; GLuint write_cache_flush_enable:1; GLuint depth_stall_enable:1; @@ -547,8 +576,8 @@ struct brw_clip_unit_state GLuint pad1:1; GLuint urb_entry_allocation_size:5; GLuint pad2:1; - GLuint max_threads:1; /* may be less */ - GLuint pad3:6; + GLuint max_threads:5; /* may be less */ + GLuint pad3:2; } thread4; struct @@ -557,7 +586,7 @@ struct brw_clip_unit_state GLuint clip_mode:3; GLuint userclip_enable_flags:8; GLuint userclip_must_clip:1; - GLuint pad1:1; + GLuint negative_w_clip_test:1; GLuint guard_band_enable:1; GLuint viewport_z_clip_enable:1; GLuint viewport_xy_clip_enable:1; @@ -724,7 +753,8 @@ struct brw_sf_unit_state GLuint use_point_size_state:1; GLuint subpixel_precision:1; GLuint sprite_point:1; - GLuint pad0:11; + GLuint pad0:10; + GLuint aa_line_distance_mode:1; GLuint trifan_pv:2; GLuint linestrip_pv:2; GLuint tristrip_pv:2; @@ -749,8 +779,8 @@ struct brw_gs_unit_state GLuint pad1:1; GLuint urb_entry_allocation_size:5; GLuint pad2:1; - GLuint max_threads:1; - GLuint pad3:6; + GLuint max_threads:5; + GLuint pad3:2; } thread4; struct @@ -764,9 +794,14 @@ struct brw_gs_unit_state struct { GLuint max_vp_index:4; - GLuint pad0:26; - GLuint reorder_enable:1; + GLuint pad0:12; + GLuint svbi_post_inc_value:10; GLuint pad1:1; + GLuint svbi_post_inc_enable:1; + GLuint svbi_payload:1; + GLuint discard_adjaceny:1; + GLuint reorder_enable:1; + GLuint pad2:1; } gs6; }; @@ -786,8 +821,8 @@ struct brw_vs_unit_state GLuint pad1:1; GLuint urb_entry_allocation_size:5; GLuint pad2:1; - GLuint max_threads:4; - GLuint pad3:3; + GLuint max_threads:6; + GLuint pad3:1; } thread4; struct @@ -815,7 +850,7 @@ struct brw_wm_unit_state struct { GLuint stats_enable:1; - GLuint pad0:1; + GLuint depth_buffer_clear:1; GLuint sampler_count:3; GLuint sampler_state_pointer:27; } wm4; @@ -825,7 +860,9 @@ struct brw_wm_unit_state GLuint enable_8_pix:1; GLuint enable_16_pix:1; GLuint enable_32_pix:1; - GLuint pad0:7; + GLuint enable_con_32_pix:1; + GLuint enable_con_64_pix:1; + GLuint pad0:5; GLuint legacy_global_depth_bias:1; GLuint line_stipple:1; GLuint depth_offset:1; -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]