示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 public UniformBufferInterface GetOrDefault(UniformBindings bindings, UniformBufferInterface defaultValue = null)
 {
     return(GetOrDefault(bindings.DescriptorSet, bindings.BindingId, defaultValue));
 }