static void
emit_texblend(struct i830_context *i830, GLuint unit, GLuint blendUnit,
              bool last_stage)
{
   struct gl_texture_unit *texUnit = &i830->intel.ctx.Texture.Unit[unit];
   GLuint tmp[I830_TEXBLEND_SIZE], tmp_sz;


   if (0)
      fprintf(stderr, "%s unit %d\n", __func__, unit);

   /* Update i830->state.TexBlend
    */
   tmp_sz = i830SetTexEnvCombine(i830, texUnit->_CurrentCombine, blendUnit,
                                 GetTexelOp(unit), tmp, texUnit->EnvColor);

   if (last_stage)
      tmp[0] |= TEXOP_LAST_STAGE;

   if (tmp_sz != i830->state.TexBlendWordsUsed[blendUnit] ||
       memcmp(tmp, i830->state.TexBlend[blendUnit],
              tmp_sz * sizeof(GLuint))) {

      I830_STATECHANGE(i830, I830_UPLOAD_TEXBLEND(blendUnit));
      memcpy(i830->state.TexBlend[blendUnit], tmp, tmp_sz * sizeof(GLuint));
      i830->state.TexBlendWordsUsed[blendUnit] = tmp_sz;
   }

   I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND(blendUnit), true);
}
Ejemplo n.º 2
0
/* Installs a one-stage passthrough texture blend pipeline.  Is there
 * more that can be done to turn off texturing?
 */
static void set_no_texture( i830ContextPtr i830 )
{
   static const struct gl_tex_env_combine_state comb = {
      GL_NONE, GL_NONE,
      { GL_TEXTURE, 0, 0, }, { GL_TEXTURE, 0, 0, },
      { GL_SRC_COLOR, 0, 0 }, { GL_SRC_ALPHA, 0, 0 },
      0, 0, 0, 0
   };

   i830->meta.TexBlendWordsUsed[0] =
     i830SetTexEnvCombine( i830, & comb, 0, TEXBLENDARG_TEXEL0,
			   i830->meta.TexBlend[0], NULL);

   i830->meta.TexBlend[0][0] |= TEXOP_LAST_STAGE;
   i830->meta.emitted &= ~I830_UPLOAD_TEXBLEND(0);
}
Ejemplo n.º 3
0
/* Set up a single element blend stage for 'replace' texturing with no
 * funny ops.
 */
static void enable_texture_blend_replace( i830ContextPtr i830 )
{
   static const struct gl_tex_env_combine_state comb = {
      GL_REPLACE, GL_REPLACE,
      { GL_TEXTURE, GL_TEXTURE, GL_TEXTURE }, { GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, },
      { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_COLOR }, { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA },
      0, 0, 1, 1
   };

   i830->meta.TexBlendWordsUsed[0] =
     i830SetTexEnvCombine( i830, & comb, 0, TEXBLENDARG_TEXEL0,
			   i830->meta.TexBlend[0], NULL);

   i830->meta.TexBlend[0][0] |= TEXOP_LAST_STAGE;
   i830->meta.emitted &= ~I830_UPLOAD_TEXBLEND(0);

/*    fprintf(stderr, "%s: TexBlendWordsUsed[0]: %d\n",  */
/* 	   __FUNCTION__, i830->meta.TexBlendWordsUsed[0]); */
}