mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-23 11:19:03 +02:00
SoftGPU: Draw sprites that texture from themselves in the GE's pixel order
A sprite that reads what it draws goes through the texture cache pixel by pixel: rows left to right, top to bottom, texture lines loaded as samples first read them, and pixels reaching memory a 16-byte block at a time, a pixel after the next block starts (four with bilinear filtering). Fitted to geprobe exp81 and exp204-exp209 on hardware; Split Second's blur passes now match the PSP. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a882484147
commit
fdb411dd0e
8 files changed
+359
-31
No files matched your search
@@ -1181,6 +1181,29 @@ static LinearQuadFunc PickLinearQuad(const SamplerID &id) {
|
||||
}
|
||||
}
|
||||
|
||||
int SampleTexels(float s, float t, int level, int levelFrac, bool linear, const SamplerID &id, int u[8], int v[8], int levels[8]) {
|
||||
int n = 0;
|
||||
for (int l = level; l <= level + (levelFrac ? 1 : 0); ++l) {
|
||||
const int w = id.cached.sizes[l].w, h = id.cached.sizes[l].h;
|
||||
if (linear) {
|
||||
int u0, u1, v0, v1, fracU, fracV;
|
||||
TexelPairT(s, w, id.clampS, u0, u1, fracU);
|
||||
TexelPairT(t, h, id.clampT, v0, v1, fracV);
|
||||
const int us[4] = { u0, u1, u0, u1 }, vs[4] = { v0, v0, v1, v1 };
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
u[n] = us[i];
|
||||
v[n] = vs[i];
|
||||
levels[n] = l;
|
||||
++n;
|
||||
}
|
||||
} else {
|
||||
GetTexelCoordinates(l, s, t, u[n], v[n], id);
|
||||
levels[n++] = l;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
LinearQuadFunc GetLinearQuadFunc(const SamplerID &id, LinearFunc linear) {
|
||||
if (linear != GetLinearFallback(id))
|
||||
return nullptr;
|
||||
|
||||
Reference in new issue
Block a user