Fix feedback color bug #11332. In feedback mode, produce float colors.
authorBrian <brian.paul@tungstengraphics.com>
Fri, 22 Jun 2007 14:02:46 +0000 (08:02 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 22 Jun 2007 14:02:46 +0000 (08:02 -0600)
src/mesa/swrast/s_feedback.c
src/mesa/swrast_setup/ss_context.c

index 606afc63ba9dce865f3b1b2ab8ef50194bf73977..07b7409ab57b9313cb8dbe6937ad7fa5cc8b6fbc 100644 (file)
@@ -39,19 +39,14 @@ static void
 feedback_vertex(GLcontext * ctx, const SWvertex * v, const SWvertex * pv)
 {
    GLfloat win[4];
-   GLfloat color[4];
    const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX0];
+   const GLfloat *color = v->attrib[FRAG_ATTRIB_COL0];
 
    win[0] = v->attrib[FRAG_ATTRIB_WPOS][0];
    win[1] = v->attrib[FRAG_ATTRIB_WPOS][1];
    win[2] = v->attrib[FRAG_ATTRIB_WPOS][2] / ctx->DrawBuffer->_DepthMaxF;
    win[3] = 1.0F / v->attrib[FRAG_ATTRIB_WPOS][3];
 
-   color[0] = CHAN_TO_FLOAT(pv->color[0]);
-   color[1] = CHAN_TO_FLOAT(pv->color[1]);
-   color[2] = CHAN_TO_FLOAT(pv->color[2]);
-   color[3] = CHAN_TO_FLOAT(pv->color[3]);
-
    _mesa_feedback_vertex(ctx, win, color, v->attrib[FRAG_ATTRIB_CI][0], vtc);
 }
 
index cd4ac57d37d199986b5d75ea2a8ed21b5f9a9c5b..50b93b36c2b6542c3e1e9b9b24655fcc217e74c4 100644 (file)
@@ -125,6 +125,7 @@ setup_vertex_format(GLcontext *ctx)
       if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) {
          swsetup->intColors = !ctx->FragmentProgram._Current
                            && !ctx->ATIFragmentShader._Enabled
+                           && ctx->RenderMode == GL_RENDER
                            && CHAN_TYPE == GL_UNSIGNED_BYTE;
          if (swsetup->intColors)
             EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color );