|
|
|
|
|
|
1 |
|
|
|
); |
|
|
|
|
|
|
|
var dstMipWidthToCopy = Mathf.Min(dest.rt.width, dstWorkMip.width); |
|
|
|
var dstMipHeightToCopy = Mathf.Min(dest.rt.height, dstWorkMip.height); |
|
|
|
var dstMipWidthToCopy = Mathf.Min(targetTexture.rt.width >> (i + 1), dstWorkMip.width); |
|
|
|
var dstMipHeightToCopy = Mathf.Min(targetTexture.rt.height >> (i + 1), dstWorkMip.height); |
|
|
|
|
|
|
|
// If we could bind texture mips as UAV we could avoid this copy...(which moreover copies more than the needed viewport if not fullscreen)
|
|
|
|
cmd.CopyTexture(mips[i], 0, 0, 0, 0, dstMipWidthToCopy, dstMipHeightToCopy, targetTexture, 0, i + 1, 0, 0); |
|
|
|
|
|
|
var dest = mips[i]; |
|
|
|
|
|
|
|
var srcMip = new RectInt(0, 0, srcRect.width >> i, srcRect.height >> i); |
|
|
|
//var dstMip = new RectInt(0, 0, srcMip.width >> 1, srcMip.height >> 1);
|
|
|
|
var srcWorkMip = new RectInt( |
|
|
|
0, |
|
|
|
0, |
|
|
|
|
|
|
1 |
|
|
|
); |
|
|
|
|
|
|
|
var dstMipWidthToCopy = Mathf.Min(dest.width, dstWorkMip.width); |
|
|
|
var dstMipHeightToCopy = Mathf.Min(dest.height, dstWorkMip.height); |
|
|
|
var dstMipWidthToCopy = Mathf.Min(targetTexture.width >> (i + 1), dstWorkMip.width); |
|
|
|
var dstMipHeightToCopy = Mathf.Min(targetTexture.height >> (i + 1), dstWorkMip.height); |
|
|
|
|
|
|
|
// If we could bind texture mips as UAV we could avoid this copy...(which moreover copies more than the needed viewport if not fullscreen)
|
|
|
|
cmd.CopyTexture( |
|
|
|