home *** CD-ROM | disk | FTP | other *** search
/ Introduction to 3D Game …ogramming with DirectX 12 / Introduction-to-3D-Game-Programming-with-DirectX-12.ISO / Code.Textures / Chapter 23 Character Animation / SkinnedMesh / FrameResource.cpp next >
Encoding:
C/C++ Source or Header  |  2016-03-02  |  802 b   |  19 lines

  1. #include "FrameResource.h"
  2.  
  3. FrameResource::FrameResource(ID3D12Device* device, UINT passCount, UINT objectCount, UINT skinnedObjectCount, UINT materialCount)
  4. {
  5.     ThrowIfFailed(device->CreateCommandAllocator(
  6.         D3D12_COMMAND_LIST_TYPE_DIRECT,
  7.         IID_PPV_ARGS(CmdListAlloc.GetAddressOf())));
  8.  
  9.     PassCB = std::make_unique<UploadBuffer<PassConstants>>(device, passCount, true);
  10.     SsaoCB = std::make_unique<UploadBuffer<SsaoConstants>>(device, 1, true);
  11.     MaterialBuffer = std::make_unique<UploadBuffer<MaterialData>>(device, materialCount, false);
  12.     ObjectCB = std::make_unique<UploadBuffer<ObjectConstants>>(device, objectCount, true);
  13.     SkinnedCB = std::make_unique<UploadBuffer<SkinnedConstants>>(device, skinnedObjectCount, true);
  14. }
  15.  
  16. FrameResource::~FrameResource()
  17. {
  18.  
  19. }