Example #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);
     }
 }
Example #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);
        }
Example #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);
        }
Example #4
0
 public static unsafe void BufferData(int byteSize, void *data, BufferHint hint)
 {
     GLAssert.EnsureContext();
     GL.BufferData(BufferTarget.ShaderStorageBuffer, byteSize, (IntPtr)data, hint.ToOriginalValue());
 }
Example #5
0
 public unsafe void BufferDataUninitialized <T>(int elementCount, BufferHint hint) where T : unmanaged
 {
     Ssbo.BufferData(elementCount * sizeof(T), null, hint);
 }
Example #6
0
 public void BufferData <T>(ReadOnlySpan <T> data, BufferHint hint) where T : unmanaged
 {
     Ssbo.BufferData(data, hint);
 }