Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
|
#include <depth_buffer.h>
Public Member Functions | |
DepthBuffer (float depth_clear=1.0f, UINT stencil_clear=0) | |
void | Create (const eastl::wstring &name, UINT width, UINT height, DXGI_FORMAT format) |
const UINT & | GetDSV () const |
const UINT & | GetDSVDepthReadOnly () const |
const UINT & | GetDSVStencilReadOnly () const |
const UINT & | GetDSVReadOnly () const |
const UINT & | GetDepthSRV () const |
const UINT & | GetStencilSRV () const |
const UINT & | GetStencilClearValue () const |
const float & | GetDepthClearValue () const |
Public Member Functions inherited from blowbox::PixelBuffer | |
PixelBuffer () | |
const UINT & | GetWidth () const |
const UINT & | GetHeight () const |
const DXGI_FORMAT & | GetFormat () const |
Public Member Functions inherited from blowbox::GpuResource | |
GpuResource () | |
GpuResource (ID3D12Resource *resource, D3D12_RESOURCE_STATES current_state) | |
virtual | ~GpuResource () |
void | Associate (ID3D12Resource *resource, D3D12_RESOURCE_STATES current_state) |
void | Destroy () |
ID3D12Resource * | operator-> () |
const ID3D12Resource * | operator-> () const |
operator ID3D12Resource * () | |
ID3D12Resource * | Get () |
const D3D12_RESOURCE_STATES & | GetState () const |
const D3D12_RESOURCE_STATES & | GetTransitionState () const |
Protected Member Functions | |
void | CreateDerivedViews (DXGI_FORMAT format) |
Protected Member Functions inherited from blowbox::PixelBuffer | |
D3D12_RESOURCE_DESC | DescribeTex2D (UINT width, UINT height, UINT depth_or_array_size, UINT num_mips, DXGI_FORMAT format, UINT flags) |
void | AssociateWithResource (const WString &name, ID3D12Resource *resource, const D3D12_RESOURCE_STATES ¤t_resource_state) |
void | CreateTextureResource (const WString &name, const D3D12_RESOURCE_DESC &resource_desc, const D3D12_CLEAR_VALUE &clear_value) |
Protected Member Functions inherited from blowbox::GpuResource | |
void | AddToMemoryProfiler () |
void | RemoveFromMemoryProfiler () |
Private Attributes | |
UINT | dsv_id_ |
UINT | dsv_depth_read_id_ |
UINT | dsv_stencil_read_id_ |
UINT | dsv_read_id_ |
UINT | srv_depth_id_ |
UINT | srv_stencil_id_ |
UINT | stencil_clear_ |
float | depth_clear_ |
Additional Inherited Members | |
Static Protected Member Functions inherited from blowbox::PixelBuffer | |
static DXGI_FORMAT | GetBaseFormat (DXGI_FORMAT format) |
static DXGI_FORMAT | GetUAVFormat (DXGI_FORMAT format) |
static DXGI_FORMAT | GetDSVFormat (DXGI_FORMAT format) |
static DXGI_FORMAT | GetDepthFormat (DXGI_FORMAT format) |
static DXGI_FORMAT | GetStencilFormat (DXGI_FORMAT format) |
Protected Attributes inherited from blowbox::PixelBuffer | |
UINT | width_ |
UINT | height_ |
UINT | array_size_ |
DXGI_FORMAT | format_ |
Protected Attributes inherited from blowbox::GpuResource | |
WString | name_ |
ID3D12Resource * | resource_ |
D3D12_RESOURCE_STATES | usage_state_ |
D3D12_RESOURCE_STATES | transition_state_ |
D3D12_GPU_VIRTUAL_ADDRESS | gpu_virtual_address_ |
Wrapper for DepthBuffer-like resources.
This buffer wraps all functionality for a depth buffer. DepthBuffers are useful for depth-testing. If you didn't know that, you probably shouldn't be reading this anyway.
blowbox::DepthBuffer::DepthBuffer | ( | float | depth_clear = 1.0f , |
UINT | stencil_clear = 0 |
||
) |
Constructs a DepthBuffer with a preset depth and stencil clear value.
[in] | depth_clear | The default value the depth part of the buffer should be cleared to. |
[in] | stencil_clear | The default value the stencil part of the buffer should be cleared to. |
void blowbox::DepthBuffer::Create | ( | const eastl::wstring & | name, |
UINT | width, | ||
UINT | height, | ||
DXGI_FORMAT | format | ||
) |
Creates the actual DepthBuffer.
[in] | name | The name of the DepthBuffer resource. |
[in] | width | The width of the DepthBuffer resource in texels. |
[in] | height | The height of the DepthBuffer resource in texels. |
[in] | format | The format of the DepthBuffer. From this, it is automatically determined if it should have a stencil part or not. |
|
protected |
Creates all the resource descriptors (views) for this resource.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
The depth clear value.
|
private |
The Depth Stencil View for this DepthBuffer with depth read only.
|
private |
The base Depth Stencil View for this DepthBuffer.
|
private |
The Depth Stencil View for this DepthBuffer which is completely read only.
|
private |
The Depth Stencil View for this DepthBuffer with stencil read only.
|
private |
The Shader Resource View for this DepthBuffer for the depth part.
|
private |
The Shader Resource View for this DepthBuffer for the stencil part.
|
private |
The stencil clear value.