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

Christoph Bumiller e0425955 at student.tuwien.ac.at
Mon Dec 12 08:02:43 PST 2011


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.

> Jose
> 



More information about the mesa-dev mailing list