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); }
public void Clear() { IsInvalid = false; BoundPipelineLayout = null; BoundDynamicOffsets = null; BoundDescriptorSet = null; }
public bool Equals(IGLDescriptorSet other) { if (other == null) { return(false); } if (!ReferenceEquals(Parent, other.Parent)) { return(false); } return(Key == other.Key); }
void BindCombinedSampler(IGLDescriptorSet ds, GLDescriptorPoolResourceInfo resource) { IGLNextDescriptorPool parentPool = ds.Parent; Debug.Assert(parentPool != null); for (var i = resource.Ticket.First; i <= resource.Ticket.Last; i += 1) { var image = parentPool.CombinedImageSamplers.Items[i]; if (image.SamplerHandle.HasValue) { mEntrypoint.BindCombinedImageSampler(ProgramID, (int)resource.Binding, image.SamplerHandle.Value); } } }
uint BindUniformBuffer(IGLDescriptorSet ds, GLDescriptorPoolResourceInfo resource, uint[] dynamicOffsets, uint offsetIndex) { // do diff if (BoundPipelineLayout != null) { IGLNextDescriptorPool parentPool = ds.Parent; Debug.Assert(parentPool != null); // for each active uniform block var uniformGroup = BoundPipelineLayout.Ranges[(int)resource.Binding]; var srcIndex = resource.Ticket.First; var dstIndex = uniformGroup.First; for (var j = 0; j < resource.DescriptorCount; j += 1) { var buffer = parentPool.UniformBuffers.Items[srcIndex]; mUniformBuffers[dstIndex] = buffer.BufferId; var offset = buffer.Offset; // WHAT DYNAMIC if (buffer.IsDynamic) { offset += AdjustOffset(dynamicOffsets, ref offsetIndex); } mUniformOffsets[dstIndex] = new IntPtr(offset); mUniformSizes[dstIndex] = new IntPtr(buffer.Size); srcIndex += 1; dstIndex += 1; } return(offsetIndex); } else { return(offsetIndex); } }
public bool TryTake(out IGLDescriptorSet result) { return(mAvailableSets.TryTake(out result)); }
public bool TryTake(out IGLDescriptorSet result) { result = CurrentDescriptorSet; return(true); }
public void Clear() { BoundPipelineLayout = null; BoundDynamicOffsets = null; BoundDescriptorSet = null; }
public bool Equals(IGLDescriptorSet other) { return(ReferenceEquals(this, other)); }