private DescriptorSetCollection CreateImage(CommandBufferScoped cbs, ref CombinedImageHandleSet key) { var dsc = _gd.DescriptorSetManager.AllocateDescriptorSet(_gd.Api, _descriptorSetLayouts[PipelineBase.TextureSetIndex]).Get(cbs); Span <DescriptorImageInfo> imageInfos = stackalloc DescriptorImageInfo[key.Count]; for (int i = 0; i < key.Count; i++) { imageInfos[i] = new DescriptorImageInfo() { ImageLayout = ImageLayout.General, ImageView = new ImageView(key.ImageHandles[i]), Sampler = new Sampler(key.SamplerHandles[i]) }; } dsc.UpdateImages(0, 0, imageInfos, DescriptorType.CombinedImageSampler); return(dsc); }
public DescriptorSetCollection GetTexture(CommandBufferScoped cbs, ref CombinedImageHandleSet key) { return(GetOrCreate(cbs, ref key, _tCache, CreateImage)); }