On 06.09.2010 17:16, Luca Barbieri wrote: > On Mon, Sep 6, 2010 at 3:57 PM, José Fonseca <jfons...@vmware.com> wrote: >> I'd like to know if there's any objection to change the >> resource_copy_region semantics to allow copies between different yet >> compatible formats, where the definition of compatible formats is: > > I was about to propose something like this. > > How about a much more powerful change though, that would make any pair > of non-blocked format of the same bit depth compatible? > This way you could copy z24s8 to r8g8b8a8, for instance. I am not sure this makes a lot of sense. There's no guarantee the bit layout of these is even remotely similar (and it likely won't be on any decent hardware). I think the dx10 restriction makes sense here.
> > In addition to this, how about explicitly allowing sampler views to > use a compatible format, and add the ability for surfaces to use a > compatible format too? (with a new parameter to get_tex_surface) Note that get_tex_surface is dead (in gallium-array-textures - not merged yet but it will happen eventually). Its replacement (for render targets or depth stencil) create_surface(), already can be supplied with a format parameter. Compatible formats though should ultimately end up to something similar to dx10. > > This would allow for instance to implement glBlitFramebuffer on > stencil buffers by reinterpreting the buffer as r8g8b8a8, and allow > the blitter module to copy depth/stencil buffers by simply treating > them as color buffers. > > The only issue is that some drivers might hold depth/stencil surfaces > in compressed formats that cannot be interpreted as a color format, > and not have any mechanism for keeping temporaries or doing > conversions internally. I think that's a pretty big if. I could be wrong but I think operations like blitting stencil buffers are pretty rare anyway (afaik other apis don't allow things like that). > > DirectX seems to have something like this with the _TYPELESS formats. Yes, and it precisely won't allow you to interpret s24_z8 as r8g8b8a8 or other wonky stuff. Only if all components have same number of bits. Roland ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev