MAGE  v0.171.0
Matthias Advanced Game Engine
mage::rendering::Pipeline Struct Reference

#include <pipeline.hpp>

Classes

struct  CS
 
struct  DS
 
struct  GS
 
struct  HS
 
struct  IA
 
struct  OM
 
struct  PS
 
struct  RS
 
struct  SO
 
struct  TS
 
struct  VS
 

Static Public Member Functions

static void DrawAuto (ID3D11DeviceContext &device_context) noexcept
 
static void Draw (ID3D11DeviceContext &device_context, U32 nb_vertices, U32 vertex_start) noexcept
 
static void DrawInstanced (ID3D11DeviceContext &device_context, U32 nb_indices_per_instance, U32 nb_instances, U32 vertex_start, U32 instance_start=0u) noexcept
 
static void DrawIndexed (ID3D11DeviceContext &device_context, U32 nb_indices, U32 index_start, U32 index_offset=0u) noexcept
 
static void DrawIndexedInstanced (ID3D11DeviceContext &device_context, U32 nb_indices_per_instance, U32 nb_instances, U32 index_start, U32 index_offset=0u, U32 instance_start=0u) noexcept
 
static void Dispatch (ID3D11DeviceContext &device_context, U32 nb_thread_groups_x, U32 nb_thread_groups_y, U32 nb_thread_groups_z) noexcept
 
static void DrawInstancedIndirect (ID3D11DeviceContext &device_context, ID3D11Buffer &buffer, U32 byte_offset) noexcept
 
static void DrawIndexedInstancedIndirect (ID3D11DeviceContext &device_context, ID3D11Buffer &buffer, U32 byte_offset) noexcept
 
static void DispatchIndirect (ID3D11DeviceContext &device_context, ID3D11Buffer &buffer, U32 byte_offset) noexcept
 
static HRESULT Map (ID3D11DeviceContext &device_context, ID3D11Resource &resource, U32 subresource, D3D11_MAP map_type, U32 map_flags, D3D11_MAPPED_SUBRESOURCE &mapped_resource) noexcept
 
static void Unmap (ID3D11DeviceContext &device_context, ID3D11Resource &resource, U32 subresource) noexcept
 
static void UpdateSubresource (ID3D11DeviceContext &device_context, ID3D11Resource &dst_resource, U32 dst_subresource, const void *src_data, U32 src_row_pitch, U32 src_depth_pitch, const D3D11_BOX *dst_box=nullptr) noexcept
 
static void BindConstantBuffer (ID3D11DeviceContext &device_context, U32 slot, ID3D11Buffer *buffer) noexcept
 
static void BindConstantBuffers (ID3D11DeviceContext &device_context, U32 slot, U32 nb_buffers, ID3D11Buffer *const *buffers) noexcept
 
static void BindSRV (ID3D11DeviceContext &device_context, U32 slot, ID3D11ShaderResourceView *srv) noexcept
 
static void BindSRVs (ID3D11DeviceContext &device_context, U32 slot, U32 nb_srvs, ID3D11ShaderResourceView *const *srvs) noexcept
 
static void BindSampler (ID3D11DeviceContext &device_context, U32 slot, ID3D11SamplerState *sampler) noexcept
 
static void BindSamplers (ID3D11DeviceContext &device_context, U32 slot, U32 nb_samplers, ID3D11SamplerState *const *samplers) noexcept
 

Static Public Attributes

static constexpr D3D_FEATURE_LEVEL s_feature_levels [2]
 
static U32 s_nb_draws = 0u
 

Static Private Member Functions

static void OnDraw () noexcept
 

Detailed Description

The (rendering and compute) pipeline.

Member Function Documentation

◆ BindConstantBuffer()

static void mage::rendering::Pipeline::BindConstantBuffer ( ID3D11DeviceContext &  device_context,
U32  slot,
ID3D11Buffer *  buffer 
)
staticnoexcept

Binds a constant buffer to all shader stages.

Precondition
slot < D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT.
Parameters
[in,out]device_contextA reference to the device context.
[in]slotThe index into the device's zero-based array to set the constant buffer to (ranges from 0 to D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1).
[in]bufferA pointer to the constant buffer.

◆ BindConstantBuffers()

static void mage::rendering::Pipeline::BindConstantBuffers ( ID3D11DeviceContext &  device_context,
U32  slot,
U32  nb_buffers,
ID3D11Buffer *const *  buffers 
)
staticnoexcept

Binds an array of constant buffers to all shader stages.

Precondition
slot < D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT.
nb_buffers < D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT
  • slot.
buffers points to an array containing at least nb_buffers pointers to a constant buffer.
Parameters
[in,out]device_contextA reference to the device context.
[in]slotThe index into the device's zero-based array to begin setting constant buffers to (ranges from 0 to D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1).
[in]nb_buffersThe number of constant buffers in the array (ranges from 0 to D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT
  • slot).
[in]buffersA pointer to an array of constant buffers.

◆ BindSampler()

static void mage::rendering::Pipeline::BindSampler ( ID3D11DeviceContext &  device_context,
U32  slot,
ID3D11SamplerState *  sampler 
)
staticnoexcept

Binds a sampler to all shader stages.

Precondition
slot < D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT.
Parameters
[in,out]device_contextA reference to the device context.
[in]slotThe index into the device's zero-based array to set the sampler to (ranges from 0 to D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1).
[in]samplerA pointer to the sampler.

◆ BindSamplers()

static void mage::rendering::Pipeline::BindSamplers ( ID3D11DeviceContext &  device_context,
U32  slot,
U32  nb_samplers,
ID3D11SamplerState *const *  samplers 
)
staticnoexcept

Binds an array of samplers to all shader stages.

Precondition
slot < D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT.
nb_samplers < D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT
  • slot.
samplers points to an array containing at least nb_samplers pointers to a sampler.
Parameters
[in,out]device_contextA reference to the device context.
[in]slotThe index into the device's zero-based array to begin setting samplers to (ranges from 0 to D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1).
[in]nb_samplersThe number of samplers in the array. Each pipeline stage has a total of 16 sampler slots available (ranges from 0 to D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - slot).
[in]samplersA pointer to an array of samplers.

◆ BindSRV()

static void mage::rendering::Pipeline::BindSRV ( ID3D11DeviceContext &  device_context,
U32  slot,
ID3D11ShaderResourceView *  srv 
)
staticnoexcept

Binds a shader resource view to all shader stages.

Precondition
slot < D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT.
Parameters
[in,out]device_contextA reference to the device context.
[in]slotThe index into the device's zero-based array to set the shader resource view to (ranges from 0 to D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1).
[in]srvA pointer to the shader resource view.

◆ BindSRVs()

static void mage::rendering::Pipeline::BindSRVs ( ID3D11DeviceContext &  device_context,
U32  slot,
U32  nb_srvs,
ID3D11ShaderResourceView *const *  srvs 
)
staticnoexcept

Binds an array of shader resource views to all shaders stage.

Precondition
slot < D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT.
nb_srvs < D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
  • slot.
srvs points to an array containing at least nb_srvs pointers to a shader resource view.
Parameters
[in,out]device_contextA reference to the device context.
[in]slotThe index into the device's zero-based array to begin setting shader resource views to (ranges from 0 to D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1).
[in]nb_srvsThe number of shader resource views in the array. Up to a maximum of 128 slots are available for shader resource views (ranges from 0 to D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - slot).
[in]srvsA pointer to an array of shader resource views.

◆ Dispatch()

static void mage::rendering::Pipeline::Dispatch ( ID3D11DeviceContext &  device_context,
U32  nb_thread_groups_x,
U32  nb_thread_groups_y,
U32  nb_thread_groups_z 
)
staticnoexcept

◆ DispatchIndirect()

static void mage::rendering::Pipeline::DispatchIndirect ( ID3D11DeviceContext &  device_context,
ID3D11Buffer &  buffer,
U32  byte_offset 
)
staticnoexcept

◆ Draw()

static void mage::rendering::Pipeline::Draw ( ID3D11DeviceContext &  device_context,
U32  nb_vertices,
U32  vertex_start 
)
staticnoexcept

◆ DrawAuto()

static void mage::rendering::Pipeline::DrawAuto ( ID3D11DeviceContext &  device_context)
staticnoexcept

◆ DrawIndexed()

static void mage::rendering::Pipeline::DrawIndexed ( ID3D11DeviceContext &  device_context,
U32  nb_indices,
U32  index_start,
U32  index_offset = 0u 
)
staticnoexcept

◆ DrawIndexedInstanced()

static void mage::rendering::Pipeline::DrawIndexedInstanced ( ID3D11DeviceContext &  device_context,
U32  nb_indices_per_instance,
U32  nb_instances,
U32  index_start,
U32  index_offset = 0u,
U32  instance_start = 0u 
)
staticnoexcept

◆ DrawIndexedInstancedIndirect()

static void mage::rendering::Pipeline::DrawIndexedInstancedIndirect ( ID3D11DeviceContext &  device_context,
ID3D11Buffer &  buffer,
U32  byte_offset 
)
staticnoexcept

◆ DrawInstanced()

static void mage::rendering::Pipeline::DrawInstanced ( ID3D11DeviceContext &  device_context,
U32  nb_indices_per_instance,
U32  nb_instances,
U32  vertex_start,
U32  instance_start = 0u 
)
staticnoexcept

◆ DrawInstancedIndirect()

static void mage::rendering::Pipeline::DrawInstancedIndirect ( ID3D11DeviceContext &  device_context,
ID3D11Buffer &  buffer,
U32  byte_offset 
)
staticnoexcept

◆ Map()

static HRESULT mage::rendering::Pipeline::Map ( ID3D11DeviceContext &  device_context,
ID3D11Resource &  resource,
U32  subresource,
D3D11_MAP  map_type,
U32  map_flags,
D3D11_MAPPED_SUBRESOURCE &  mapped_resource 
)
staticnoexcept

◆ OnDraw()

static void mage::rendering::Pipeline::OnDraw ( )
staticprivatenoexcept

◆ Unmap()

static void mage::rendering::Pipeline::Unmap ( ID3D11DeviceContext &  device_context,
ID3D11Resource &  resource,
U32  subresource 
)
staticnoexcept

◆ UpdateSubresource()

static void mage::rendering::Pipeline::UpdateSubresource ( ID3D11DeviceContext &  device_context,
ID3D11Resource &  dst_resource,
U32  dst_subresource,
const void *  src_data,
U32  src_row_pitch,
U32  src_depth_pitch,
const D3D11_BOX *  dst_box = nullptr 
)
staticnoexcept

Member Data Documentation

◆ s_feature_levels

constexpr D3D_FEATURE_LEVEL mage::rendering::Pipeline::s_feature_levels[2]
static
Initial value:
= {
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0
}

The supported feature levels.

◆ s_nb_draws

U32 mage::rendering::Pipeline::s_nb_draws = 0u
static

The number of draw calls