summaryrefslogtreecommitdiff
path: root/src/video_core/swrasterizer/rasterizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/swrasterizer/rasterizer.cpp')
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp
index e9edf0360..908c7bb9e 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -307,10 +307,22 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
307 int t = (int)(v * float24::FromFloat32(static_cast<float>(texture.config.height))) 307 int t = (int)(v * float24::FromFloat32(static_cast<float>(texture.config.height)))
308 .ToFloat32(); 308 .ToFloat32();
309 309
310 if ((texture.config.wrap_s == TexturingRegs::TextureConfig::ClampToBorder && 310 bool use_border_s = false;
311 (s < 0 || static_cast<u32>(s) >= texture.config.width)) || 311 bool use_border_t = false;
312 (texture.config.wrap_t == TexturingRegs::TextureConfig::ClampToBorder && 312
313 (t < 0 || static_cast<u32>(t) >= texture.config.height))) { 313 if (texture.config.wrap_s == TexturingRegs::TextureConfig::ClampToBorder) {
314 use_border_s = s < 0 || s >= static_cast<int>(texture.config.width);
315 } else if (texture.config.wrap_s == TexturingRegs::TextureConfig::ClampToBorder2) {
316 use_border_s = s >= static_cast<int>(texture.config.width);
317 }
318
319 if (texture.config.wrap_t == TexturingRegs::TextureConfig::ClampToBorder) {
320 use_border_t = t < 0 || t >= static_cast<int>(texture.config.height);
321 } else if (texture.config.wrap_t == TexturingRegs::TextureConfig::ClampToBorder2) {
322 use_border_t = t >= static_cast<int>(texture.config.height);
323 }
324
325 if (use_border_s || use_border_t) {
314 auto border_color = texture.config.border_color; 326 auto border_color = texture.config.border_color;
315 texture_color[i] = {border_color.r, border_color.g, border_color.b, 327 texture_color[i] = {border_color.r, border_color.g, border_color.b,
316 border_color.a}; 328 border_color.a};