//in the main vulkan thread void updateTextureSet() { nextTexture.CreateView(); nextTexture.CreateSampler(); nextTexture.Descriptor.imageLayout = VkImageLayout.ShaderReadOnlyOptimal; dev.WaitIdle(); DescriptorSetWrites uboUpdate = new DescriptorSetWrites(descriptorSet, dsLayout.Bindings[1]); uboUpdate.Write(dev, nextTexture.Descriptor); texture?.Dispose(); texture = nextTexture; nextTexture = null; }
protected override void Dispose(bool disposing) { if (disposing) { if (!isDisposed) { dev.WaitIdle(); for (int i = 0; i < swapChain.ImageCount; ++i) { frameBuffers[i]?.Dispose(); } grPipeline.Dispose(); plCompute.Dispose(); plNormalize.Dispose(); dslCompute.Dispose(); dslImage.Dispose(); dsPool.Dispose(); inBuff.Dispose(); outBuff.Dispose(); stagingDataBuff.Dispose(); imgResult.Dispose(); } } base.Dispose(disposing); }
//in the main vulkan thread void updateTextureSet() { nextTexture.CreateView(VkImageViewType.Cube, VkImageAspectFlags.Color, 6); nextTexture.CreateSampler(); nextTexture.Descriptor.imageLayout = VkImageLayout.ShaderReadOnlyOptimal; DescriptorSetWrites uboUpdate = new DescriptorSetWrites(descriptorSet, dsLayout.Bindings[1]); uboUpdate.Write(dev, nextTexture.Descriptor); texture?.Dispose(); texture = nextTexture; nextTexture = null; }
protected override void Dispose(bool disposing) { if (disposing) { if (!isDisposed) { dev.WaitIdle(); pipeline.Dispose(); frameBuffers?.Dispose(); descriptorPool.Dispose(); texture.Dispose(); uboMats.Dispose(); vbo.Dispose(); } } base.Dispose(disposing); }