示例#1
0
        // Added to support dynamic rebuilding of the font texture
        // for adding fonts after initialization time
        public void RebuildFontTexture()
        {
            _fontSampler?.Dispose();
            _fontResourceView?.Dispose();

            CreateFontsTexture();
        }
示例#2
0
        public override void DisplayMipMap(int level)
        {
            var samplerDescrition = new SamplerStateDescription(TextureFilter.ComparisonPoint, TextureAddressMode.Clamp)
            {
                MinMipLevel = level,
                MaxMipLevel = level
            };

            specificMipmapSamplerState.Dispose();
            specificMipmapSamplerState = SamplerState.New(Game.GraphicsDevice, samplerDescrition);
        }
示例#3
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            texsampler.Dispose();
            texsampleranis.Dispose();
            texsamplerflow.Dispose();

            foreach (InputLayout layout in layouts.Values)
            {
                layout.Dispose();
            }
            layouts.Clear();

            VSSceneVars.Dispose();
            VSEntityVars.Dispose();
            VSGeomVars.Dispose();
            PSSceneVars.Dispose();
            PSGeomVars.Dispose();

            ps.Dispose();
            psdef.Dispose();
            vspt.Dispose();
            vspct.Dispose();
            vspnct.Dispose();
            vspnctx.Dispose();

            disposed = true;
        }
示例#4
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }
            disposed = true;

            texsampler.Dispose();

            sundisc.Dispose();
            moonquad.Dispose();

            skylayout.Dispose();
            sunlayout.Dispose();
            moonlayout.Dispose();

            VSSunMoonVars.Dispose();
            PSSunMoonVars.Dispose();

            SkyLocalVars.Dispose();
            VSSceneVars.Dispose();
            VSEntityVars.Dispose();
            VSModelVars.Dispose();
            PSSceneVars.Dispose();

            skyps.Dispose();
            skyvs.Dispose();
            sunps.Dispose();
            sunvs.Dispose();
            moonps.Dispose();
            moonvs.Dispose();
        }
示例#5
0
        public void Dispose()
        {
            if (constantLightBuffer != null)
            {
                constantLightBuffer.Dispose();
            }
            if (constantCameraBuffer != null)
            {
                constantCameraBuffer.Dispose();
            }
            if (textureResource != null)
            {
                textureResource.Dispose();
            }

            if (constantMatrixBuffer != null)
            {
                constantMatrixBuffer.Dispose();
            }

            sampleState.Dispose();

            inputLayout.Dispose();
            pixelShader.Dispose();
            vertexShader.Dispose();
        }
示例#6
0
        public void Dispose()
        {
            _constants.Dispose();

            if (m_ds != null)
            {
                m_ds.Dispose();
                m_ds = null;
            }

            if (m_rs != null)
            {
                m_rs.Dispose();
                m_rs = null;
            }

            if (m_ss != null)
            {
                m_ss.Dispose();
                m_ss = null;
            }

            if (m_srv != null)
            {
                m_srv.Dispose();
                m_srv = null;
            }

            if (Shader != null)
            {
                Shader.Dispose();
                Shader = null;
            }
        }
示例#7
0
            public void Unload()
            {
                PixelShader.Dispose();
                VertexShader.Dispose();
                TextureView.Dispose();
                Sampler.Dispose();
                BlendState.Dispose();
                Texture2D.Dispose();
                VertexBufferBinding.Buffer.Dispose();
                VertexBuffer.Dispose();
                Layout.Dispose();
                ConstantBuffer.Dispose();



                this.PixelShader  = null;
                this.VertexShader = null;
                this.TextureView  = null;
                this.Sampler      = null;
                this.BlendState   = null;
                this.Texture2D    = null;
                this.VertexBufferBinding.Buffer = null;
                this.VertexBuffer   = null;
                this.Layout         = null;
                this.ConstantBuffer = null;
            }
示例#8
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }


            if (texsampler != null)
            {
                texsampler.Dispose();
                texsampler = null;
            }

            foreach (InputLayout layout in layouts.Values)
            {
                layout.Dispose();
            }
            layouts.Clear();

            VSSceneVars.Dispose();
            VSEntityVars.Dispose();
            VSModelVars.Dispose();
            VSGeomVars.Dispose();
            PSSceneVars.Dispose();
            PSGeomVars.Dispose();


            ps.Dispose();
            psdef.Dispose();
            vs.Dispose();

            disposed = true;
        }
 private void DisposeSamplerStates()
 {
     linearClampSamplerState.Dispose();
     linearWrapSamplerState.Dispose();
     pointClampSamplerState.Dispose();
     pointWrapSamplerState.Dispose();
 }
示例#10
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            if (texsampler != null)
            {
                texsampler.Dispose();
                texsampler = null;
            }

            foreach (InputLayout layout in layouts.Values)
            {
                layout.Dispose();
            }
            layouts.Clear();

            VSSceneVars.Dispose();
            VSEntityVars.Dispose();
            VSModelVars.Dispose();
            GeomVars.Dispose();
            BoneMatrices.Dispose();


            shadowps.Dispose();
            shadowvs.Dispose();
            shadowvs_skin.Dispose();

            disposed = true;
        }
