Here's a patch for i915 that switches it over to texenvprogram.c for its
program generation and enables crossbar. Only minimal testing so far,
and the patch is against mesa 6.4. Any feedback appreciated.
Keith
? diff
? f1
? f2
? full.diff
? render.diff
Index: i915_context.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i915/i915_context.c,v
retrieving revision 1.11
diff -u -r1.11 i915_context.c
--- i915_context.c 28 Jul 2005 00:29:51 -0000 1.11
+++ i915_context.c 26 May 2006 13:41:51 -0000
@@ -50,6 +50,7 @@
{ "GL_ARB_depth_texture", NULL },
{ "GL_ARB_fragment_program", NULL },
{ "GL_ARB_shadow", NULL },
+ { "GL_ARB_texture_env_crossbar", NULL },
{ "GL_EXT_shadow_funcs", NULL },
/* ARB extn won't work if not enabled */
{ "GL_SGIX_depth_texture", NULL },
@@ -164,6 +165,7 @@
I915_MAX_TEX_INSN);
ctx->Const.MaxFragmentProgramTexIndirections = I915_MAX_TEX_INDIRECT;
ctx->Const.MaxFragmentProgramAddressRegs = 0; /* I don't think we have one */
+ ctx->_MaintainTexEnvProgram = 1;
driInitExtensions( ctx, i915_extensions, GL_FALSE );
Index: i915_fragprog.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i915/i915_fragprog.c,v
retrieving revision 1.9.2.1
diff -u -r1.9.2.1 i915_fragprog.c
--- i915_fragprog.c 22 Nov 2005 12:29:18 -0000 1.9.2.1
+++ i915_fragprog.c 26 May 2006 13:41:52 -0000
@@ -720,7 +720,7 @@
break;
case FP_OPCODE_TXP:
- EMIT_TEX( T0_TEXLDP );
+ EMIT_TEX( T0_TEXLDP );
break;
case FP_OPCODE_XPD:
@@ -956,6 +956,17 @@
GLuint s2 = S2_TEXCOORD_NONE;
int i, offset = 0;
+ if (i915->current_program != p)
+ {
+ if (i915->current_program) {
+ i915->current_program->on_hardware = 0;
+ i915->current_program->params_uptodate = 0;
+ }
+
+ i915->current_program = p;
+ }
+
+
/* Important:
*/
VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;
Index: i915_texprog.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i915/i915_texprog.c,v
retrieving revision 1.4
diff -u -r1.4 i915_texprog.c
--- i915_texprog.c 6 Jan 2005 14:35:44 -0000 1.4
+++ i915_texprog.c 26 May 2006 13:41:52 -0000
@@ -589,6 +589,11 @@
intel->specoffset = 0;
offset = 0;
+ if (i915->current_program) {
+ i915->current_program->on_hardware = 0;
+ i915->current_program->params_uptodate = 0;
+ }
+
if (i915->vertex_fog == I915_FOG_PIXEL) {
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16 );
index &= ~_TNL_BIT_FOG;
Index: i915_vtbl.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c,v
retrieving revision 1.5
diff -u -r1.5 i915_vtbl.c
--- i915_vtbl.c 10 May 2005 11:38:56 -0000 1.5
+++ i915_vtbl.c 26 May 2006 13:41:52 -0000
@@ -48,8 +48,10 @@
if (ctx->FragmentProgram._Active)
i915ValidateFragmentProgram( i915 );
- else
+ else {
+ assert(!ctx->_MaintainTexEnvProgram);
i915ValidateTextureProgram( i915 );
+ }
}