-
Notifications
You must be signed in to change notification settings - Fork 45
/
Buffer.ShaderResource.cs
30 lines (26 loc) · 1.3 KB
/
Buffer.ShaderResource.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
namespace DirectX12GameEngine.Graphics
{
public partial class GraphicsBuffer
{
public static class ShaderResource
{
public static unsafe GraphicsBuffer New(GraphicsDevice device, int size, GraphicsHeapType heapType = GraphicsHeapType.Default)
{
return GraphicsBuffer.New(device, size, BufferFlags.ShaderResource, heapType);
}
public static unsafe GraphicsBuffer<T> New<T>(GraphicsDevice device, int elementCount, GraphicsHeapType heapType = GraphicsHeapType.Default) where T : unmanaged
{
return GraphicsBuffer.New<T>(device, elementCount, BufferFlags.ShaderResource, heapType);
}
public static unsafe GraphicsBuffer<T> New<T>(GraphicsDevice device, in T data, GraphicsHeapType heapType = GraphicsHeapType.Default) where T : unmanaged
{
return GraphicsBuffer.New(device, data, BufferFlags.ShaderResource, heapType);
}
public static unsafe GraphicsBuffer<T> New<T>(GraphicsDevice device, Span<T> data, GraphicsHeapType heapType = GraphicsHeapType.Default) where T : unmanaged
{
return GraphicsBuffer.New(device, data, BufferFlags.ShaderResource, heapType);
}
}
}
}