[Mesa-dev] [PATCH 2/3] util/primconvert: support instanced rendering

Ilia Mirkin imirkin at alum.mit.edu
Thu Dec 4 19:10:38 PST 2014


On Thu, Dec 4, 2014 at 7:34 PM, Brian Paul <brianp at vmware.com> wrote:
> On 12/04/2014 05:01 PM, Ilia Mirkin wrote:
>>
>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>> Cc: "10.3 10.4" <mesa-stable at lists.freedesktop.org>
>> ---
>>   src/gallium/auxiliary/indices/u_primconvert.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/src/gallium/auxiliary/indices/u_primconvert.c
>> b/src/gallium/auxiliary/indices/u_primconvert.c
>> index 95a2478..539ca53 100644
>> --- a/src/gallium/auxiliary/indices/u_primconvert.c
>> +++ b/src/gallium/auxiliary/indices/u_primconvert.c
>> @@ -125,6 +125,8 @@ util_primconvert_draw_vbo(struct primconvert_context
>> *pc,
>>      new_info.min_index = info->min_index;
>>      new_info.max_index = info->max_index;
>>      new_info.index_bias = info->index_bias;
>> +   new_info.start_instance = info->start_instance;
>> +   new_info.instance_count = info->instance_count;
>>
>>      if (info->indexed) {
>>         u_index_translator(pc->primtypes_mask,
>>
>
> If new fields are added to pipe_draw_info, how do we make sure code like
> this gets updated?
>
> Maybe we should initialize "new_info" by copying it from "info"? Actually, a
> helper function that does proper refcounting of some fields would be needed.

Yeah. The thing is that u_primconvert converts from one primtype to
another. So any new fields would have to be evaluated with whether
they can be passed through or not. These all can be, but that's not
necessarily true in the future.

Thankfully pipe_draw_info doesn't get updated too often... the only
update in the near future I can think of is adding patch_vertices to
it, which u_primconvert is wholly unequipped to handle.

>
> But the series LGTM as-is.  Reviewed-by: Brian Paul <brianp at vmware.com>
>
>

Thanks!


More information about the mesa-dev mailing list