aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/ITextureDescriptor.cs10
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs12
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureTarget.cs2
3 files changed, 17 insertions, 7 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/ITextureDescriptor.cs b/Ryujinx.Graphics.Gpu/Image/ITextureDescriptor.cs
new file mode 100644
index 00000000..378de44b
--- /dev/null
+++ b/Ryujinx.Graphics.Gpu/Image/ITextureDescriptor.cs
@@ -0,0 +1,10 @@
+namespace Ryujinx.Graphics.Gpu.Image
+{
+ interface ITextureDescriptor
+ {
+ public uint UnpackFormat();
+ public TextureTarget UnpackTextureTarget();
+ public bool UnpackSrgb();
+ public bool UnpackTextureCoordNormalized();
+ }
+}
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs b/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs
index 74fb9887..76d97bf8 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs
@@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <summary>
/// Maxwell texture descriptor, as stored on the GPU texture pool memory region.
/// </summary>
- struct TextureDescriptor
+ struct TextureDescriptor : ITextureDescriptor
{
#pragma warning disable CS0649
public uint Word0;
@@ -239,12 +239,12 @@ namespace Ryujinx.Graphics.Gpu.Image
GuestTextureDescriptor result = new GuestTextureDescriptor
{
Handle = uint.MaxValue,
- Descriptor = this
- };
+ Format = UnpackFormat(),
+ Target = UnpackTextureTarget(),
+ IsSrgb = UnpackSrgb(),
+ IsTextureCoordNormalized = UnpackTextureCoordNormalized(),
- // Clear the virtual address
- result.Descriptor.Word0 = 0;
- result.Descriptor.Word2 &= 0xFFFF0000;
+ };
return result;
}
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureTarget.cs b/Ryujinx.Graphics.Gpu/Image/TextureTarget.cs
index 301fc87b..1db758fc 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureTarget.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureTarget.cs
@@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <summary>
/// Texture target.
/// </summary>
- enum TextureTarget
+ enum TextureTarget : byte
{
Texture1D,
Texture2D,