SHA256
1
0
forked from pool/Mesa
Mesa/i915-crossbar.diff

126 lines
4.2 KiB
Diff
Raw Normal View History

Index: src/mesa/drivers/dri/i915/i915_context.h
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i915/i915_context.h,v
retrieving revision 1.7
diff -u -r1.7 i915_context.h
--- src/mesa/drivers/dri/i915/i915_context.h 18 Aug 2006 09:04:48 -0000 1.7
+++ src/mesa/drivers/dri/i915/i915_context.h 16 Sep 2006 02:07:05 -0000
@@ -170,7 +176,7 @@
/* Helpers for i915_texprog.c:
*/
- GLuint src_texture; /* Reg containing sampled texture color,
+ GLuint src_texture[8]; /* Reg containing sampled texture color,
* else UREG_BAD.
*/
Index: src/mesa/drivers/dri/i915/i915_program.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i915/i915_program.c,v
retrieving revision 1.6
diff -u -r1.6 i915_program.c
--- src/mesa/drivers/dri/i915/i915_program.c 18 Aug 2006 09:04:48 -0000 1.6
+++ src/mesa/drivers/dri/i915/i915_program.c 16 Sep 2006 02:07:09 -0000
@@ -405,7 +422,7 @@
p->depth_written = 0;
p->nr_params = 0;
- p->src_texture = UREG_BAD;
+ for (int u = 0; u < 8; u++) p->src_texture[u] = UREG_BAD;
p->src_previous = UREG(REG_TYPE_T, T_DIFFUSE);
p->last_tex_stage = 0;
p->VB = &tnl->vb;
Index: src/mesa/drivers/dri/i915/i915_texprog.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i915/i915_texprog.c,v
retrieving revision 1.6
diff -u -r1.6 i915_texprog.c
--- src/mesa/drivers/dri/i915/i915_texprog.c 11 Apr 2006 11:41:11 -0000 1.6
+++ src/mesa/drivers/dri/i915/i915_texprog.c 16 Sep 2006 02:07:09 -0000
@@ -55,8 +55,18 @@
GLenum src, GLuint unit )
{
switch (src) {
+ /* Crossbar: */
+ case GL_TEXTURE0:
+ case GL_TEXTURE1:
+ case GL_TEXTURE2:
+ case GL_TEXTURE3:
+ case GL_TEXTURE4:
+ case GL_TEXTURE5:
+ case GL_TEXTURE6:
+ case GL_TEXTURE7:
+ unit = src - GL_TEXTURE0;
case GL_TEXTURE:
- if (p->src_texture == UREG_BAD) {
+ if (p->src_texture[unit] == UREG_BAD) {
/* TODO: Use D0_CHANNEL_XY where possible.
*/
@@ -69,23 +79,10 @@
if (p->VB->TexCoordPtr[unit]->size == 4)
op = T0_TEXLDP;
- p->src_texture = i915_emit_texld( p, tmp, A0_DEST_CHANNEL_ALL,
+ p->src_texture[unit] = i915_emit_texld( p, tmp, A0_DEST_CHANNEL_ALL,
sampler, texcoord, op );
}
-
- return p->src_texture;
-
- /* Crossbar: */
- case GL_TEXTURE0:
- case GL_TEXTURE1:
- case GL_TEXTURE2:
- case GL_TEXTURE3:
- case GL_TEXTURE4:
- case GL_TEXTURE5:
- case GL_TEXTURE6:
- case GL_TEXTURE7: {
- return UREG_BAD;
- }
+ return p->src_texture[unit];
case GL_CONSTANT:
return i915_emit_const4fv( p, p->ctx->Texture.Unit[unit].EnvColor );
@@ -555,9 +552,12 @@
for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++)
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
p->src_previous = emit_texenv( p, unit );
- p->src_texture = UREG_BAD;
p->temp_flag = 0xffff000;
p->temp_flag |= 1 << GET_UREG_NR(p->src_previous);
+ /* FIXME: This could be cleverer. */
+ for (int u = 0; u < 8; u++)
+ if (p->src_texture[u] != UREG_BAD)
+ p->temp_flag |= 1 << GET_UREG_NR(p->src_texture[u]);
}
}
Index: src/mesa/drivers/dri/i915/intel_context.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i915/intel_context.c,v
retrieving revision 1.30
diff -u -r1.30 intel_context.c
--- src/mesa/drivers/dri/i915/intel_context.c 1 Sep 2006 23:36:30 -0000 1.30
+++ src/mesa/drivers/dri/i915/intel_context.c 16 Sep 2006 02:07:10 -0000
@@ -158,10 +158,6 @@
/**
* Extension strings exported by the intel driver.
- *
- * \note
- * It appears that ARB_texture_env_crossbar has "disappeared" compared to the
- * old i830-specific driver.
*/
const struct dri_extension card_extensions[] =
{
@@ -173,6 +169,7 @@
{ "GL_ARB_texture_cube_map", NULL },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
+ { "GL_ARB_texture_env_crossbar", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_ARB_texture_rectangle", NULL },