diff options
| author | 2019-05-19 14:02:58 -0400 | |
|---|---|---|
| committer | 2019-05-19 14:02:58 -0400 | |
| commit | d49efbfb4aa4e935f6c753871d6af6534701f542 (patch) | |
| tree | 79608391a32719a0be20c898fc79aba93f9f1d48 /src/video_core/engines | |
| parent | Merge pull request #2410 from lioncash/affinity (diff) | |
| parent | shader_ir/other: Implement IPA.IDX (diff) | |
| download | yuzu-d49efbfb4aa4e935f6c753871d6af6534701f542.tar.gz yuzu-d49efbfb4aa4e935f6c753871d6af6534701f542.tar.xz yuzu-d49efbfb4aa4e935f6c753871d6af6534701f542.zip | |
Merge pull request #2441 from ReinUsesLisp/al2p
shader: Implement AL2P and ALD.PHYS
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 1 | ||||
| -rw-r--r-- | src/video_core/engines/shader_bytecode.h | 22 |
2 files changed, 21 insertions, 2 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 48e4fec33..f342c78e6 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -59,6 +59,7 @@ public: | |||
| 59 | static constexpr std::size_t NumCBData = 16; | 59 | static constexpr std::size_t NumCBData = 16; |
| 60 | static constexpr std::size_t NumVertexArrays = 32; | 60 | static constexpr std::size_t NumVertexArrays = 32; |
| 61 | static constexpr std::size_t NumVertexAttributes = 32; | 61 | static constexpr std::size_t NumVertexAttributes = 32; |
| 62 | static constexpr std::size_t NumVaryings = 31; | ||
| 62 | static constexpr std::size_t NumTextureSamplers = 32; | 63 | static constexpr std::size_t NumTextureSamplers = 32; |
| 63 | static constexpr std::size_t NumClipDistances = 8; | 64 | static constexpr std::size_t NumClipDistances = 8; |
| 64 | static constexpr std::size_t MaxShaderProgram = 6; | 65 | static constexpr std::size_t MaxShaderProgram = 6; |
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index e5b4eadea..7bbc556da 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -98,6 +98,10 @@ union Attribute { | |||
| 98 | BitField<22, 2, u64> element; | 98 | BitField<22, 2, u64> element; |
| 99 | BitField<24, 6, Index> index; | 99 | BitField<24, 6, Index> index; |
| 100 | BitField<47, 3, AttributeSize> size; | 100 | BitField<47, 3, AttributeSize> size; |
| 101 | |||
| 102 | bool IsPhysical() const { | ||
| 103 | return element == 0 && static_cast<u64>(index.Value()) == 0; | ||
| 104 | } | ||
| 101 | } fmt20; | 105 | } fmt20; |
| 102 | 106 | ||
| 103 | union { | 107 | union { |
| @@ -499,6 +503,11 @@ enum class SystemVariable : u64 { | |||
| 499 | CircularQueueEntryAddressHigh = 0x63, | 503 | CircularQueueEntryAddressHigh = 0x63, |
| 500 | }; | 504 | }; |
| 501 | 505 | ||
| 506 | enum class PhysicalAttributeDirection : u64 { | ||
| 507 | Input = 0, | ||
| 508 | Output = 1, | ||
| 509 | }; | ||
| 510 | |||
| 502 | union Instruction { | 511 | union Instruction { |
| 503 | Instruction& operator=(const Instruction& instr) { | 512 | Instruction& operator=(const Instruction& instr) { |
| 504 | value = instr.value; | 513 | value = instr.value; |
| @@ -587,6 +596,7 @@ union Instruction { | |||
| 587 | } alu; | 596 | } alu; |
| 588 | 597 | ||
| 589 | union { | 598 | union { |
| 599 | BitField<38, 1, u64> idx; | ||
| 590 | BitField<51, 1, u64> saturate; | 600 | BitField<51, 1, u64> saturate; |
| 591 | BitField<52, 2, IpaSampleMode> sample_mode; | 601 | BitField<52, 2, IpaSampleMode> sample_mode; |
| 592 | BitField<54, 2, IpaInterpMode> interp_mode; | 602 | BitField<54, 2, IpaInterpMode> interp_mode; |
| @@ -812,6 +822,12 @@ union Instruction { | |||
| 812 | } stg; | 822 | } stg; |
| 813 | 823 | ||
| 814 | union { | 824 | union { |
| 825 | BitField<32, 1, PhysicalAttributeDirection> direction; | ||
| 826 | BitField<47, 3, AttributeSize> size; | ||
| 827 | BitField<20, 11, u64> address; | ||
| 828 | } al2p; | ||
| 829 | |||
| 830 | union { | ||
| 815 | BitField<0, 3, u64> pred0; | 831 | BitField<0, 3, u64> pred0; |
| 816 | BitField<3, 3, u64> pred3; | 832 | BitField<3, 3, u64> pred3; |
| 817 | BitField<7, 1, u64> abs_a; | 833 | BitField<7, 1, u64> abs_a; |
| @@ -1374,8 +1390,9 @@ public: | |||
| 1374 | ST_A, | 1390 | ST_A, |
| 1375 | ST_L, | 1391 | ST_L, |
| 1376 | ST_S, | 1392 | ST_S, |
| 1377 | LDG, // Load from global memory | 1393 | LDG, // Load from global memory |
| 1378 | STG, // Store in global memory | 1394 | STG, // Store in global memory |
| 1395 | AL2P, // Transforms attribute memory into physical memory | ||
| 1379 | TEX, | 1396 | TEX, |
| 1380 | TEX_B, // Texture Load Bindless | 1397 | TEX_B, // Texture Load Bindless |
| 1381 | TXQ, // Texture Query | 1398 | TXQ, // Texture Query |
| @@ -1646,6 +1663,7 @@ private: | |||
| 1646 | INST("1110111101010---", Id::ST_L, Type::Memory, "ST_L"), | 1663 | INST("1110111101010---", Id::ST_L, Type::Memory, "ST_L"), |
| 1647 | INST("1110111011010---", Id::LDG, Type::Memory, "LDG"), | 1664 | INST("1110111011010---", Id::LDG, Type::Memory, "LDG"), |
| 1648 | INST("1110111011011---", Id::STG, Type::Memory, "STG"), | 1665 | INST("1110111011011---", Id::STG, Type::Memory, "STG"), |
| 1666 | INST("1110111110100---", Id::AL2P, Type::Memory, "AL2P"), | ||
| 1649 | INST("110000----111---", Id::TEX, Type::Texture, "TEX"), | 1667 | INST("110000----111---", Id::TEX, Type::Texture, "TEX"), |
| 1650 | INST("1101111010111---", Id::TEX_B, Type::Texture, "TEX_B"), | 1668 | INST("1101111010111---", Id::TEX_B, Type::Texture, "TEX_B"), |
| 1651 | INST("1101111101001---", Id::TXQ, Type::Texture, "TXQ"), | 1669 | INST("1101111101001---", Id::TXQ, Type::Texture, "TXQ"), |