示例#11
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            cube.Dispose();
            sphere.Dispose();
            capsule.Dispose();
            cylinder.Dispose();

            texsampler.Dispose();
            texsampleranis.Dispose();
            texsamplertnt.Dispose();

            foreach (InputLayout layout in layouts.Values)
            {
                layout.Dispose();
            }
            layouts.Clear();

            VSSceneVars.Dispose();
            VSEntityVars.Dispose();
            VSModelVars.Dispose();
            VSGeomVars.Dispose();
            PSSceneVars.Dispose();
            PSGeomVars.Dispose();
            InstGlobalVars.Dispose();
            InstLocalVars.Dispose();
            BoneMatrices.Dispose();

            basicps.Dispose();
            basicvspnct.Dispose();
            basicvspnctt.Dispose();
            basicvspncttt.Dispose();
            basicvspncct.Dispose();
            basicvspncctt.Dispose();
            basicvspnccttt.Dispose();
            basicvspnctx.Dispose();
            basicvspncctx.Dispose();
            basicvspncttx.Dispose();
            basicvspnccttx.Dispose();
            basicvspnctttx.Dispose();
            basicvspncctttx.Dispose();
            basicvspbbnct.Dispose();
            basicvspbbnctx.Dispose();
            basicvspbbnctt.Dispose();
            basicvspbbncttt.Dispose();
            basicvspbbncct.Dispose();
            basicvspbbncctx.Dispose();
            basicvspbbncttx.Dispose();
            basicvsbox.Dispose();
            basicvssphere.Dispose();
            basicvscapsule.Dispose();
            basicvscylinder.Dispose();

            disposed = true;
        }
示例#12
0
 void ShutdownShader()
 {
     samplerState.Dispose();
     matrixBuffer.Dispose();
     inputLayout.Dispose();
     pixelShader.Dispose();
     vertexShader.Dispose();
 }
        public void Dispose()
        {
            vertexShader.Dispose();
            pixelShader.Dispose();
            sampler.Dispose();
            resView.Dispose();

            cbWorldMatrix.Dispose();
        }
示例#14
0
 void ShutdownShader()
 {
     pixelBuffer.Dispose();
     samplerState.Dispose();
     constantBuffer.Dispose();
     inputLayout.Dispose();
     pixelShader.Dispose();
     vertexShader.Dispose();
 }
示例#15
0
 public void Dispose()
 {
     baseShader.Dispose();
     sampler.Dispose();
     inputLayout.Dispose();
     baseShader  = null;
     sampler     = null;
     inputLayout = null;
 }
示例#16
0
        private void Dispose(bool disposing)
        {
            if (mState != null)
            {
                mState.Dispose();
                mState = null;
            }

            mContext = null;
        }
示例#17
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (samplerState != null)
         {
             samplerState.Dispose();
         }
     }
 }
示例#18
0
 public void Dispose()
 {
     LightBuffer.Dispose();
     MatrixBuffer.Dispose();
     VertexBuffer.Dispose();
     MaterialBuffer.Dispose();
     VertShader.Dispose();
     PixShader.Dispose();
     Layout.Dispose();
     Sampler.Dispose();
 }
示例#19
0
        public override void Dispose()
        {
            vertexShader?.Dispose();
            pixelShader?.Dispose();
            inputSignature?.Dispose();
            layout?.Dispose();
            ConstantsBuffer?.Dispose();
            Texture?.Dispose();
            Sampler?.Dispose();

            base.Dispose();
        }
示例#20
0
文件: 画像.cs 项目: limyz/DTXMania2
        public static void 全インスタンスで共有するリソースを解放する()
        {
            using var _ = new LogBlock(Log.現在のメソッド名);

            _ConstantBuffer.Dispose();
            _SamplerState.Dispose();
            _RasterizerState.Dispose();
            _BlendState加算合成.Dispose();
            _BlendState通常合成.Dispose();
            _PixelShader.Dispose();
            _VertexShader.Dispose();
        }
 private void ShuddownShader()
 {
     SamplerState?.Dispose();
     SamplerState = null;
     ConstantMatrixBuffer?.Dispose();
     ConstantMatrixBuffer = null;
     Layout?.Dispose();
     Layout = null;
     PixelShader?.Dispose();
     PixelShader = null;
     VertexShader?.Dispose();
     VertexShader = null;
 }
示例#22
0
        protected override void OnDispose(bool d)
        {
            if (d)
            {
                DisposeResources();
                _pointSampler.Dispose();
                _linearSampler.Dispose();
                Service.Remove <HdrTechnique>();

                GraphicDeviceFactory.Device.BackBuffer.Resized -= OMBackBuffer_Resized;
            }
            base.OnDispose(d);
        }
示例#23
0
 public void Dispose()
 {
     if (!disposed)
     {
         disposed = true;
         vertexShader.Dispose();
         pixelShader.Dispose();
         instances.Dispose();
         indices.Dispose();
         sampler.Dispose();
         vertexConstants.Dispose();
     }
 }
