mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-08-02 02:02:26 -07:00
Quads, QuadStrip, const attributes and half-float attributes support (#447)
* Quads, QuadStrip and const attributes support * Add support for half float attributes and fix texture pitch alignment * Throw when an unsupported float type is used as const attribute aswell
This commit is contained in:
@@ -289,7 +289,11 @@ namespace Ryujinx.Graphics.Texture
|
||||
{
|
||||
ImageDescriptor Desc = GetImageDescriptor(Format);
|
||||
|
||||
return Desc.BytesPerPixel * DivRoundUp(Width, Desc.BlockWidth);
|
||||
int Pitch = Desc.BytesPerPixel * DivRoundUp(Width, Desc.BlockWidth);
|
||||
|
||||
Pitch = (Pitch + 0x1f) & ~0x1f;
|
||||
|
||||
return Pitch;
|
||||
}
|
||||
|
||||
public static int GetBlockWidth(GalImageFormat Format)
|
||||
|
@@ -40,7 +40,7 @@ namespace Ryujinx.Graphics.Texture
|
||||
int Width = (Tic[4] & 0xffff) + 1;
|
||||
int Height = (Tic[5] & 0xffff) + 1;
|
||||
|
||||
return new GalImage(
|
||||
GalImage Image = new GalImage(
|
||||
Width,
|
||||
Height,
|
||||
TileWidth,
|
||||
@@ -51,6 +51,13 @@ namespace Ryujinx.Graphics.Texture
|
||||
YSource,
|
||||
ZSource,
|
||||
WSource);
|
||||
|
||||
if (Layout == GalMemoryLayout.Pitch)
|
||||
{
|
||||
Image.Pitch = (Tic[3] & 0xffff) << 5;
|
||||
}
|
||||
|
||||
return Image;
|
||||
}
|
||||
|
||||
public static GalTextureSampler MakeSampler(NvGpu Gpu, NvGpuVmm Vmm, long TscPosition)
|
||||
|
Reference in New Issue
Block a user