diff options
| author | 2017-05-20 23:14:22 +0300 | |
|---|---|---|
| committer | 2017-05-29 22:03:08 +0300 | |
| commit | 077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5 (patch) | |
| tree | 795279c9504705006e3b5c6348eb573d8f92a675 /src | |
| parent | Merge pull request #2725 from wwylele/texture-sampler (diff) | |
| download | yuzu-077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5.tar.gz yuzu-077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5.tar.xz yuzu-077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5.zip | |
pica: add registers for texture cube
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/regs_texturing.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/video_core/regs_texturing.h b/src/video_core/regs_texturing.h index e4038b41b..3f5355fa9 100644 --- a/src/video_core/regs_texturing.h +++ b/src/video_core/regs_texturing.h | |||
| @@ -133,7 +133,32 @@ struct TexturingRegs { | |||
| 133 | BitField<16, 1, u32> clear_texture_cache; // TODO: unimplemented | 133 | BitField<16, 1, u32> clear_texture_cache; // TODO: unimplemented |
| 134 | } main_config; | 134 | } main_config; |
| 135 | TextureConfig texture0; | 135 | TextureConfig texture0; |
| 136 | INSERT_PADDING_WORDS(0x8); | 136 | |
| 137 | enum class CubeFace { | ||
| 138 | PositiveX = 0, | ||
| 139 | NegativeX = 1, | ||
| 140 | PositiveY = 2, | ||
| 141 | NegativeY = 3, | ||
| 142 | PositiveZ = 4, | ||
| 143 | NegativeZ = 5, | ||
| 144 | }; | ||
| 145 | |||
| 146 | BitField<0, 22, u32> cube_address[5]; | ||
| 147 | |||
| 148 | PAddr GetCubePhysicalAddress(CubeFace face) const { | ||
| 149 | PAddr address = texture0.address; | ||
| 150 | if (face != CubeFace::PositiveX) { | ||
| 151 | // Bits [22:27] from the main texture address is shared with all cubemap additional | ||
| 152 | // addresses. | ||
| 153 | auto& face_addr = cube_address[static_cast<size_t>(face) - 1]; | ||
| 154 | address &= ~face_addr.mask; | ||
| 155 | address |= face_addr; | ||
| 156 | } | ||
| 157 | // A multiplier of 8 is also needed in the same way as the main address. | ||
| 158 | return address * 8; | ||
| 159 | } | ||
| 160 | |||
| 161 | INSERT_PADDING_WORDS(0x3); | ||
| 137 | BitField<0, 4, TextureFormat> texture0_format; | 162 | BitField<0, 4, TextureFormat> texture0_format; |
| 138 | BitField<0, 1, u32> fragment_lighting_enable; | 163 | BitField<0, 1, u32> fragment_lighting_enable; |
| 139 | INSERT_PADDING_WORDS(0x1); | 164 | INSERT_PADDING_WORDS(0x1); |