Keith Whitwell wrote:
> In the q3 (and q2 for that matter) pipelines, the only redundant step is
> a single copy operation. Everything else in the fx setup code
> represents real work, which must be done in either one place or the
> other. Like the cookie monster, rearranging the cookies on the plate
> doesn't alter their number.
OK - After making my first statement about what goes on in Q2, I decided
I'd better do some profiling of Q2... It's clear that the situation
there is quite different to Q3, and Kendall's comments make a lot more
sense in that situation. The key gotcha is that Q2 sends its colors
via. the glColor4f() api, which means there is a full round trip from
float->ubyte->float spread between the api and the pipeline.
Unfortunately there is never going to be a single good internal color
representation, because, for example the D3D vertex (from an earlier
post), uses ubyte colors:
typedef struct D3DTLVERTEX
{
float32 x, y, z, w;
uint32 diffuse_color, specular_color;
float32 u0, v0, u1, v1;
}
And q3, for example, send its colors as ubytes. So all combinations are
possible.
The task of making the internal color format dynamically dependent on
api usage and pipeline configuration is a challenging but IMHO
achievable goal.
We also take quite a hit on the various immediate api's:
% cumulative self
time seconds seconds name
10.84 0.57 0.57 fxsetupXYZWRGBAT0
10.65 1.13 0.56 glColor4f
7.79 1.54 0.41 gl_x86_cliptest_points4
7.60 1.94 0.40 fx_tri_clip_stride_TMU0
6.46 2.28 0.34 glVertex3fv
6.08 2.60 0.32 glTexCoord2f
5.89 2.91 0.31 gl_3dnow_transform_points3_general_raw
4.18 3.13 0.22 fxTexBuildImageMap
2.28 3.25 0.12 gl_fixup_input
2.09 3.36 0.11 fxsetupXYZWT0
1.90 3.46 0.10 fx_tri_clip_stride_RGBA_TMU0
1.90 3.56 0.10 image_to_texture
1.71 3.65 0.09 gl_render_vb
1.52 3.73 0.08 render_vb_poly_fx_flat_clipped
1.52 3.81 0.08 gl_run_pipeline
1.52 3.89 0.08 glEnd
1.33 3.96 0.07 glBegin
To achieve the goal of removing redundant copies in the context of the
immediate api, it would be necessary to push a vertex structure right to
the api's themselves.
Q2 also crashes my new code about 10s into the demo...
Keith
_______________________________________________
Mesa-dev maillist - [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev