[Mesa-dev] [PATCH 01/11] mesa: implement DrawTransformFeedback from ARB_transform_feedback2

Jose Fonseca jfonseca at vmware.com
Mon Dec 12 08:37:06 PST 2011


----- Original Message -----
> On 12/12/2011 02:49 PM, Jose Fonseca wrote:
> > ----- Original Message -----
> >> From: Marek Olšák <maraeo at gmail.com>
> >>
> >> It's like DrawArrays, but the count is taken from a transform
> >> feedback
> >> object.
> >>
> >> This removes DrawTransformFeedback from dd_function_table and adds
> >> the same
> >> function to GLvertexformat (with the function parameters matching
> >> GL).
> >>
> >> The vbo_draw_func callback has a new parameter
> >> "struct gl_transform_feedback_object *tfb_vertcount".
> >>
> >> The rest of the code just validates states and forwards the
> >> transform
> >> feedback object into vbo_draw_func.
> > 
> > I ventured reviewing this too, and I have a question: the
> > unfinished code in master had comments saying
> > 
> >    /*
> >     * Get number of vertices in obj's feedback buffer.
> >     * Call ctx->Exec.DrawArrays(mode, 0, count);
> >     */
> > 
> > which seems simpler than passing the new tfb_vertcount parameter
> > everywhere, just for the sake of obtaining count, so what's the
> > rationale for doing this differently here?
> > 
> 
> The count is "contained" in the TFB object (through its association
> with
> a pipe_stream_output_target which tracks the amount of vertices
> written
> to it) and is not supposed to be read back by the CPU because that
> would
> mean waiting.
> 
> The driver will let the GPU write the count into the command buffer,
> so
> it only needs to sync command processing with TFB.

I see. Makes sense.

I have no more objections against the series FWIW.

It would be nice to fix softpipe/llvmpipe though, but IIUC they could not possibly have worked with Mesa before, and I don't think anybody is relying on that softpipe/llvmpipe functionality w/ other state trackers at this point, so I suppose it could wait.

Jose


More information about the mesa-dev mailing list