diff options
author | wwylele <wwylele@gmail.com> | 2017-05-20 22:14:22 +0200 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-05-29 21:03:08 +0200 |
commit | 077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5 (patch) | |
tree | 795279c9504705006e3b5c6348eb573d8f92a675 /src/video_core/regs_texturing.h | |
parent | Merge pull request #2725 from wwylele/texture-sampler (diff) | |
download | yuzu-077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5.tar yuzu-077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5.tar.gz yuzu-077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5.tar.bz2 yuzu-077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5.tar.lz yuzu-077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5.tar.xz yuzu-077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5.tar.zst yuzu-077cc683e5ee52b3d8fca7e1ea8a914c2bdb74e5.zip |
Diffstat (limited to 'src/video_core/regs_texturing.h')
-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 { BitField<16, 1, u32> clear_texture_cache; // TODO: unimplemented } main_config; TextureConfig texture0; - INSERT_PADDING_WORDS(0x8); + + enum class CubeFace { + PositiveX = 0, + NegativeX = 1, + PositiveY = 2, + NegativeY = 3, + PositiveZ = 4, + NegativeZ = 5, + }; + + BitField<0, 22, u32> cube_address[5]; + + PAddr GetCubePhysicalAddress(CubeFace face) const { + PAddr address = texture0.address; + if (face != CubeFace::PositiveX) { + // Bits [22:27] from the main texture address is shared with all cubemap additional + // addresses. + auto& face_addr = cube_address[static_cast<size_t>(face) - 1]; + address &= ~face_addr.mask; + address |= face_addr; + } + // A multiplier of 8 is also needed in the same way as the main address. + return address * 8; + } + + INSERT_PADDING_WORDS(0x3); BitField<0, 4, TextureFormat> texture0_format; BitField<0, 1, u32> fragment_lighting_enable; INSERT_PADDING_WORDS(0x1); |