mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
Split out guest texture layer size calcs into a seperate func
This commit is contained in:
@ -16,15 +16,20 @@ namespace skyline::gpu {
|
||||
if (layerStride)
|
||||
return layerStride;
|
||||
|
||||
layerStride = CalculateLayerSize();
|
||||
return layerStride;
|
||||
}
|
||||
|
||||
u32 GuestTexture::CalculateLayerSize() {
|
||||
switch (tileConfig.mode) {
|
||||
case texture::TileMode::Linear:
|
||||
return layerStride = static_cast<u32>(format->GetSize(dimensions));
|
||||
return static_cast<u32>(format->GetSize(dimensions));
|
||||
|
||||
case texture::TileMode::Pitch:
|
||||
return layerStride = dimensions.height * tileConfig.pitch;
|
||||
return dimensions.height * tileConfig.pitch;
|
||||
|
||||
case texture::TileMode::Block:
|
||||
return layerStride = static_cast<u32>(texture::GetBlockLinearLayerSize(dimensions, format->blockHeight, format->blockWidth, format->bpb, tileConfig.blockHeight, tileConfig.blockDepth, mipLevelCount, layerCount > 1));
|
||||
return static_cast<u32>(texture::GetBlockLinearLayerSize(dimensions, format->blockHeight, format->blockWidth, format->bpb, tileConfig.blockHeight, tileConfig.blockDepth, mipLevelCount, layerCount > 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user