mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-14 11:21:40 +00:00
Update BufferD3D12 to use Align helper
This commit is contained in:
parent
deba8a4ea6
commit
c100ca7b3f
@ -18,6 +18,8 @@
|
|||||||
#include "backend/d3d12/ResourceAllocator.h"
|
#include "backend/d3d12/ResourceAllocator.h"
|
||||||
#include "backend/d3d12/ResourceUploader.h"
|
#include "backend/d3d12/ResourceUploader.h"
|
||||||
#include "common/Assert.h"
|
#include "common/Assert.h"
|
||||||
|
#include "common/Constants.h"
|
||||||
|
#include "common/Math.h"
|
||||||
|
|
||||||
namespace backend {
|
namespace backend {
|
||||||
namespace d3d12 {
|
namespace d3d12 {
|
||||||
@ -94,7 +96,7 @@ namespace d3d12 {
|
|||||||
|
|
||||||
uint32_t Buffer::GetD3D12Size() const {
|
uint32_t Buffer::GetD3D12Size() const {
|
||||||
// TODO(enga@google.com): TODO investigate if this needs to be a constraint at the API level
|
// TODO(enga@google.com): TODO investigate if this needs to be a constraint at the API level
|
||||||
return ((GetSize() + 256 - 1) / 256) * 256; // size is required to be 256-byte aligned.
|
return Align(GetSize(), 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
ComPtr<ID3D12Resource> Buffer::GetD3D12Resource() {
|
ComPtr<ID3D12Resource> Buffer::GetD3D12Resource() {
|
||||||
@ -178,7 +180,7 @@ namespace d3d12 {
|
|||||||
|
|
||||||
uint32_t BufferView::GetD3D12Size() const {
|
uint32_t BufferView::GetD3D12Size() const {
|
||||||
// TODO(enga@google.com): TODO investigate if this needs to be a constraint at the API level
|
// TODO(enga@google.com): TODO investigate if this needs to be a constraint at the API level
|
||||||
return ((GetSize() + 256 - 1) / 256) * 256; // size is required to be 256-byte aligned.
|
return Align(GetSize(), 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
const D3D12_CONSTANT_BUFFER_VIEW_DESC& BufferView::GetCBVDescriptor() const {
|
const D3D12_CONSTANT_BUFFER_VIEW_DESC& BufferView::GetCBVDescriptor() const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user