[Mesa-dev] [PATCH] gallium/radeon: allow multiple exports of the same texture with different usage

Michel Dänzer michel at daenzer.net
Fri Apr 1 07:59:39 UTC 2016


On 01.04.2016 00:47, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> Instead of failing an assertion, disable DCC and CMASK on the first export
> that needs it, and merge the external usage flags.

[...]

> +		/* Set metadata. */
> +		if (!res->is_shared || update_metadata) {
>  			r600_texture_init_metadata(rtex, &metadata);
>  			if (rscreen->query_opaque_metadata)
> +
>  				rscreen->query_opaque_metadata(rscreen, rtex,
>  							       &metadata);
> -
>  			rscreen->ws->buffer_set_metadata(res->buf, &metadata);

Remove the empty line before the rscreen->query_opaque_metadata call,
and optionally keep the one after the call.


> +	if (res->is_shared) {
> +		/* If USAGE_EXPLICIT_FLUSH has not been set before,
> +		 * it should stay that way.
> +		 */
> +		res->external_usage |=
> +			usage & ~PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;

Should this case also clear PIPE_HANDLE_USAGE_EXPLICIT_FLUSH from
res->external_usage if it's not set in usage?


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-dev mailing list