On Thu, Jan 14, 2010 at 9:27 AM, Chia-I Wu <olva...@gmail.com> wrote:
> On Thu, Jan 14, 2010 at 4:08 PM, Luca Barbieri <l...@luca-barbieri.com> wrote:
>>>> validate_and_get_current_sequence_number(), and the results reused in
>>>> update_buffers().
>>> This works too.  It assumes fast texture creation (as they are always asked
>>> for), which is true with your DRI2 texture cache patch.
>> It's even better, they would only asked for is the surface is updated.
>> The validate_and_get_current_sequence_number would store the buffer
>> names and updated dimensions in the private surface structure, and
>> delete any textures it has stored that are outdated.
>> Then, textures are only created from the names (if not already
>> present) during the call to update_buffers(), which is only made if
>> the sequence number changed.
> When you wrote "update_buffers()", I thought it is a static function in
> egl_g3d.c.  Please don't split the operation into two callbacks in
> native_surface.
>
> I think there still be one "validate" function in native_surface.  The
> prototype and the meaning of the function stays true as in the last patch I
> sent.  Or made simpler if possible.  The difference is in egl_g3d.c.  It calls
> "validate" only once to get both the textures and the sequence number at the
> same time.

That will work too.
If you don't have the sequence number as input, then you would have to
change the semantics so that the caller must increase their reference
count, or accept referencing and unreferencing the textures each call
(not ideal, as it is an atomic operation, and on data possibly not
otherwise recently used).
This also loses the ability to just get the current textures without
any window system call (unless you add a flag to validate for that
functionality).
Currently I don't think EGL exposes such an operation, but it may
possibly be useful for other APIs or be exposed as an extension (would
be useful for things like an EGL-based Cairo backend, that would like
to be able to bind/unbind the context around each operation without
the penalty of an X11 roundtrip each time).
Actually, would it be possibly to _not_ update the surface in
eglMakeCurrent or glViewport for double-buffered surfaces, but only do
so on eglSwapBuffers without violating the specification?

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to