mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-13 22:40:29 +02:00
softgpu: Centralize more prim drawing state.
This commit is contained in:
1 parent
d06f17d27b
commit
d962fb35d3
3 files changed
+74
-53
No files matched your search
@@ -102,7 +102,7 @@ void DrawSprite(const VertexData &v0, const VertexData &v1, const RasterizerStat
|
||||
|
||||
constexpr int MIN_LINES_PER_THREAD = 32;
|
||||
|
||||
if (gstate.isTextureMapEnabled()) {
|
||||
if (state.enableTextures) {
|
||||
// 1:1 (but with mirror support) texture mapping!
|
||||
int s_start = v0.texturecoords.x;
|
||||
int t_start = v0.texturecoords.y;
|
||||
@@ -184,10 +184,10 @@ void DrawSprite(const VertexData &v0, const VertexData &v1, const RasterizerStat
|
||||
int xoff = ((v0.screenpos.x & 15) + 1) / 2;
|
||||
int yoff = ((v0.screenpos.y & 15) + 1) / 2;
|
||||
|
||||
float dsf = ds * (1.0f / (float)gstate.getTextureWidth(0));
|
||||
float dtf = dt * (1.0f / (float)gstate.getTextureHeight(0));
|
||||
float sf_start = s_start * (1.0f / (float)gstate.getTextureWidth(0));
|
||||
float tf_start = t_start * (1.0f / (float)gstate.getTextureHeight(0));
|
||||
float dsf = ds * (1.0f / (float)(1 << state.samplerID.width0Shift));
|
||||
float dtf = dt * (1.0f / (float)(1 << state.samplerID.height0Shift));
|
||||
float sf_start = s_start * (1.0f / (float)(1 << state.samplerID.width0Shift));
|
||||
float tf_start = t_start * (1.0f / (float)(1 << state.samplerID.height0Shift));
|
||||
|
||||
ParallelRangeLoop(&g_threadManager, [=](int y1, int y2) {
|
||||
float t = tf_start + (y1 - pos0.y) * dtf;
|
||||
@@ -291,7 +291,7 @@ bool RectangleFastPath(const VertexData &v0, const VertexData &v1, const Rasteri
|
||||
// We already have a fast path for clear in ClearRectangle.
|
||||
bool state_check = !state.pixelID.clearMode && NoClampOrWrap(v0.texturecoords) && NoClampOrWrap(v1.texturecoords);
|
||||
// TODO: No mipmap levels? Might be a font at level 1...
|
||||
if ((coord_check || !gstate.isTextureMapEnabled()) && orient_check && state_check) {
|
||||
if ((coord_check || !state.enableTextures) && orient_check && state_check) {
|
||||
Rasterizer::DrawSprite(v0, v1, state);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user