public UniformBufferInterface GetOrDefault(int descriptorSet, int bindingId, UniformBufferInterface defaultValue = null) { var tuple = new Tuple <int, int>(descriptorSet, bindingId); var buffer = Buffers.GetValueOrDefault(tuple, defaultValue); return(buffer); }
public UniformBufferInterface GetOrCreate(int descriptorSet, int bindingId) { var tuple = new Tuple <int, int>(descriptorSet, bindingId); var buffer = Buffers.GetValueOrDefault(tuple); // The buffer already exists, return it if (buffer != null) { return(buffer); } // Create a new buffer buffer = new UniformBufferInterface(); buffer.DescriptorSet = descriptorSet; buffer.BindingId = bindingId; Buffers.Add(tuple, buffer); return(buffer); }
public UniformBufferInterface GetOrDefault(UniformBindings bindings, UniformBufferInterface defaultValue = null) { return(GetOrDefault(bindings.DescriptorSet, bindings.BindingId, defaultValue)); }