summaryrefslogtreecommitdiff
path: root/src/video_core/textures/texture.h
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-05-10 04:17:48 -0300
committerGravatar ReinUsesLisp2019-06-20 21:36:12 -0300
commit345e73f2feb0701e3c3099d002a1c21fb524eae4 (patch)
treec8c934dfec804d04a29f8ee27124274f5f999fb8 /src/video_core/textures/texture.h
parenttexture_cache: Change internal cache from lists to vectors (diff)
downloadyuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.gz
yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.xz
yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.zip
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).
Diffstat (limited to 'src/video_core/textures/texture.h')
-rw-r--r--src/video_core/textures/texture.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h
index 219bfd559..f22b4e7c7 100644
--- a/src/video_core/textures/texture.h
+++ b/src/video_core/textures/texture.h
@@ -219,20 +219,17 @@ struct TICEntry {
219 219
220 u32 BlockWidth() const { 220 u32 BlockWidth() const {
221 ASSERT(IsTiled()); 221 ASSERT(IsTiled());
222 // The block height is stored in log2 format. 222 return block_width;
223 return 1 << block_width;
224 } 223 }
225 224
226 u32 BlockHeight() const { 225 u32 BlockHeight() const {
227 ASSERT(IsTiled()); 226 ASSERT(IsTiled());
228 // The block height is stored in log2 format. 227 return block_height;
229 return 1 << block_height;
230 } 228 }
231 229
232 u32 BlockDepth() const { 230 u32 BlockDepth() const {
233 ASSERT(IsTiled()); 231 ASSERT(IsTiled());
234 // The block height is stored in log2 format. 232 return block_depth;
235 return 1 << block_depth;
236 } 233 }
237 234
238 bool IsTiled() const { 235 bool IsTiled() const {