Use Texture.CreateTexture* instead of using TextureCreateInfo

pull/2/head
Caleb Cornett 2023-01-22 20:03:48 -05:00
parent eeb76ff9d5
commit 1148a00f29
3 changed files with 10 additions and 30 deletions

View File

@ -53,16 +53,14 @@ namespace MoonWorks.Test
// Create and populate the GPU resources
vertexBuffer = Buffer.Create<PositionTextureVertex>(GraphicsDevice, BufferUsageFlags.Vertex, 4);
indexBuffer = Buffer.Create<ushort>(GraphicsDevice, BufferUsageFlags.Index, 6);
rt = new Texture(GraphicsDevice, new TextureCreateInfo
{
Width = 16,
Height = 16,
Depth = (uint) colors.Length,
Format = TextureFormat.R8G8B8A8,
IsCube = false,
LevelCount = 1,
UsageFlags = TextureUsageFlags.ColorTarget | TextureUsageFlags.Sampler
});
rt = Texture.CreateTexture3D(
GraphicsDevice,
16,
16,
(uint) colors.Length,
TextureFormat.R8G8B8A8,
TextureUsageFlags.ColorTarget | TextureUsageFlags.Sampler
);
CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer();
cmdbuf.SetBufferData(

View File

@ -49,16 +49,7 @@ namespace MoonWorks.Test
// Create and populate the GPU resources
vertexBuffer = Buffer.Create<PositionTextureVertex>(GraphicsDevice, BufferUsageFlags.Vertex, 4);
indexBuffer = Buffer.Create<ushort>(GraphicsDevice, BufferUsageFlags.Index, 6);
texture = new Texture(GraphicsDevice, new TextureCreateInfo
{
Width = 16,
Height = 16,
Depth = 7,
Format = TextureFormat.R8G8B8A8,
IsCube = false,
LevelCount = 1,
UsageFlags = TextureUsageFlags.Sampler
});
texture = Texture.CreateTexture3D(GraphicsDevice, 16, 16, 7, TextureFormat.R8G8B8A8, TextureUsageFlags.Sampler);
CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer();
cmdbuf.SetBufferData(

View File

@ -29,16 +29,7 @@ namespace MoonWorks.Test
// Create and populate the GPU resources
vertexBuffer = Buffer.Create<PositionTextureVertex>(GraphicsDevice, BufferUsageFlags.Vertex, 3);
texture = new Texture(GraphicsDevice, new TextureCreateInfo
{
Width = 3,
Height = 1,
Depth = 1,
Format = TextureFormat.R8G8B8A8,
IsCube = false,
LevelCount = 1,
UsageFlags = TextureUsageFlags.Sampler
});
texture = Texture.CreateTexture2D(GraphicsDevice, 3, 1, TextureFormat.R8G8B8A8, TextureUsageFlags.Sampler);
sampler = new Sampler(GraphicsDevice, SamplerCreateInfo.PointClamp);
CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer();