summaryrefslogtreecommitdiff
path: root/src/video_core/swrasterizer/rasterizer.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-06-13 21:28:13 -0700
committerGravatar GitHub2017-06-13 21:28:12 -0700
commit5fe5ccac4250d5f001cc29838033e2fef63ebb6c (patch)
tree32224370753184eeca64cf9b055351ee599c9e94 /src/video_core/swrasterizer/rasterizer.cpp
parentServices/UDS: Set the proper bit in the ConnectionStatus structure when creat... (diff)
parentpica/rasterizer: implement/stub texture wrap mode 4-7 (diff)
downloadyuzu-5fe5ccac4250d5f001cc29838033e2fef63ebb6c.tar.gz
yuzu-5fe5ccac4250d5f001cc29838033e2fef63ebb6c.tar.xz
yuzu-5fe5ccac4250d5f001cc29838033e2fef63ebb6c.zip
Merge pull request #2743 from wwylele/wrap-fix
pica/rasterizer: implement/stub texture wrap mode 4-7
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 8b7b1defb..cd7b6c39d 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -357,10 +357,22 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
357 int t = (int)(v * float24::FromFloat32(static_cast<float>(texture.config.height))) 357 int t = (int)(v * float24::FromFloat32(static_cast<float>(texture.config.height)))
358 .ToFloat32(); 358 .ToFloat32();
359 359
360 if ((texture.config.wrap_s == TexturingRegs::TextureConfig::ClampToBorder && 360 bool use_border_s = false;
361 (s < 0 || static_cast<u32>(s) >= texture.config.width)) || 361 bool use_border_t = false;
362 (texture.config.wrap_t == TexturingRegs::TextureConfig::ClampToBorder && 362
363 (t < 0 || static_cast<u32>(t) >= texture.config.height))) { 363 if (texture.config.wrap_s == TexturingRegs::TextureConfig::ClampToBorder) {
364 use_border_s = s < 0 || s >= static_cast<int>(texture.config.width);
365 } else if (texture.config.wrap_s == TexturingRegs::TextureConfig::ClampToBorder2) {
366 use_border_s = s >= static_cast<int>(texture.config.width);
367 }
368
369 if (texture.config.wrap_t == TexturingRegs::TextureConfig::ClampToBorder) {
370 use_border_t = t < 0 || t >= static_cast<int>(texture.config.height);
371 } else if (texture.config.wrap_t == TexturingRegs::TextureConfig::ClampToBorder2) {
372 use_border_t = t >= static_cast<int>(texture.config.height);
373 }
374
375 if (use_border_s || use_border_t) {
364 auto border_color = texture.config.border_color; 376 auto border_color = texture.config.border_color;
365 texture_color[i] = {border_color.r, border_color.g, border_color.b, 377 texture_color[i] = {border_color.r, border_color.g, border_color.b,
366 border_color.a}; 378 border_color.a};