3 #include "util/string.h" 5 #include "gpu_resource.h" 34 virtual void Create(
const WString& name, UINT num_elements, UINT element_size,
void* initial_data =
nullptr,
bool create_views =
true);
68 D3D12_INDEX_BUFFER_VIEW
GetIndexBufferView(UINT offset, UINT size,
bool is_32_bit =
false)
const;
GpuBuffer()
Constructs a GpuBuffer.
Definition: gpu_buffer.cc:87
virtual void Destroy()
Destroys the GpuBuffer.
Definition: gpu_buffer.cc:11
D3D12_INDEX_BUFFER_VIEW GetIndexBufferView(UINT offset, UINT size, bool is_32_bit=false) const
Definition: gpu_buffer.cc:70
virtual void CreateDerivedViews()=0
Creates the descriptors (views) for this GpuBuffer.
Wraps ID3D12Resource objects.
Definition: gpu_resource.h:19
UINT srv_id_
The SRV descriptor for this GpuBuffer.
Definition: gpu_buffer.h:90
virtual ~GpuBuffer()
Destructs the GpuBuffer.
Definition: gpu_buffer.h:21
const D3D12_GPU_VIRTUAL_ADDRESS & GetRootCBV() const
Definition: gpu_buffer.h:43
UINT element_count_
The number of elements in this GpuBuffer.
Definition: gpu_buffer.h:91
Wraps buffer-type GpuResource's.
Definition: gpu_buffer.h:17
eastl::wstring WString
Typedef for wrapping the EASTL wstring.
Definition: string.h:20
D3D12_VERTEX_BUFFER_VIEW GetVertexBufferView(UINT offset, UINT size, UINT stride) const
Definition: gpu_buffer.cc:53
const UINT & GetUAV() const
Definition: gpu_buffer.h:37
The main Blowbox namespace.
Definition: image.cc:8
D3D12_RESOURCE_DESC DescribeBuffer()
Generates a D3D12_RESOURCE_DESC based on the buffer size and resource flags.
Definition: gpu_buffer.cc:95
UINT buffer_size_
The total buffer size of this GpuBuffer.
Definition: gpu_buffer.h:93
D3D12_RESOURCE_FLAGS resource_flags_
The resource flags set on this GpuBuffer.
Definition: gpu_buffer.h:94
virtual void Create(const WString &name, UINT num_elements, UINT element_size, void *initial_data=nullptr, bool create_views=true)
Creates actual buffer resource.
Definition: gpu_buffer.cc:16
UINT element_size_
The size of each element in this GpuBuffer.
Definition: gpu_buffer.h:92
const UINT & GetSRV() const
Definition: gpu_buffer.h:40
UINT uav_id_
The UAV descriptor for this GpuBuffer.
Definition: gpu_buffer.h:89
D3D12_GPU_VIRTUAL_ADDRESS gpu_virtual_address_
The virtual address of the ID3D12Resource in VRAM.
Definition: gpu_resource.h:92
D3D12_GPU_VIRTUAL_ADDRESS GetRootCBV()
Definition: gpu_buffer.h:46