diff --git a/BasicCompute/BasicComputeGame.cs b/BasicCompute/BasicComputeGame.cs index cfe69a8..45efb11 100644 --- a/BasicCompute/BasicComputeGame.cs +++ b/BasicCompute/BasicComputeGame.cs @@ -110,7 +110,7 @@ namespace MoonWorks.Test GraphicsDevice.Wait(); // Print the squares! - squaresBuffer.GetData(squares, (uint) (sizeof(uint) * squares.Length)); + squaresBuffer.GetData(squares); Logger.LogInfo("Squares of the first " + squares.Length + " integers: " + string.Join(", ", squares)); } diff --git a/CopyTexture/CopyTextureGame.cs b/CopyTexture/CopyTextureGame.cs index 30eaa34..1049bb8 100644 --- a/CopyTexture/CopyTextureGame.cs +++ b/CopyTexture/CopyTextureGame.cs @@ -130,7 +130,7 @@ namespace MoonWorks.Test // Compare the original bytes to the copied bytes. byte[] copiedBytes = new byte[textureBytes.Length]; - compareBuffer.GetData(copiedBytes, (uint) copiedBytes.Length); + compareBuffer.GetData(copiedBytes); var originalSpan = new System.ReadOnlySpan(textureBytes); var copiedSpan = new System.ReadOnlySpan(copiedBytes); diff --git a/GetBufferData/GetBufferDataGame.cs b/GetBufferData/GetBufferDataGame.cs index 5d64413..8194fc1 100644 --- a/GetBufferData/GetBufferDataGame.cs +++ b/GetBufferData/GetBufferDataGame.cs @@ -45,10 +45,7 @@ namespace MoonWorks.Test // Read back and print out the vertex values PositionVertex[] readbackVertices = new PositionVertex[vertices.Length]; - vertexBuffer.GetData( - readbackVertices, - (uint) (vertexSize * readbackVertices.Length) // FIXME: Seems like this should get auto-calculated somehow - ); + vertexBuffer.GetData(readbackVertices); for (int i = 0; i < readbackVertices.Length; i += 1) { Logger.LogInfo(readbackVertices[i].ToString()); @@ -61,10 +58,7 @@ namespace MoonWorks.Test GraphicsDevice.Wait(); // Read the updated buffer - vertexBuffer.GetData( - readbackVertices, - (uint) (vertexSize * readbackVertices.Length) - ); + vertexBuffer.GetData(readbackVertices); Logger.LogInfo("=== Change first three vertices ==="); for (int i = 0; i < readbackVertices.Length; i += 1) { @@ -84,10 +78,7 @@ namespace MoonWorks.Test GraphicsDevice.Wait(); // Read the updated buffer - vertexBuffer.GetData( - readbackVertices, - (uint) (vertexSize * readbackVertices.Length) - ); + vertexBuffer.GetData(readbackVertices); Logger.LogInfo("=== Change last two vertices ==="); for (int i = 0; i < readbackVertices.Length; i += 1) { diff --git a/Texture3D/Texture3DGame.cs b/Texture3D/Texture3DGame.cs index 0a60b50..f66f398 100644 --- a/Texture3D/Texture3DGame.cs +++ b/Texture3D/Texture3DGame.cs @@ -80,7 +80,7 @@ namespace MoonWorks.Test i ); - var pixels = Refresh.Refresh_Image_Load( + var pixels = Refresh.Refresh_Image_LoadPNGFromFile( TestUtils.GetTexturePath($"tex3d_{i}.png"), out var width, out var height, @@ -90,7 +90,7 @@ namespace MoonWorks.Test var byteCount = (uint) (width * height * channels); cmdbuf.SetTextureData(slice, pixels, byteCount); - Refresh.Refresh_Image_Free(pixels); + Refresh.Refresh_Image_FreePNG(pixels); } GraphicsDevice.Submit(cmdbuf); diff --git a/TextureMipmaps/TextureMipmapsGame.cs b/TextureMipmaps/TextureMipmapsGame.cs index e918ea2..6bbf675 100644 --- a/TextureMipmaps/TextureMipmapsGame.cs +++ b/TextureMipmaps/TextureMipmapsGame.cs @@ -80,7 +80,7 @@ namespace MoonWorks.Test (uint) i ); - var pixels = Refresh.Refresh_Image_Load( + var pixels = Refresh.Refresh_Image_LoadPNGFromFile( TestUtils.GetTexturePath($"mip{i}.png"), out var width, out var height, @@ -90,7 +90,7 @@ namespace MoonWorks.Test var byteCount = (uint)(width * height * channels); cmdbuf.SetTextureData(slice, pixels, byteCount); - Refresh.Refresh_Image_Free(pixels); + Refresh.Refresh_Image_FreePNG(pixels); } GraphicsDevice.Submit(cmdbuf);