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

View File

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

View File

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