Fix generic vertex attribs (Rune Petersen)
authorAapo Tahkola <aet@rasterburn.org>
Tue, 27 Jun 2006 01:26:47 +0000 (01:26 +0000)
committerAapo Tahkola <aet@rasterburn.org>
Tue, 27 Jun 2006 01:26:47 +0000 (01:26 +0000)
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_maos.c
src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c

index 7ff805fd5d375dd3b549d7359c0a3b40dc570d95..0f3683fc09abe37feec11d132a0f3be9b9eb0f63 100644 (file)
@@ -544,6 +544,7 @@ struct r300_vap_reg_state {
           int i_color[2];
           int i_fog;
           int i_tex[R300_MAX_TEXTURE_UNITS];
+          int i_attrib[_TNL_LAST_GENERIC-_TNL_FIRST_GENERIC];
           int i_index;
           int i_pointsize;
        };
index 259781389fac1d2fbdbded66d5192f1fe7c3beca..9cdcb414be50ccce7231e69981175866c30bf5df 100644 (file)
@@ -368,6 +368,12 @@ void r300EmitArrays(GLcontext * ctx, GLboolean immd)
                                rmesa->state.aos[nr++].aos_reg = prog->inputs[VERT_ATTRIB_TEX0+i];
                        }
                }
+               for (i=0;i<(_TNL_LAST_GENERIC-_TNL_FIRST_GENERIC);i++) {
+                       if (InputsRead & (1<<(VERT_ATTRIB_GENERIC0+i))) {
+                               RENDERINPUTS_SET( inputs_bitset, _TNL_ATTRIB_GENERIC(i) );
+                               rmesa->state.aos[nr++].aos_reg = prog->inputs[VERT_ATTRIB_GENERIC0+i];
+                       }
+               }
                nr = 0;
        } else {
                RENDERINPUTS_COPY( inputs_bitset, TNL_CONTEXT(ctx)->render_inputs_bitset );
@@ -457,6 +463,14 @@ void r300EmitArrays(GLcontext * ctx, GLboolean immd)
                        r300->state.texture.tc_count++;
                }
        }
+       for (i = 0; i < (_TNL_LAST_GENERIC-_TNL_FIRST_GENERIC); i++) {
+               if (RENDERINPUTS_TEST( inputs_bitset, _TNL_ATTRIB_GENERIC(i) )) {
+                       CONFIGURE_AOS(i_attrib[i], AOS_FORMAT_FLOAT,
+                                                       VB->AttribPtr[VERT_ATTRIB_GENERIC0+i],
+                                                       immd ? 4 : VB->AttribPtr[VERT_ATTRIB_GENERIC0+i].size,
+                                                       count);
+               }
+       }
        for(i=0; i < nr; i++)
                if(r300->state.aos[i].aos_format == 2){
                        assert(r300->state.aos[i].aos_size == 1);
index c65731d1d7aeba9511208ce44626a0a16fd9d793..b46fee7e309b8a31ae78d03009aa1c6b5eb6a520 100644 (file)
@@ -73,6 +73,9 @@ void radeon_vb_to_rvb(r300ContextPtr rmesa, struct radeon_vertex_buffer *rvb, st
        
        for (i=0; i < ctx->Const.MaxTextureCoordUnits; i++)
                CONV_VB(VERT_ATTRIB_TEX0 + i, TexCoordPtr[i]);
+
+       for (i=0; i < 16; i++)
+               CONV_VB(VERT_ATTRIB_GENERIC0 + i, AttribPtr[VERT_ATTRIB_GENERIC0 + i]);
        
        rvb->Primitive = vb->Primitive;
        rvb->PrimitiveCount = vb->PrimitiveCount;