MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / foreachBlock

Function foreachBlock

pcsx2/GS/GSLocalMemoryMultiISA.cpp:181–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179
180template <typename Fn>
181static 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
202template <int psm, int bsx, int bsy, int alignment>
203void GSLocalMemoryFunctions::WriteImageColumn(GSLocalMemory& mem, int l, int r, int y, int h, const u8* src, int srcpitch, const GIFRegBITBLTBUF& BITBLTBUF)

Callers 15

ReadTexture32Method · 0.70
ReadTexture24Method · 0.70
ReadTextureGPU24Method · 0.70
ReadTexture16Method · 0.70
ReadTexture8Method · 0.70
ReadTexture4Method · 0.70
ReadTexture8HMethod · 0.70
ReadTexture8HSWMethod · 0.70
ReadTexture8HHSWMethod · 0.70
ReadTexture4HLMethod · 0.70
ReadTexture4HHMethod · 0.70
ReadTexture8PMethod · 0.70

Calls 10

isBlockAlignedMethod · 0.80
bnMultiMethod · 0.80
blockShiftXMethod · 0.80
blockShiftYMethod · 0.80
blkYMethod · 0.80
nextBlockYMethod · 0.80
blkXMethod · 0.80
nextBlockXMethod · 0.80
BlockPtrMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected