From cd163fb59ae2922d33aa931f51ef5d116c0adc3f Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sat, 13 Dec 2014 21:22:55 +0100 Subject: [PATCH] Pica/VertexShader: Implement MAX instructions. --- src/video_core/vertex_shader.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp index fbec1bcc80..742e5a9f21 100644 --- a/src/video_core/vertex_shader.cpp +++ b/src/video_core/vertex_shader.cpp @@ -197,6 +197,15 @@ static void ProcessShaderCode(VertexShaderState& state) { break; } + case Instruction::OpCode::MAX: + for (int i = 0; i < 4; ++i) { + if (!swizzle.DestComponentEnabled(i)) + continue; + + dest[i] = std::max(src1[i], src2[i]); + } + break; + case Instruction::OpCode::DP3: case Instruction::OpCode::DP4: {