diff options
author | Rob Clark <[email protected]> | 2016-06-29 13:51:26 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-07-30 09:23:42 -0400 |
commit | 7105774babc4d23623c3547cd19122a55c1090db (patch) | |
tree | 31d72e3f9f7d8b3dcf9c34225ae9c468443720f3 /src/gallium/drivers/freedreno/freedreno_util.h | |
parent | dcde4cd114e906f5c4372dbb6758026c9222cd2a (diff) |
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_util.h')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_util.h | 6 |
1 files changed, 6 insertions, 0 deletions
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_ */ |