[Mesa-dev] ARB_copy_image support in Gallium
sroland at vmware.com
Mon Jul 20 12:56:52 PDT 2015
Theoretically resource_copy_region should be the right function for
that. Both ARB_copy_image and d3d10 ResourceCopyRegion define this as
essentially the equivalent of memcpy.
I guess the difficulty is that GL's view classes are a bit different
compared to d3d10 typeless groups - d3d10 doesn't allow
ResourceCopyRegion with swizzling (actually there are not even ANY
formats which would have just different swizzling anyway in d3d10,
though some got added back later).
So, right now this does NOT require the same formats, but it is loosely
specced in docs for the formats to be compatible. See
util_is_format_compatible, according to that RGBA vs. RGBX would be
compatible, though a depth and corresponding color format would be not
(which is ok for gl but not d3d), things like RGBA8_UNORM vs. RGBA8_SINT
would certainly qualify.
Not sure though if I like the "memcpy with swizzling" idea. Sounds like
that might not be easily implementable in general, unless you revert
back to a quad blit, which is not the intention of either gl's nor
Sounds to me like it may be better to leave things as-is, with a
fallback to quad blit if the formats require swizzling (or make sure not
formats with different swizzling are picked in the first place).
Am 20.07.2015 um 20:44 schrieb Ilia Mirkin:
> Hi Brian,
> You marked off ARB_copy_image (and ARB_clear_texture) as in-progress
> by VMware some months ago -- has there been any movement on that? It
> appears that Bioshock Infinite requires ARB_copy_image so might be
> nice to get that added in.
> The complication in implementing ARB_copy_image was that st/mesa will
> pick potentially different PIPE_FORMAT enums for the same internal
> format, depending on the parameters to the glTexImage call. A
> developer (irc handle Leftmost, I forget his real name, sorry) tried
> to wrestle with the issues this presents, but as I recall ended up
> coming up short.
> The final implementation probably needs some combination of
> resource_copy_region and blit. I think resource_copy_region currently
> is spec'd to require identical formats in src and dst, but that could
> be relaxed.
> Anyways, would be interested in hearing whether you guys have made any
> progress, or if you had thoughts on proper implementation.
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
More information about the mesa-dev