diff options
Diffstat (limited to 'src/video_core/vertex_shader.cpp')
| -rw-r--r-- | src/video_core/vertex_shader.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp index 51f4e58bf..885b7de59 100644 --- a/src/video_core/vertex_shader.cpp +++ b/src/video_core/vertex_shader.cpp | |||
| @@ -235,6 +235,15 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 235 | break; | 235 | break; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | case OpCode::Id::FLR: | ||
| 239 | for (int i = 0; i < 4; ++i) { | ||
| 240 | if (!swizzle.DestComponentEnabled(i)) | ||
| 241 | continue; | ||
| 242 | |||
| 243 | dest[i] = float24::FromFloat32(std::floor(src1[i].ToFloat32())); | ||
| 244 | } | ||
| 245 | break; | ||
| 246 | |||
| 238 | case OpCode::Id::MAX: | 247 | case OpCode::Id::MAX: |
| 239 | for (int i = 0; i < 4; ++i) { | 248 | for (int i = 0; i < 4; ++i) { |
| 240 | if (!swizzle.DestComponentEnabled(i)) | 249 | if (!swizzle.DestComponentEnabled(i)) |
| @@ -366,12 +375,15 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 366 | 375 | ||
| 367 | case OpCode::Type::MultiplyAdd: | 376 | case OpCode::Type::MultiplyAdd: |
| 368 | { | 377 | { |
| 369 | if (instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MAD) { | 378 | if ((instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MAD) || |
| 379 | (instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MADI)) { | ||
| 370 | const SwizzlePattern& swizzle = *(SwizzlePattern*)&swizzle_data[instr.mad.operand_desc_id]; | 380 | const SwizzlePattern& swizzle = *(SwizzlePattern*)&swizzle_data[instr.mad.operand_desc_id]; |
| 371 | 381 | ||
| 372 | const float24* src1_ = LookupSourceRegister(instr.mad.src1); | 382 | bool is_inverted = (instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MADI); |
| 373 | const float24* src2_ = LookupSourceRegister(instr.mad.src2); | 383 | |
| 374 | const float24* src3_ = LookupSourceRegister(instr.mad.src3); | 384 | const float24* src1_ = LookupSourceRegister(instr.mad.GetSrc1(is_inverted)); |
| 385 | const float24* src2_ = LookupSourceRegister(instr.mad.GetSrc2(is_inverted)); | ||
| 386 | const float24* src3_ = LookupSourceRegister(instr.mad.GetSrc3(is_inverted)); | ||
| 375 | 387 | ||
| 376 | const bool negate_src1 = ((bool)swizzle.negate_src1 != false); | 388 | const bool negate_src1 = ((bool)swizzle.negate_src1 != false); |
| 377 | const bool negate_src2 = ((bool)swizzle.negate_src2 != false); | 389 | const bool negate_src2 = ((bool)swizzle.negate_src2 != false); |