rename cpuBuffer to transferBuffer in Font

what_if_no_video_threads
cosmonaut 2024-02-23 10:43:22 -08:00
parent 8648eef5d1
commit 0a5ec9e82d
1 changed files with 4 additions and 4 deletions

View File

@ -51,22 +51,22 @@ namespace MoonWorks.Graphics.Font
ImageUtils.ImageInfoFromFile(imagePath, out var width, out var height, out var sizeInBytes); ImageUtils.ImageInfoFromFile(imagePath, out var width, out var height, out var sizeInBytes);
var texture = Texture.CreateTexture2D(graphicsDevice, width, height, TextureFormat.R8G8B8A8, TextureUsageFlags.Sampler); var texture = Texture.CreateTexture2D(graphicsDevice, width, height, TextureFormat.R8G8B8A8, TextureUsageFlags.Sampler);
var cpuBuffer = new TransferBuffer(graphicsDevice, sizeInBytes); var transferBuffer = new TransferBuffer(graphicsDevice, sizeInBytes);
ImageUtils.DecodeIntoTransferBuffer( ImageUtils.DecodeIntoTransferBuffer(
imagePath, imagePath,
cpuBuffer, transferBuffer,
0, 0,
SetDataOptions.Overwrite SetDataOptions.Overwrite
); );
commandBuffer.BeginCopyPass(); commandBuffer.BeginCopyPass();
commandBuffer.UploadToTexture( commandBuffer.UploadToTexture(
cpuBuffer, transferBuffer,
texture texture
); );
commandBuffer.EndCopyPass(); commandBuffer.EndCopyPass();
cpuBuffer.Dispose(); transferBuffer.Dispose();
NativeMemory.Free(fontFileByteBuffer); NativeMemory.Free(fontFileByteBuffer);
NativeMemory.Free(atlasFileByteBuffer); NativeMemory.Free(atlasFileByteBuffer);