| 179 | |
| 180 | template <typename Fn> |
| 181 | static void foreachBlock(const GSOffset& off, GSLocalMemory& mem, const GSVector4i& r, u8* dst, int dstpitch, int bpp, Fn&& fn) |
| 182 | { |
| 183 | pxAssert(off.isBlockAligned(r)); |
| 184 | GSOffset::BNHelper bn = off.bnMulti(r.left, r.top); |
| 185 | int right = r.right >> off.blockShiftX(); |
| 186 | int bottom = r.bottom >> off.blockShiftY(); |
| 187 | |
| 188 | int offset = dstpitch << off.blockShiftY(); |
| 189 | int xAdd = (1 << off.blockShiftX()) * (bpp / 8); |
| 190 | |
| 191 | for (; bn.blkY() < bottom; bn.nextBlockY(), dst += offset) |
| 192 | { |
| 193 | for (int x = 0; bn.blkX() < right; bn.nextBlockX(), x += xAdd) |
| 194 | { |
| 195 | const u8* src = mem.BlockPtr(bn.value()); |
| 196 | u8* read_dst = dst + x; |
| 197 | fn(read_dst, src); |
| 198 | } |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | template <int psm, int bsx, int bsy, int alignment> |
| 203 | void GSLocalMemoryFunctions::WriteImageColumn(GSLocalMemory& mem, int l, int r, int y, int h, const u8* src, int srcpitch, const GIFRegBITBLTBUF& BITBLTBUF) |
no test coverage detected