softgpu: Use cached sampler state outside jit.

This commit is contained in:
Unknown W. Brackets committed 2022-01-15 15:26:26 -08:00
1 parent a2abf9402b
commit a228b2ab6c
5 files changed
+78 -76

No files matched your search

+3 -3
View File
@@ -146,7 +146,7 @@ void DrawSprite(const VertexData &v0, const VertexData &v1, const BinCoords &ran
int s = s_start;
u16 *pixel = fb.Get16Ptr(pos0.x, y, pixelID.cached.framebufStride);
for (int x = pos0.x; x < pos1.x; x++) {
u32 tex_color = Vec4<int>(fetchFunc(s, t, texptr, texbufw, 0)).ToRGBA();
u32 tex_color = Vec4<int>(fetchFunc(s, t, texptr, texbufw, 0, state.samplerID)).ToRGBA();
if (tex_color & 0xFF000000) {
DrawSinglePixel5551(pixel, tex_color, pixelID);
}
@@ -162,7 +162,7 @@ void DrawSprite(const VertexData &v0, const VertexData &v1, const BinCoords &ran
u16 *pixel = fb.Get16Ptr(pos0.x, y, pixelID.cached.framebufStride);
for (int x = pos0.x; x < pos1.x; x++) {
Vec4<int> prim_color = v1.color0;
Vec4<int> tex_color = fetchFunc(s, t, texptr, texbufw, 0);
Vec4<int> tex_color = fetchFunc(s, t, texptr, texbufw, 0, state.samplerID);
prim_color = Vec4<int>(ModulateRGBA(ToVec4IntArg(prim_color), ToVec4IntArg(tex_color), state.samplerID));
if (prim_color.a() > 0) {
DrawSinglePixel5551(pixel, prim_color.ToRGBA(), pixelID);
@@ -187,7 +187,7 @@ void DrawSprite(const VertexData &v0, const VertexData &v1, const BinCoords &ran
float s = sf_start;
// Not really that fast but faster than triangle.
for (int x = pos0.x; x < pos1.x; x++) {
Vec4<int> prim_color = state.nearest(s, t, xoff, yoff, ToVec4IntArg(v1.color0), &texptr, &texbufw, 0, 0);
Vec4<int> prim_color = state.nearest(s, t, xoff, yoff, ToVec4IntArg(v1.color0), &texptr, &texbufw, 0, 0, state.samplerID);
state.drawPixel(x, y, z, 255, ToVec4IntArg(prim_color), pixelID);
s += dsf;
}