Пример #1
0
 public void Dispose()
 {
     InstanceBuffer.Dispose();
     MaterialBuffer.Dispose();
     PassCB.Dispose();
     CmdListAlloc.Dispose();
 }
Пример #2
0
 public void Dispose()
 {
     MaterialBuffer.Dispose();
     ObjectCB.Dispose();
     PassCB.Dispose();
     CmdListAlloc.Dispose();
 }
Пример #3
0
 bool MaterialBufferIdOverlap()
 {
     try
     {
         // 13 is already used by MaterialBufferTest, so it should throw
         testBuffer = new MaterialBuffer <MaterialBufferStruct>(13);
     }
     catch { return(true); }
     return(false);
 }
Пример #4
0
 bool MaterialBufferId()
 {
     try
     {
         // ids for 0-2 should see MaterialBuffer throw an exceptions
         testBuffer = new MaterialBuffer <MaterialBufferStruct>(2);
     }
     catch { return(true); }
     return(false);
 }
Пример #5
0
        /// <summary>
        /// Function to perform clean up on the shader state.
        /// </summary>
        internal void CleanUp()
        {
            ConstantBuffers[0] = null;

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

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

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

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

            DefaultPixelShaderTextured         = null;
            DefaultPixelShaderDiffuse          = null;
            DefaultPixelShaderDiffuseMaterial  = null;
            DefaultPixelShaderTexturedMaterial = null;

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

            MaterialBuffer = null;

            if (AlphaTestValuesBuffer == null)
            {
                return;
            }

            AlphaTestValuesBuffer.Dispose();
            AlphaTestValuesBuffer = null;
        }
Пример #6
0
    bool MaterialBufferTest()
    {
        MaterialBufferStruct data = new MaterialBufferStruct {
            point = Vec3.One,
            scale = 2
        };

        try
        {
            testBuffer = new MaterialBuffer <MaterialBufferStruct>(13);
            testBuffer.Set(data);
        }
        catch (Exception e)
        {
            Log.Err(e.ToString());
            return(false);
        }
        return(true);
    }