View Single Post
Old 19 January 2018, 10:11   #59
LaBodilsen
Registered User
 
Join Date: Dec 2017
Location: Denmark
Posts: 179
Just tried some rough calculations to see the cycle count, to see if using Downscaling with longwords could be worth it. i assume you upscale the mipmap like below.

Mipmap upscale:
Code:
move.w	(a1),(a0)+		; 12 cycles
move.w	(a1)+,(a0)+		; 12 cycles
move.w	(a1),(a0)+		; 12 cycles
move.w	(a1)+,(a0)+		; 12 cycles
= 48 cycles
Mipmap downscale:
Code:
move.w	(a1)+,(a0)+		; 12 cycles
move.w	(a1)+,(a0)+		; 12 cycles
addq.l	#2,A1			; 4 cycles
move.w	(a1)+,(a0)+		; 12 cycles
move.w	(a1)+,(a0)+		; 12 cycles
= 52 cycles
Mipmap downscale with longwords:
Code:
move.l	(a1)+,(a0)+		; 20 cycles
addq.l	#4,A1			; 8 cycles
move.l	(a1)+,(a0)+		; 20 cycles
= 48 cycles
So in some cases downscaling with longwords would be faster than mipmap upscaling* So in some cases downscaling with longwords would be as fast as mipmap upscaling, and downscaling with words are in some cases only 4 cycles slower per 4 pixels. or am i missing the point here? ofcourse using longwords with mipmap upscaling would also in some cases be even faster.

Just an idea to take advantage of this:
for walls between 63 - 48 use downscaling of 64px texture with longwords where possible, and for 47-33 use mipmap upscaling of 32px texture with longwords where possible.

as mentioned, i would'nt mind if i had to manually hand optimize every wall height below 64 pixels

EDIT: *Changed the cycle count after Tony corrected me

Last edited by LaBodilsen; 19 January 2018 at 12:32. Reason: Changed the cycle count after Tony corrected me
LaBodilsen is offline  
 
Page generated in 0.04178 seconds with 11 queries