&pOut->pitchAlign,
&pOut->heightAlign);
- if (pIn->pitchAlign != 0)
- {
- ADDR_ASSERT((pIn->pitchAlign % pOut->pitchAlign) == 0);
- pOut->pitchAlign = pIn->pitchAlign;
- }
-
- if (pIn->heightAlign != 0)
- {
- ADDR_ASSERT((pIn->heightAlign % pOut->heightAlign) == 0);
- pOut->heightAlign = pIn->heightAlign;
- }
-
if ((pIn->tileMode == ADDR_TM_LINEAR_GENERAL) && pIn->flags.color && (pIn->height > 1))
{
#if !ALT_TEST
&expHeight,
&pOut->heightAlign);
+ if (pIn->pitchAlign != 0)
+ {
+ ADDR_ASSERT((pIn->pitchAlign % pOut->pitchAlign) == 0);
+ pOut->pitchAlign = pIn->pitchAlign;
+
+ if (IsPow2(pOut->pitchAlign))
+ {
+ expPitch = PowTwoAlign(expPitch, pOut->pitchAlign);
+ }
+ else
+ {
+ expPitch += pOut->pitchAlign - 1;
+ expPitch /= pOut->pitchAlign;
+ expPitch *= pOut->pitchAlign;
+ }
+ }
+
+ if (pIn->heightAlign != 0)
+ {
+ ADDR_ASSERT((pIn->heightAlign % pOut->heightAlign) == 0);
+ pOut->heightAlign = pIn->heightAlign;
+
+ if (IsPow2(pOut->heightAlign))
+ {
+ expHeight = PowTwoAlign(expHeight, pOut->heightAlign);
+ }
+ else
+ {
+ expHeight += pOut->heightAlign - 1;
+ expHeight /= pOut->heightAlign;
+ expHeight *= pOut->heightAlign;
+ }
+ }
pOut->pitch = expPitch;
pOut->height = expHeight;