Exemplo n.º 1
0
 internal static void Destroy(ref ConstantsBufferId id)
 {
     if (id != ConstantsBufferId.NULL)
     {
         Destroy(id); id = ConstantsBufferId.NULL;
     }
 }
Exemplo 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;
     }
 }
Exemplo 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);
 }
Exemplo 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);
        }
Exemplo n.º 5
0
 internal static Buffer GetConstantsBuffer(ConstantsBufferId id)
 {
     return(CBuffersData[id.Index].Buffer);
 }