Esempio n. 1
0
 internal static void Destroy(ref ConstantsBufferId id)
 {
     if (id != ConstantsBufferId.NULL)
     {
         Destroy(id); id = ConstantsBufferId.NULL;
     }
 }
Esempio n. 2
0
 internal static void InitConstantsBuffer(ConstantsBufferId id)
 {
     CBuffersData[id.Index].Buffer = new Buffer(MyRender11.Device, CBuffers.Data[id.Index].Description);
     if (CBuffers.Data[id.Index].DebugName != null)
     {
         CBuffersData[id.Index].Buffer.DebugName = CBuffers.Data[id.Index].DebugName;
     }
 }
Esempio n. 3
0
 internal static void Destroy(ConstantsBufferId id)
 {
     CbIndices.Remove(id);
     if (CBuffersData[id.Index].Buffer != null)
     {
         CBuffersData[id.Index].Buffer.Dispose();
         CBuffersData[id.Index].Buffer = null;
     }
     CBuffers.Free(id.Index);
 }
Esempio n. 4
0
        internal static ConstantsBufferId CreateConstantsBuffer(BufferDescription description, string debugName)
        {
            var id = new ConstantsBufferId {
                Index = CBuffers.Allocate()
            };

            MyArrayHelpers.Reserve(ref CBuffersData, id.Index + 1);
            CBuffers.Data[id.Index] = new MyHwBufferDesc {
                Description = description, DebugName = debugName
            };

            CbIndices.Add(id);
            InitConstantsBuffer(id);

            return(id);
        }
Esempio n. 5
0
 internal static Buffer GetConstantsBuffer(ConstantsBufferId id)
 {
     return(CBuffersData[id.Index].Buffer);
 }