[Mesa-dev] Gallium proposal: add a user pointer in pipe_resource
maraeo at gmail.com
Tue Feb 8 13:51:29 PST 2011
On Tue, Feb 8, 2011 at 10:39 PM, Keith Whitwell <keithw at vmware.com> wrote:
> On Tue, 2011-02-08 at 22:29 +0100, Marek Olšák wrote:
> > Keith,
> > redefine_user_buffer() would be a good compromise and I believe the
> > performance hit wouldn't be so noticable. It would also allow partial
> > uploads of constants in a user buffer, which is something we'd like to
> > have
> > too.
> > Currently, st/mesa in st_draw_vbo is doing:
> > - N calls to resource_destroy
> > - some unnecessary computations
> > - N calls to user_buffer_create
> > - 1 call to set_vertex_buffers
> > - 1 call to set_vertex_elements_state
> > If we can replace this by N calls to redefine_user_buffer, then I am
> > all for
> > it, provided neither _NEW_ARRAY nor _NEW_PROGRAM is dirty of course.
> > Can the function look, let's say, like this?
> > void redefine_user_buffer(struct pipe_context *, struct pipe_resource
> > *,
> > const struct pipe_box *);
> That looks good, but wouldn't you also want to be able to change the
> size of the userbuffer? I can see you might be able to implicitly grow
> the buffer this way (when box->x + box->width > resource->width0), but
> that's fairly obtuse and it doesn't permit shrinking.
> So perhaps as above with a "unsigned new_width0" parameter?
I had in mind that width0 would be ~0, but I guess that's not nice. What
and new width0 would implicitly be offset+size;
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mesa-dev