summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorTony Wasserka <NeoBrainX@gmail.com>2014-12-12 17:55:43 +0100
committerTony Wasserka <NeoBrainX@gmail.com>2014-12-20 18:06:55 +0100
commitce36ad454ecd4707a77916fdb79954c8924b50ee (patch)
treeaecef25a336f7c0ca773629368792c85f6d0111e /src/video_core
parentPica/DebugUtils: Replace duplicated SHBIN structures in favor of nihstro's ones. (diff)
downloadyuzu-ce36ad454ecd4707a77916fdb79954c8924b50ee.tar
yuzu-ce36ad454ecd4707a77916fdb79954c8924b50ee.tar.gz
yuzu-ce36ad454ecd4707a77916fdb79954c8924b50ee.tar.bz2
yuzu-ce36ad454ecd4707a77916fdb79954c8924b50ee.tar.lz
yuzu-ce36ad454ecd4707a77916fdb79954c8924b50ee.tar.xz
yuzu-ce36ad454ecd4707a77916fdb79954c8924b50ee.tar.zst
yuzu-ce36ad454ecd4707a77916fdb79954c8924b50ee.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/vertex_shader.cpp11
-rw-r--r--src/video_core/vertex_shader.h1
2 files changed, 9 insertions, 3 deletions
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index 064a703eb..c5c5261fe 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -10,10 +10,10 @@
#include <nihstro/shader_bytecode.h>
-#include "debug_utils/debug_utils.h"
#include "pica.h"
#include "vertex_shader.h"
+#include "debug_utils/debug_utils.h"
using nihstro::Instruction;
using nihstro::RegisterType;
@@ -99,6 +99,7 @@ static void ProcessShaderCode(VertexShaderState& state) {
const SwizzlePattern& swizzle = *(SwizzlePattern*)&swizzle_data[instr.common.operand_desc_id];
const bool negate_src1 = (swizzle.negate_src1 != 0);
+ const bool negate_src2 = (swizzle.negate_src2 != 0);
float24 src1[4] = {
src1_[(int)swizzle.GetSelectorSrc1(0)],
@@ -112,12 +113,18 @@ static void ProcessShaderCode(VertexShaderState& state) {
src1[2] = src1[2] * float24::FromFloat32(-1);
src1[3] = src1[3] * float24::FromFloat32(-1);
}
- const float24 src2[4] = {
+ float24 src2[4] = {
src2_[(int)swizzle.GetSelectorSrc2(0)],
src2_[(int)swizzle.GetSelectorSrc2(1)],
src2_[(int)swizzle.GetSelectorSrc2(2)],
src2_[(int)swizzle.GetSelectorSrc2(3)],
};
+ if (negate_src2) {
+ src2[0] = src2[0] * float24::FromFloat32(-1);
+ src2[1] = src2[1] * float24::FromFloat32(-1);
+ src2[2] = src2[2] * float24::FromFloat32(-1);
+ src2[3] = src2[3] * float24::FromFloat32(-1);
+ }
switch (instr.opcode) {
case Instruction::OpCode::ADD:
diff --git a/src/video_core/vertex_shader.h b/src/video_core/vertex_shader.h
index 131769808..2f6ff5904 100644
--- a/src/video_core/vertex_shader.h
+++ b/src/video_core/vertex_shader.h
@@ -66,7 +66,6 @@ struct OutputVertex {
static_assert(std::is_pod<OutputVertex>::value, "Structure is not POD");
static_assert(sizeof(OutputVertex) == 32 * sizeof(float), "OutputVertex has invalid size");
-
void SubmitShaderMemoryChange(u32 addr, u32 value);
void SubmitSwizzleDataChange(u32 addr, u32 value);