diff --git a/src/Graphics/CommandBuffer.cs b/src/Graphics/CommandBuffer.cs index 316b762..103f5f6 100644 --- a/src/Graphics/CommandBuffer.cs +++ b/src/Graphics/CommandBuffer.cs @@ -327,8 +327,39 @@ namespace MoonWorks.Graphics } public void QueuePresent( - ref TextureSlice textureSlice, - ref Rect destinationRectangle, + in Texture texture, + in Rect destinationRectangle, + Filter filter + ) + { + var refreshRect = destinationRectangle.ToRefresh(); + var refreshTextureSlice = new Refresh.TextureSlice + { + texture = texture.Handle, + rectangle = new Refresh.Rect + { + x = 0, + y = 0, + w = (int)texture.Width, + h = (int)texture.Height + }, + layer = 0, + level = 0, + depth = 0 + }; + + Refresh.Refresh_QueuePresent( + Device.Handle, + Handle, + ref refreshTextureSlice, + ref refreshRect, + (Refresh.Filter)filter + ); + } + + public void QueuePresent( + in TextureSlice textureSlice, + in Rect destinationRectangle, Filter filter ) { var refreshTextureSlice = textureSlice.ToRefreshTextureSlice(); @@ -344,7 +375,7 @@ namespace MoonWorks.Graphics } public void QueuePresent( - ref TextureSlice textureSlice, + in TextureSlice textureSlice, Filter filter ) { var refreshTextureSlice = textureSlice.ToRefreshTextureSlice(); @@ -387,8 +418,8 @@ namespace MoonWorks.Graphics } public void CopyTextureToTexture( - ref TextureSlice sourceTextureSlice, - ref TextureSlice destinationTextureSlice, + in TextureSlice sourceTextureSlice, + in TextureSlice destinationTextureSlice, Filter filter ) { var sourceRefreshTextureSlice = sourceTextureSlice.ToRefreshTextureSlice(); @@ -404,7 +435,7 @@ namespace MoonWorks.Graphics } public void CopyTextureToBuffer( - ref TextureSlice textureSlice, + in TextureSlice textureSlice, Buffer buffer ) { var refreshTextureSlice = textureSlice.ToRefreshTextureSlice(); diff --git a/src/Graphics/Resources/ColorTarget.cs b/src/Graphics/Resources/ColorTarget.cs index 84fd208..eb66c68 100644 --- a/src/Graphics/Resources/ColorTarget.cs +++ b/src/Graphics/Resources/ColorTarget.cs @@ -5,11 +5,8 @@ namespace MoonWorks.Graphics { public class ColorTarget : GraphicsResource { - public uint Width { get; } - public uint Height { get; } - - public Texture Texture { get; } - public ColorFormat Format => Texture.Format; + public TextureSlice TextureSlice { get; } + public ColorFormat Format => TextureSlice.Texture.Format; protected override Action QueueDestroyFunction => Refresh.Refresh_QueueDestroyColorTarget; @@ -49,6 +46,7 @@ namespace MoonWorks.Graphics (Refresh.SampleCount) sampleCount, ref refreshTextureSlice ); + TextureSlice = textureSlice; } } }