summaryrefslogtreecommitdiff
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorGravatar bunnei2019-07-11 17:36:23 -0400
committerGravatar GitHub2019-07-11 17:36:23 -0400
commitbb67091c774611ce2be1aa461438be3989601e59 (patch)
tree58e29bd5d7114019a48a62ffadb8076d73627bee /src/video_core/engines
parentMerge pull request #2717 from SciresM/unmirror_memory (diff)
parentshader_ir: Add comments on missing instruction. (diff)
downloadyuzu-bb67091c774611ce2be1aa461438be3989601e59.tar.gz
yuzu-bb67091c774611ce2be1aa461438be3989601e59.tar.xz
yuzu-bb67091c774611ce2be1aa461438be3989601e59.zip
Merge pull request #2609 from FernandoS27/new-scan
Implement a New Shader Scanner, Decompile Flow Stack and implement BRX BRA.CC
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/shader_bytecode.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 404d4f5aa..c3055602b 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -1368,6 +1368,20 @@ union Instruction {
1368 } bra; 1368 } bra;
1369 1369
1370 union { 1370 union {
1371 BitField<20, 24, u64> target;
1372 BitField<5, 1, u64> constant_buffer;
1373
1374 s32 GetBranchExtend() const {
1375 // Sign extend the branch target offset
1376 u32 mask = 1U << (24 - 1);
1377 u32 value = static_cast<u32>(target);
1378 // The branch offset is relative to the next instruction and is stored in bytes, so
1379 // divide it by the size of an instruction and add 1 to it.
1380 return static_cast<s32>((value ^ mask) - mask) / sizeof(Instruction) + 1;
1381 }
1382 } brx;
1383
1384 union {
1371 BitField<39, 1, u64> emit; // EmitVertex 1385 BitField<39, 1, u64> emit; // EmitVertex
1372 BitField<40, 1, u64> cut; // EndPrimitive 1386 BitField<40, 1, u64> cut; // EndPrimitive
1373 } out; 1387 } out;
@@ -1464,6 +1478,7 @@ public:
1464 BFE_IMM, 1478 BFE_IMM,
1465 BFI_IMM_R, 1479 BFI_IMM_R,
1466 BRA, 1480 BRA,
1481 BRX,
1467 PBK, 1482 PBK,
1468 LD_A, 1483 LD_A,
1469 LD_L, 1484 LD_L,
@@ -1738,6 +1753,7 @@ private:
1738 INST("111000101001----", Id::SSY, Type::Flow, "SSY"), 1753 INST("111000101001----", Id::SSY, Type::Flow, "SSY"),
1739 INST("111000101010----", Id::PBK, Type::Flow, "PBK"), 1754 INST("111000101010----", Id::PBK, Type::Flow, "PBK"),
1740 INST("111000100100----", Id::BRA, Type::Flow, "BRA"), 1755 INST("111000100100----", Id::BRA, Type::Flow, "BRA"),
1756 INST("111000100101----", Id::BRX, Type::Flow, "BRX"),
1741 INST("1111000011111---", Id::SYNC, Type::Flow, "SYNC"), 1757 INST("1111000011111---", Id::SYNC, Type::Flow, "SYNC"),
1742 INST("111000110100---", Id::BRK, Type::Flow, "BRK"), 1758 INST("111000110100---", Id::BRK, Type::Flow, "BRK"),
1743 INST("111000110000----", Id::EXIT, Type::Flow, "EXIT"), 1759 INST("111000110000----", Id::EXIT, Type::Flow, "EXIT"),