From d3878392693481a102d30fa7c8bb0560f8e72d7c Mon Sep 17 00:00:00 2001 From: mailwl Date: Wed, 17 Jun 2015 19:29:39 +0300 Subject: [PATCH] Implementing DPH/DPHI vertex shader opcodes --- src/video_core/vertex_shader.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp index 87006a832..c9a6170c5 100644 --- a/src/video_core/vertex_shader.cpp +++ b/src/video_core/vertex_shader.cpp @@ -230,6 +230,21 @@ static void ProcessShaderCode(VertexShaderState& state) { break; } + case OpCode::Id::DPH: + case OpCode::Id::DPHI: + { + float24 dot = src2[3]; + for (int i = 0; i < 3; ++i) + dot += src1[i] * src2[i]; + + for (int i = 0; i < 4; ++i) { + if (!swizzle.DestComponentEnabled(i)) + continue; + dest[i] = dot; + } + break; + } + // Reciprocal case OpCode::Id::RCP: {