mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-20 10:37:53 -05:00
video_core: Use un-shifted block sizes to avoid integer divisions
Instead of storing all block width, height and depths in their shifted form: block_width = 1U << block_shift; Store them like they are provided by the emulated hardware (their block_shift form). This way we can avoid doing the costly Common::AlignUp operation to align texture sizes and drop CPU integer divisions with bitwise logic (defined in Common::AlignBits).
This commit is contained in:
@ -219,20 +219,17 @@ struct TICEntry {
|
||||
|
||||
u32 BlockWidth() const {
|
||||
ASSERT(IsTiled());
|
||||
// The block height is stored in log2 format.
|
||||
return 1 << block_width;
|
||||
return block_width;
|
||||
}
|
||||
|
||||
u32 BlockHeight() const {
|
||||
ASSERT(IsTiled());
|
||||
// The block height is stored in log2 format.
|
||||
return 1 << block_height;
|
||||
return block_height;
|
||||
}
|
||||
|
||||
u32 BlockDepth() const {
|
||||
ASSERT(IsTiled());
|
||||
// The block height is stored in log2 format.
|
||||
return 1 << block_depth;
|
||||
return block_depth;
|
||||
}
|
||||
|
||||
bool IsTiled() const {
|
||||
|
Reference in New Issue
Block a user