Example #1
0
        //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;
        }
Example #2
0
        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);
        }
Example #3
0
        //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;
        }
Example #4
0
        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);
        }