Merge pull request #15999 from unknownbrackets/softgpu-texsize

softgpu: Clamp/wrap textures at 512 pixels
This commit is contained in:
Henrik Rydgård
2022-09-11 10:12:38 +02:00
committed by GitHub
5 changed files with 23 additions and 4 deletions

View File

@@ -265,6 +265,10 @@ bool g_needsClearAfterDialog = false;
static inline bool NoClampOrWrap(const RasterizerState &state, const Vec2f &tc) {
if (tc.x < 0 || tc.y < 0)
return false;
if (state.samplerID.cached.sizes[0].w > 512 || state.samplerID.cached.sizes[0].h > 512)
return false;
if (!state.throughMode)
return tc.x <= 1.0f && tc.y <= 1.0f;
return tc.x <= state.samplerID.cached.sizes[0].w && tc.y <= state.samplerID.cached.sizes[0].h;
}