Esempio n. 1
0
 public static unsafe void BufferData <T>(ReadOnlySpan <T> data, BufferHint hint) where T : unmanaged
 {
     fixed(T *ptr = data)
     {
         BufferData(data.Length * sizeof(T), ptr, hint);
     }
 }
Esempio n. 2
0
        public static ShaderStorageBuffer CreateUninitialized <T>(int elementCount, BufferHint hint) where T : unmanaged
        {
            var instance = Create();

            instance.Bind();
            instance.BufferDataUninitialized <T>(elementCount, hint);
            instance.Unbind();
            return(instance);
        }
Esempio n. 3
0
        public static ShaderStorageBuffer Create <T>(ReadOnlySpan <T> data, BufferHint hint) where T : unmanaged
        {
            var instance = Create();

            instance.Bind();
            instance.BufferData(data, hint);
            instance.Unbind();
            return(instance);
        }
Esempio n. 4
0
 public static unsafe void BufferData(int byteSize, void *data, BufferHint hint)
 {
     GLAssert.EnsureContext();
     GL.BufferData(BufferTarget.ShaderStorageBuffer, byteSize, (IntPtr)data, hint.ToOriginalValue());
 }
Esempio n. 5
0
 public unsafe void BufferDataUninitialized <T>(int elementCount, BufferHint hint) where T : unmanaged
 {
     Ssbo.BufferData(elementCount * sizeof(T), null, hint);
 }
Esempio n. 6
0
 public void BufferData <T>(ReadOnlySpan <T> data, BufferHint hint) where T : unmanaged
 {
     Ssbo.BufferData(data, hint);
 }