diff options
| author | 2015-05-22 23:40:43 -0400 | |
|---|---|---|
| committer | 2015-05-31 01:27:50 -0400 | |
| commit | 4ac6c1a3b51b80cfd5b914fe87cf4a4663eeea32 (patch) | |
| tree | c26280609c133041c69c988e0297e37d49d886a9 /src | |
| parent | vertex_shader: Implement MIN instruction. (diff) | |
| download | yuzu-4ac6c1a3b51b80cfd5b914fe87cf4a4663eeea32.tar.gz yuzu-4ac6c1a3b51b80cfd5b914fe87cf4a4663eeea32.tar.xz yuzu-4ac6c1a3b51b80cfd5b914fe87cf4a4663eeea32.zip | |
vertex_shader: Implement SLT/SLTI instructions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/vertex_shader.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp index 582712bde..ac4483659 100644 --- a/src/video_core/vertex_shader.cpp +++ b/src/video_core/vertex_shader.cpp | |||
| @@ -120,10 +120,6 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 120 | case OpCode::Type::Arithmetic: | 120 | case OpCode::Type::Arithmetic: |
| 121 | { | 121 | { |
| 122 | bool is_inverted = 0 != (instr.opcode.Value().GetInfo().subtype & OpCode::Info::SrcInversed); | 122 | bool is_inverted = 0 != (instr.opcode.Value().GetInfo().subtype & OpCode::Info::SrcInversed); |
| 123 | // TODO: We don't really support this properly: For instance, the address register | ||
| 124 | // offset needs to be applied to SRC2 instead, etc. | ||
| 125 | // For now, we just abort in this situation. | ||
| 126 | ASSERT_MSG(!is_inverted, "Bad condition..."); | ||
| 127 | 123 | ||
| 128 | const int address_offset = (instr.common.address_register_index == 0) | 124 | const int address_offset = (instr.common.address_register_index == 0) |
| 129 | ? 0 : state.address_registers[instr.common.address_register_index - 1]; | 125 | ? 0 : state.address_registers[instr.common.address_register_index - 1]; |
| @@ -288,6 +284,16 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 288 | break; | 284 | break; |
| 289 | } | 285 | } |
| 290 | 286 | ||
| 287 | case OpCode::Id::SLT: | ||
| 288 | case OpCode::Id::SLTI: | ||
| 289 | for (int i = 0; i < 4; ++i) { | ||
| 290 | if (!swizzle.DestComponentEnabled(i)) | ||
| 291 | continue; | ||
| 292 | |||
| 293 | dest[i] = (src1[i] < src2[i]) ? float24::FromFloat32(1.0f) : float24::FromFloat32(0.0f); | ||
| 294 | } | ||
| 295 | break; | ||
| 296 | |||
| 291 | case OpCode::Id::CMP: | 297 | case OpCode::Id::CMP: |
| 292 | for (int i = 0; i < 2; ++i) { | 298 | for (int i = 0; i < 2; ++i) { |
| 293 | // TODO: Can you restrict to one compare via dest masking? | 299 | // TODO: Can you restrict to one compare via dest masking? |