示例#24
0
        /// <summary>
        /// Dispose element
        /// </summary>
        public void Dispose()
        {
            _rasterState.Dispose();
            _blendState.Dispose();
            _depthState.Dispose();
            _samplerState.Dispose();

            _backbufferView.Dispose();
            _zbufferView.Dispose();
            _swapchain.Dispose();
            _deviceContext.Dispose();
            _device.Dispose();
        }
示例#25
0
        public void VertexSamplerStatesGetSet()
        {
            var samplerState = new SamplerState {
                Filter = TextureFilter.Point
            };

            gd.VertexSamplerStates[0] = samplerState;

            var retrievedSamplerState = gd.VertexSamplerStates[0];

            Assert.That(retrievedSamplerState, Is.SameAs(samplerState));

            samplerState.Dispose();
        }
示例#26
0
        public void Dispose()
        {
            Canvas.Dispose();

            rasterizerState.Dispose();
            blendState.Dispose();
            depthStencilState.Dispose();
            samplerState.Dispose();

            backBufferView.Dispose();
            depthStencilView.Dispose();
            swapChain.Dispose();
            NativeDeviceContext.Dispose();
            NativeDevice.Dispose();
        }
示例#27
0
 public void Dispose()
 {
     if (BatchDisposing != null)
     {
         BatchDisposing(this, new EventArgs());
     }
     if (TextureD3D10 != null && !TextureD3D10.Disposed)
     {
         TextureD3D10.Dispose();
     }
     if (TextureD3D11 != null && !TextureD3D11.Disposed)
     {
         TextureD3D11.Dispose();
     }
     if (MutexD3D10 != null && !MutexD3D10.Disposed)
     {
         MutexD3D10.Dispose();
     }
     if (MutexD3D11 != null && !MutexD3D11.Disposed)
     {
         MutexD3D11.Dispose();
     }
     if (DWRenderTarget != null && !DWRenderTarget.Disposed)
     {
         DWRenderTarget.Dispose();
     }
     if (VertexBuffer != null && !VertexBuffer.Disposed)
     {
         VertexBuffer.Dispose();
     }
     if (VertexInputLayout != null && !VertexInputLayout.Disposed)
     {
         VertexInputLayout.Dispose();
     }
     if (SpriteEffect != null && !SpriteEffect.Disposed)
     {
         SpriteEffect.Dispose();
     }
     if (sampler != null && !sampler.Disposed)
     {
         sampler.Dispose();
     }
     //以下の二つはRenderContextがDisposeされるときに呼ばれないとバグが出る。(画面真っ黒)
     //これは同じ種類のブレンドステートがDisposeされてしまうからだと予測できる。
     //このため、Dispose予定リストに含めておき、RenderContextの破棄時に処理をする
     context.Disposables.Add(TransParentBlendState);
     context.Disposables.Add(state);
 }
示例#28
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            if (texsampler != null)
            {
                texsampler.Dispose();
                texsampler = null;
            }
            if (texsampleranis != null)
            {
                texsampleranis.Dispose();
                texsampleranis = null;
            }
            if (texsamplertnt != null)
            {
                texsamplertnt.Dispose();
                texsamplertnt = null;
            }

            foreach (InputLayout layout in layouts.Values)
            {
                layout.Dispose();
            }
            layouts.Clear();

            VSSceneVars.Dispose();
            VSEntityVars.Dispose();
            VSModelVars.Dispose();
            VSGeomVars.Dispose();
            PSSceneVars.Dispose();
            PSGeomVars.Dispose();

            terrainps.Dispose();
            pncctvs.Dispose();
            pnccttvs.Dispose();
            pnccttxvs.Dispose();
            pncctttxvs.Dispose();
            pncctxvs.Dispose();
            pnctttxvs.Dispose();
            pncttxvs.Dispose();

            disposed = true;
        }
示例#29
0
 public static void finalize0()
 {
     NoBlend.Dispose();
     Addition.Dispose();
     HalfAddition.Dispose();
     Subtraction.Dispose();
     Multiplication.Dispose();
     Reverse.Dispose();
     AlphaBlend.Dispose();
     Wrap.Dispose();
     Mirror.Dispose();
     CullingOn.Dispose();
     CullingOff.Dispose();
     ZTestOn.Dispose();
     ZTestOnWriteOff.Dispose();
     ZTestOff.Dispose();
 }
示例#30
0
        public void ShouldNotBeAbleToMutateStateObjectAfterBindingToGraphicsDevice()
        {
            var samplerState = new SamplerState();

            // Can mutate before binding.
            DoAsserts(samplerState, Assert.DoesNotThrow);

            // Can't mutate after binding.
            gd.SamplerStates[0] = samplerState;
            DoAsserts(samplerState, d => Assert.Throws <InvalidOperationException>(d));

            // Even after changing to different SamplerState, you still can't mutate a previously-bound object.
            gd.SamplerStates[0] = SamplerState.AnisotropicClamp;
            DoAsserts(samplerState, d => Assert.Throws <InvalidOperationException>(d));

            samplerState.Dispose();
        }