summaryrefslogtreecommitdiffstats
path: root/src/video_core/swrasterizer/rasterizer.cpp
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-04-17 09:01:45 +0200
committerwwylele <wwylele@gmail.com>2017-05-20 12:50:50 +0200
commitade45b5b9930b52b6a1d399306539073e8e2196d (patch)
tree19fc2c287591990b796530c383a1153f4b8fcda5 /src/video_core/swrasterizer/rasterizer.cpp
parentMerge pull request #2696 from Subv/vfp_revert (diff)
downloadyuzu-ade45b5b9930b52b6a1d399306539073e8e2196d.tar
yuzu-ade45b5b9930b52b6a1d399306539073e8e2196d.tar.gz
yuzu-ade45b5b9930b52b6a1d399306539073e8e2196d.tar.bz2
yuzu-ade45b5b9930b52b6a1d399306539073e8e2196d.tar.lz
yuzu-ade45b5b9930b52b6a1d399306539073e8e2196d.tar.xz
yuzu-ade45b5b9930b52b6a1d399306539073e8e2196d.tar.zst
yuzu-ade45b5b9930b52b6a1d399306539073e8e2196d.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp
index 20addf0bd..e9edf0360 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -23,6 +23,7 @@
#include "video_core/regs_texturing.h"
#include "video_core/shader/shader.h"
#include "video_core/swrasterizer/framebuffer.h"
+#include "video_core/swrasterizer/proctex.h"
#include "video_core/swrasterizer/rasterizer.h"
#include "video_core/swrasterizer/texturing.h"
#include "video_core/texture/texture_decode.h"
@@ -268,7 +269,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
uv[2].u() = GetInterpolatedAttribute(v0.tc2.u(), v1.tc2.u(), v2.tc2.u());
uv[2].v() = GetInterpolatedAttribute(v0.tc2.v(), v1.tc2.v(), v2.tc2.v());
- Math::Vec4<u8> texture_color[3]{};
+ Math::Vec4<u8> texture_color[4]{};
for (int i = 0; i < 3; ++i) {
const auto& texture = textures[i];
if (!texture.enabled)
@@ -334,6 +335,13 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
}
}
+ // sample procedural texture
+ if (regs.texturing.main_config.texture3_enable) {
+ const auto& proctex_uv = uv[regs.texturing.main_config.texture3_coordinates];
+ texture_color[3] = ProcTex(proctex_uv.u().ToFloat32(), proctex_uv.v().ToFloat32(),
+ g_state.regs.texturing, g_state.proctex);
+ }
+
// Texture environment - consists of 6 stages of color and alpha combining.
//
// Color combiners take three input color values from some source (e.g. interpolated
@@ -376,6 +384,9 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
case Source::Texture2:
return texture_color[2];
+ case Source::Texture3:
+ return texture_color[3];
+
case Source::PreviousBuffer:
return combiner_buffer;