title: Exceed end of the virtual address at CreateConstantBufferView
body: <p>I'm following &quot;Game Programming using DirectX12&quot; ch.6 codes.</p>
  <p>But in at ID3DDevice::CreateConstantBufferView, I found D3D12 Error.</p>
  <blockquote>
  <p>D3D12 ERROR: ID3D12Device::CreateConstantBufferView: pDesc-&gt;BufferLocation + SizeInBytes - 1 (0x00000000087b00ff) exceeds end of the virtual address range of Resource (0x0DA64DA0:'Unnamed ID3D12Resource Object', GPU VA Range: 0x00000000087b0000 - 0x00000000087b003f).  [ STATE_CREATION ERROR #649: CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE]</p>
  </blockquote>
  <p>And this is my code.</p>
  <pre><code>void BoxApp::BuildConstantBuffers()
  {
      mObjectCB = std::make_unique&lt;UploadBuffer&lt;ObjectConstants&gt;&gt;(md3dDevice.Get(), 1, true);
  
      UINT objCBByteSize = calcConstantBufferByteSize(sizeof(ObjectConstants));
  
      D3D12_GPU_VIRTUAL_ADDRESS cbAddress = mObjectCB-&gt;Resource()-&gt;GetGPUVirtualAddress();
  
      int boxCBufIndex = 0;
      cbAddress += static_cast&lt;UINT64&gt;(boxCBufIndex) * static_cast&lt;UINT64&gt;(objCBByteSize);
  
      D3D12_CONSTANT_BUFFER_VIEW_DESC cbvDesc;
      cbvDesc.BufferLocation = cbAddress;
      cbvDesc.SizeInBytes = calcConstantBufferByteSize(sizeof(ObjectConstants));
      md3dDevice-&gt;CreateConstantBufferView(&amp;cbvDesc, mCbvHeap-&gt;GetCPUDescriptorHandleForHeapStart());
  }
  
  
  static UINT calcConstantBufferByteSize(UINT byteSize)
  {
      return (byteSize + 255) &amp; ~255;
  }
  </code></pre>
  <p>What occurs error, and How to fix it?</p>