[virglrenderer-devel] [PATCH 2/3] vrend: If available use glCopyImageSubData to execute memcopy like blits

Gert Wollny gert.wollny at collabora.com
Fri Jun 29 06:34:05 UTC 2018


Am Donnerstag, den 28.06.2018, 20:16 -0700 schrieb Gurchetan Singh:
> 
> > Not exactly, I'm looking at whether the format is one that is
> > returned from "canonical_format_from_bits", here you have for each
> > bitcount exactly one return value,
> 
> Why do you have:
> 
> PIPE_FORMAT_G8R8_UNORM,
> PIPE_FORMAT_R8G8B8_UINT,
> PIPE_FORMAT_A8B8G8R8_UNORM,
> PIPE_FORMAT_R16G16B16_UINT,
> PIPE_FORMAT_R32G32B32_UINT
> 
> when they can't be returned by canonical_format_from_bits?
Good catch, that is left over from my initial attempt to figure out
which textures can be copied by using glCopyImageSubData. I think that
might be one reason for the piglit regressions that I still see. 

> > Does pipe->blit() expect a pure memcpy (like glCopyImageSubData
> performs -- R32 to RGBA8 pure copy) or a per-channel memcpy (R32 to
> RGBA8 only fills in R component)?  It's not completely clear from
> reading pipe_context.h or struct pipe_blit_info:
> 
>    /* Optimal hardware path for blitting pixels.
>     * Scaling, format conversion, up- and downsampling (resolve) are
> allowed.
>     */
>    void (*blit)(struct pipe_context *pipe,
>                 const struct pipe_blit_info *info);
> 
> glCopyImageSubData is completely different:
> 
> "CopyImageSubData does not perform general-purpose conversions
>     such as scaling, resizing, blending, color-space, or format
>     conversions. "
> 
> How does Gallium differentiate between the two for drivers?
This is a very good question. My initial shot at making the copy_image
tests pass was simply comparing bit counts (hence the leftovers you
comented above), which, of course, introduced many regressions with
other tests. Then I figured out that the  blit that's called from
glCopyImageSubData seems to be the only one that change the
info.*.format to a canonical format. And one can check for not
resizing, equal sample counts etc (I think that clipping is already
taken care of on the guest size).

Yeah, there are still some piglits failing but I'm getting there ... 

Best, 
Gert 



More information about the virglrenderer-devel mailing list