Пример #1
0
 public void CreateUploadBuffer(UploadBuffer uploadBuffer, int size)
 {
     DestroyResource(uploadBuffer.resource);
     uploadBuffer.resource = device.CreateCommittedResource <ID3D12Resource>(
         HeapProperties.UploadHeapProperties,
         HeapFlags.None,
         ResourceDescription.Buffer(new ResourceAllocationInfo((ulong)size, 0)),
         ResourceStates.GenericRead);
     uploadBuffer.size = size;
 }
Пример #2
0
 public void SetCBV(UploadBuffer uploadBuffer, int offset, int slot)
 {
     commandList.SetGraphicsRootConstantBufferView(currentRootSignature.cbv[slot], uploadBuffer.resource.GPUVirtualAddress + (ulong)offset);
 }