uint BindStorageBuffer(GLDescriptorPoolResourceInfo resource, uint offsetIndex) { IGLDescriptorPool parentPool = DescriptorSet.Parent; // BIND SSBOS if (resource.DescriptorCount >= 1) { throw new PlatformNotSupportedException(); } for (var i = resource.Ticket.First; i <= resource.Ticket.Last; i += 1) { var buffer = parentPool.StorageBuffers.Items[i]; var offset = buffer.Offset; // WHAT ABOUT THE DYNAMIC OFFSET if (buffer.IsDynamic) { offset += AdjustOffset(ref offsetIndex); } mEntrypoint.BindStorageBuffer( resource.Binding, buffer.BufferId, offset, buffer.Size); } return(offsetIndex); }
uint BindStorageBuffer(IGLDescriptorSet ds, GLDescriptorPoolResourceInfo resource, uint[] dynamicOffsets, uint offsetIndex) { IGLNextDescriptorPool parentPool = ds.Parent; Debug.Assert(parentPool != null); // BIND SSBOS if (resource.DescriptorCount > 1) { throw new InvalidOperationException("Mg.GL : only one storage buffer per a binding allowed."); } for (var i = resource.Ticket.First; i <= resource.Ticket.Last; i += 1) { var buffer = parentPool.StorageBuffers.Items[i]; var offset = buffer.Offset; // WHAT ABOUT THE DYNAMIC OFFSET if (buffer.IsDynamic) { offset += AdjustOffset(dynamicOffsets, ref offsetIndex); } mEntrypoint.BindStorageBuffer( resource.Binding, buffer.BufferId, new IntPtr(offset), new IntPtr(buffer.Size)); } return(offsetIndex); }