Skip to content

Commit b94abb5

Browse files
authored
Adjust BaseWidth for RGB24 format (#64)
1 parent f5b23a0 commit b94abb5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Source/GmmLib/Texture/GmmGen12Texture.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ GMM_STATUS GMM_STDCALL GmmLib::GmmGen12TextureCalc::FillTex2D(GMM_TEXTURE_INFO *
316316
Height = pTexInfo->BaseHeight;
317317
Width = GFX_ULONG_CAST(pTexInfo->BaseWidth);
318318

319+
if((pTexInfo->Format == GMM_FORMAT_R8G8B8_UINT) && (pTexInfo->Flags.Info.Linear || pTexInfo->Flags.Info.TiledX))
320+
{
321+
Width += GFX_CEIL_DIV(Width, 63);
322+
}
323+
319324
pTexInfo->MSAA.NumSamples = GFX_MAX(pTexInfo->MSAA.NumSamples, 1);
320325

321326
if(pTexInfo->Flags.Info.TiledYf || GMM_IS_64KB_TILE(pTexInfo->Flags))

Source/GmmLib/Texture/GmmGen9Texture.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,12 @@ GMM_STATUS GMM_STDCALL GmmLib::GmmGen9TextureCalc::FillTex1D(GMM_TEXTURE_INFO *
153153
/////////////////////////////
154154
// Calculate Surface QPitch
155155
/////////////////////////////
156-
157-
Width = __GMM_EXPAND_WIDTH(this, GFX_ULONG_CAST(pTexInfo->BaseWidth), HAlign, pTexInfo);
156+
Width = GFX_ULONG_CAST(pTexInfo->BaseWidth);
157+
if((pTexInfo->Format == GMM_FORMAT_R8G8B8_UINT) && (pTexInfo->Flags.Info.Linear || pTexInfo->Flags.Info.TiledX))
158+
{
159+
Width += GFX_CEIL_DIV(Width, 63);
160+
}
161+
Width = __GMM_EXPAND_WIDTH(this, Width, HAlign, pTexInfo);
158162
MipWidth = Width;
159163

160164
if((pTexInfo->Flags.Info.TiledYf || GMM_IS_64KB_TILE(pTexInfo->Flags)) &&

0 commit comments

Comments
 (0)