Fix mipmap base level being ignored for sampled textures and images (#1911)
* Fix mipmap base level being ignored for sampled textures and images * Fix layer size and max level for textures * Missing XML doc + reorder comments
This commit is contained in:
parent
1e5b37c94f
commit
3bad321d2b
4 changed files with 159 additions and 54 deletions
|
@ -20,7 +20,8 @@ namespace Ryujinx.Graphics.Texture
|
|||
int bytesPerPixel,
|
||||
int gobBlocksInY,
|
||||
int gobBlocksInZ,
|
||||
int gobBlocksInTileX)
|
||||
int gobBlocksInTileX,
|
||||
int gpuLayerSize = 0)
|
||||
{
|
||||
bool is3D = depth > 1;
|
||||
|
||||
|
@ -94,14 +95,29 @@ namespace Ryujinx.Graphics.Texture
|
|||
layerSize += totalBlocksOfGobsInZ * totalBlocksOfGobsInY * robSize;
|
||||
}
|
||||
|
||||
layerSize = AlignLayerSize(
|
||||
layerSize,
|
||||
height,
|
||||
depth,
|
||||
blockHeight,
|
||||
gobBlocksInY,
|
||||
gobBlocksInZ,
|
||||
gobBlocksInTileX);
|
||||
if (layers > 1)
|
||||
{
|
||||
layerSize = AlignLayerSize(
|
||||
layerSize,
|
||||
height,
|
||||
depth,
|
||||
blockHeight,
|
||||
gobBlocksInY,
|
||||
gobBlocksInZ,
|
||||
gobBlocksInTileX);
|
||||
}
|
||||
|
||||
int totalSize;
|
||||
|
||||
if (layerSize < gpuLayerSize)
|
||||
{
|
||||
totalSize = (layers - 1) * gpuLayerSize + layerSize;
|
||||
layerSize = gpuLayerSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
totalSize = layerSize * layers;
|
||||
}
|
||||
|
||||
if (!is3D)
|
||||
{
|
||||
|
@ -117,8 +133,6 @@ namespace Ryujinx.Graphics.Texture
|
|||
}
|
||||
}
|
||||
|
||||
int totalSize = layerSize * layers;
|
||||
|
||||
return new SizeInfo(mipOffsets, allOffsets, levels, layerSize, totalSize);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue