On 2016-04-15 20:30, Jakob Sinclair wrote:
In other places in radeonsi that require reinterpretation (e.g.
si_blit.c), the surface template is modified instead of changing the
surface after creation. I'm not sure if r600/radeonsi like it if the
format is changed late like here. Seems to be cleaner and clearer to
change the template anyway.


Thanks for the information. Just want to make sure I got the surface
template solution right:

First you create an surface object which you will then copy over
information too. Then you
can edit things like the format without worrying about something going
horribly wrong.
Then you can use that object to create a new surface which the old
surface can now point too.


No, you just declare a regular struct pipe_surface and set it up by settings its fields. This is called the template. The template is then used for the surface creation call to describe the desired properties of the surface object. It can be a bit confusing because the same type is used for surfaces and surface templates, I guess.

Refer to si_blit.c:si_resource_copy_region to see how it's done.

Grigori
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to