[Mesa-dev] [PATCH 3/9] st/mesa: make user index buffers optional
Marek Olšák
maraeo at gmail.com
Thu Apr 26 13:55:24 PDT 2012
On Thu, Apr 26, 2012 at 8:54 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
> ----- Original Message -----
>> ---
>> src/mesa/state_tracker/st_context.c | 4 +++-
>> src/mesa/state_tracker/st_context.h | 1 +
>> src/mesa/state_tracker/st_draw.c | 5 +++++
>> src/mesa/state_tracker/st_extensions.c | 4 ++++
>> 4 files changed, 13 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/mesa/state_tracker/st_context.c
>> b/src/mesa/state_tracker/st_context.c
>> index 84aae81..164cc45 100644
>> --- a/src/mesa/state_tracker/st_context.c
>> +++ b/src/mesa/state_tracker/st_context.c
>> @@ -155,7 +155,9 @@ st_create_context_priv( struct gl_context *ctx,
>> struct pipe_context *pipe )
>> st->dirty.mesa = ~0;
>> st->dirty.st = ~0;
>>
>> - st->uploader = u_upload_create(st->pipe, 65536, 4,
>> PIPE_BIND_VERTEX_BUFFER);
>> + st->uploader = u_upload_create(st->pipe, 128 * 1024, 4,
>> + PIPE_BIND_VERTEX_BUFFER |
>> + PIPE_BIND_INDEX_BUFFER);
>
> Marek,
>
> Instead of lumping this into the same hardware buffer, I think it would be better to use two separate uploaders so that the driver can effectively do optimization based on PIPE_BIND_VERTEX_BUFFER or PIPE_BIND_INDEX_BUFFER. A quick look on current drivers showed that they do look at these bind flags.
Thanks for the review. I'll add another uploader for indices as you say.
I've also got a patch which adds void *user_buffer into
pipe_constant_buffer and with that, we can remove user_buffer_create
altogether.
>
> Otherwise I don't see anything wrong with this series. It seems a nice cleanup/speedup.
>
> Brian's OOTO till Monday, so allow more time for him to comment.
>
> Also, once you updated the series, please provide it in a clonable git branch for testing.
Okay, I'll do that once I remove user_buffer_create if that's okay with you.
Marek
More information about the mesa-dev
mailing list