From 7105774babc4d23623c3547cd19122a55c1090db Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 29 Jun 2016 13:51:26 -0400 Subject: freedreno: shadow textures if possible to avoid stall/flush To make batch re-ordering useful, we need to be able to create shadow resources to avoid a flush/stall in transfer_map(). For example, uploading new texture contents or updating a UBO mid-batch. In these cases, we want to clone the buffer, and update the new buffer, leaving the old buffer (whose reference is held by cmdstream) as a shadow. This is done by blitting the remaining other levels (and whatever part of current level that is not discarded) from the old/shadow buffer to the new one. Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/freedreno_util.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gallium/drivers/freedreno/freedreno_util.h') diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index ea08e31c465..6321cd7b4cd 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -332,4 +332,10 @@ pack_rgba(enum pipe_format format, const float *rgba) return uc.ui[0]; } +/* + * swap - swap value of @a and @b + */ +#define swap(a, b) \ + do { __typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) + #endif /* FREEDRENO_UTIL_H_ */ -- cgit v1.2.3