Add support for saturation on some shader instructions, fix ReadTexture alignment and add ColorMask support (#451)
* Add support for saturation on some shader instructions, fix ReadTexture alignment * Add ColorMask support, other tweaks
This commit is contained in:
parent
894459fcd7
commit
72317d7777
8 changed files with 63 additions and 12 deletions
|
@ -235,18 +235,23 @@ namespace Ryujinx.Graphics.Texture
|
|||
|
||||
int BytesPerPixel = Desc.BytesPerPixel;
|
||||
|
||||
int OutOffs = 0;
|
||||
//Note: Each row of the texture needs to be aligned to 4 bytes.
|
||||
int Pitch = (Width * BytesPerPixel + 3) & ~3;
|
||||
|
||||
byte[] Data = new byte[Width * Height * BytesPerPixel];
|
||||
byte[] Data = new byte[Height * Pitch];
|
||||
|
||||
for (int Y = 0; Y < Height; Y++)
|
||||
for (int X = 0; X < Width; X++)
|
||||
{
|
||||
long Offset = (uint)Swizzle.GetSwizzleOffset(X, Y);
|
||||
int OutOffs = Y * Pitch;
|
||||
|
||||
CpuMemory.ReadBytes(Position + Offset, Data, OutOffs, BytesPerPixel);
|
||||
for (int X = 0; X < Width; X++)
|
||||
{
|
||||
long Offset = (uint)Swizzle.GetSwizzleOffset(X, Y);
|
||||
|
||||
OutOffs += BytesPerPixel;
|
||||
CpuMemory.ReadBytes(Position + Offset, Data, OutOffs, BytesPerPixel);
|
||||
|
||||
OutOffs += BytesPerPixel;
|
||||
}
|
||||
}
|
||||
|
||||
return Data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue