update tests for MoonWorks API changes
parent
129421e80a
commit
a2d1fea543
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ namespace MoonWorks.Test
|
|||
|
||||
// Compare the original bytes to the copied bytes.
|
||||
byte[] copiedBytes = new byte[textureBytes.Length];
|
||||
compareBuffer.GetData<byte>(copiedBytes, (uint) copiedBytes.Length);
|
||||
compareBuffer.GetData(copiedBytes);
|
||||
|
||||
var originalSpan = new System.ReadOnlySpan<byte>(textureBytes);
|
||||
var copiedSpan = new System.ReadOnlySpan<byte>(copiedBytes);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue