Cogs.Core
|
Public Member Functions | |
void | initialize (struct GraphicsDeviceD3D12 *graphicsDevice) |
void | beginFrame () |
void | updateFrameResources () |
void | endFrame () |
void | executeCommandList () |
void | flush () |
IEffects * | getEffects () override |
void | setEffect (EffectHandle handle) override |
Set the current effect. | |
void | signal (FenceHandle fenceHandle) override |
Insert a fence in the command stream that will signal when all commands before the fence are completed. | |
void | beginRenderPass (const RenderPassInfo &info) override |
Begin a render pass. | |
void | endRenderPass () override |
End a render pass. | |
void | setRenderTarget (const RenderTargetHandle handle, const DepthStencilHandle depthStencilHandle) override |
Sets the current render target and an associated depth stencil target. | |
void | setViewport (const float x, const float y, const float width, const float height) override |
Sets the current viewport to the given location and dimensions. | |
void | setScissor (const int x, const int y, const int width, const int height) override |
Sets the current scissor rectangle. | |
void | clearRenderTarget (const float *color) override |
Clear the currently set render target to the given value (4 component floating point RGBA). | |
void | clearRenderTarget (const float **colors, const int count) override |
Clear the currently set render target, setting the individual render target views to the given values (4 component floating point RGBA). | |
void | clearDepth (const float depth=1.0f) override |
Clear the currently set depth/stencil target to the given depth. | |
void | setDepthStencilState (const DepthStencilStateHandle handle) override |
Set the current depth stencil state. | |
void | setRasterizerState (const RasterizerStateHandle handle) override |
Set the current rasterizer state. | |
void | setBlendState (const BlendStateHandle handle, const float *constant) override |
Set the current blend state. | |
void | resolveResource (TextureHandle source, TextureHandle destination) override |
Resolves the given source resource target into the given destination texture. | |
void | setInputLayout (const InputLayoutHandle inputLayoutHandle) override |
Sets the current input layout. | |
void | setVertexBuffers (const VertexBufferHandle *vertexBufferHandles, const size_t count) override |
Overload provided to support transitioning. | |
void | setVertexBuffers (const VertexBufferHandle *vertexBufferHandles, const size_t count, const uint32_t *strides, const uint32_t *offsets) override |
Sets the current vertex buffers. | |
void | setIndexBuffer (IndexBufferHandle indexBufferHandle, uint32_t stride, uint32_t offset) override |
Sets the current index buffer. | |
void | setConstantBuffer (const ConstantBufferBindingHandle bufferBinding, const BufferHandle bufferHandle, const uint32_t offset, const uint32_t size) override |
Sets a constant buffer to the given constant buffer binding. | |
void | setupConstantBuffers () |
void | setupDrawBuffers () |
void | draw (PrimitiveType::EPrimitiveType primitiveType, const size_t startVertex, const size_t numVertexes) override |
Draws non-indexed, non-instanced primitives. | |
void | drawIndexed (PrimitiveType::EPrimitiveType primitiveType, const size_t startIndex, const size_t numIndexes, const size_t startVertex) override |
Draws indexed, non-instanced primitives. | |
void | drawInstanced (PrimitiveType::EPrimitiveType primitiveType, const size_t startVertex, const size_t numVertexes, const size_t startInstance, const size_t numInstances) override |
Draws non-indexed, instanced primitives. | |
void | drawInstancedIndexed (PrimitiveType::EPrimitiveType primitiveType, const size_t startInstance, const size_t numInstances, const size_t startIndex, const size_t numIndexes) override |
Draws indexed, instanced primitives. | |
void | dispatchCompute (const unsigned int threadGroupsX, const unsigned int threadGroupsY, const unsigned int threadGroupsZ) override |
Dispatch computing work on the graphics device using the desired thread group count. | |
void | readDepthBuffer (BufferHandle bufferHandle, int x, int y, int width, int height, Framebuffer::EFrameBuffer framebuffer) override |
Reads data from the current depth target into the given bufferHandle. | |
void | readColorBuffer (BufferHandle bufferHandle, int x, int y, int width, int height, Framebuffer::EFrameBuffer framebuffer) override |
Reads data from the current render target into the given bufferHandle. | |
void * | map (BufferHandle bufferHandle, MapMode::EMapMode accessMode, uint32_t *stride=0) override |
Maps the given buffer so it can be accessed. | |
void | unmap (BufferHandle bufferHandle) override |
Unmaps the given buffer, applying any synchronization necessary to reflect changes in the mapped memory. | |
void * | map (TextureHandle textureHandle, MapMode::EMapMode accessMode, uint32_t *rowPitch, uint32_t *depthPitch) override |
Create host mapping of a staging texture. | |
void | unmap (TextureHandle textureHandle) |
Release a host mapping of a staging texture. | |
void | updateSubTexture (TextureHandle textureHandle, const size_t level, const void *data) override |
Update the data of a level in the given texture. | |
void | updateSubBuffer (BufferHandle bufferHandle, const size_t offset, const size_t size, const void *data) override |
Update a region of data in a buffer. | |
void | copyResource (BufferHandle destinationHandle, BufferHandle sourceHandle) override |
void | copyResource (TextureHandle destinationHandle, TextureHandle sourceHandle) override |
void | copyTexture (TextureHandle dstHandle, unsigned dstSub, unsigned dstX, unsigned dstY, unsigned dstZ, TextureHandle sourceHandle, unsigned srcSub) override |
void | clearResource (BufferHandle destinationHandle, uint32_t *Values) override |
void | clearResource (BufferHandle destinationHandle, float *Values) override |
void | setTexture (const TextureBindingHandle textureBindingHandle, const TextureHandle textureHandle) override |
Sets the texture given to the binding given by textureBindingHandle. | |
void | setTexture (const TextureBindingHandle textureBindingHandle, TextureViewHandle textureViewHandle) override |
void | setSamplerState (const SamplerStateBindingHandle samplerStateBindingHandle, const SamplerStateHandle samplerStateHandle) override |
Sets the sampler state binding given to the given sampler state. | |
void | setBuffer (const BufferBindingHandle bufferBindingHandle, BufferHandle bufferHandle) override |
Sets a buffer to bind to the given binding. | |
void | setBufferCounter (BufferHandle bufferHandle, uint32_t value) |
Set the associated counter of a buffer. | |
void | setBufferCounter (BufferHandle bufferHandle, BufferHandle sourceBufferHandle) |
Set the associated counter of a buffer. | |
uint32_t | getBufferCounter (BufferHandle bufferHandle) |
Get the associated counter of a buffer. | |
void | getBufferCounter (BufferHandle bufferHandle, BufferHandle destinationBufferHandle) |
Get the associated counter of a buffer. | |
void | setupPipelineState (PrimitiveType::EPrimitiveType topology) |
void | checkState (PrimitiveType::EPrimitiveType topology) |
void | destroy () |
InputAssemblerStateCommon * | getIAState () override |
EffectHandle | getCurrentEffect () override |
void | checkTextureState (TextureD3D12 &texture) |
![]() | |
virtual InputAssemblerStateCommon * | getIAState ()=0 |
virtual EffectHandle | getCurrentEffect ()=0 |
virtual IEffects * | getEffects ()=0 |
const Cogs::FrameStatistics & | getLastFrameStatistics () override |
const Cogs::UploadStatistics & | getLastUploadStatistics () override |
void | frameStatisticsConfigure (bool enable) override |
void | setMatrixVariable (const StringView &name, const float *value) override |
Sets the matrix variable with the given name in the current effect to value. | |
void | setScalarVariable (const StringView &name, const float value) override |
Sets the scalar floating point variable with the given name to the given value. | |
void | setScalarVariable (const StringView &name, int value) override |
Sets the scalar integer variable with the given name to the given value. | |
void | setVector2Variable (const StringView &name, const float *value) override |
Sets the vector variable with the given name to the given two-component value. | |
void | setVector3Variable (const StringView &name, const float *value) override |
Sets the vector variable with the given name to the given three-component value. | |
void | setVector4Variable (const StringView &name, const float *value) override |
Sets the vector variable with the given name to the given four-component value. | |
void | setVariable (const StringView &name, const uint8_t *data, size_t size) |
void | setVariable (const EffectVariableHandle index, const uint8_t *data, size_t size) override |
Sets the variable with the given name and size. | |
void | setMatrixVariable (const EffectVariableHandle variableHandle, const float *value) override |
Sets the given matrix variable to value. | |
void | setMatrixVariable (const EffectVariableHandle variableHandle, const float *value, size_t count) override |
Sets the given matrix variable to value. | |
void | setScalarVariable (const EffectVariableHandle variableHandle, const float value) override |
Sets the given scalar floating point variable to the given value. | |
void | setScalarVariable (const EffectVariableHandle variableHandle, const float *value, size_t count) override |
Sets the given scalar integer point variable to the given value. | |
void | setScalarVariable (const EffectVariableHandle variableHandle, int value) override |
Sets the given scalar integer point variable to the given value. | |
void | setScalarVariable (const EffectVariableHandle variableHandle, const int *value, size_t count) override |
Sets the given scalar integer point variable to the given value. | |
void | setVector2Variable (const EffectVariableHandle variableHandle, const float *value, size_t count=1) override |
Sets the given vector variable to the given two-component value. | |
void | setVector3Variable (const EffectVariableHandle variableHandle, const float *value, size_t count=1) override |
Sets the given vector variable to the given three-component value. | |
void | setVector4Variable (const EffectVariableHandle variableHandle, const float *value, size_t count=1) override |
Sets the given vector variable to the given four-component value. | |
void | setVector4Variable (const EffectVariableHandle variableHandle, const int *value, size_t count=1) override |
Sets the given vector variable to the given four-component value. | |
void | setConstantBuffer (const StringView &name, const BufferHandle bufferHandle, const uint32_t offset, const uint32_t size) final |
Sets a constant buffer to be bound to the given name and slot. | |
void | setBuffer (const StringView &name, BufferHandle bufferHandle) final |
Sets the given buffer to the buffer binding slot with the given name. | |
void | setTexture (const StringView &name, unsigned int unit, TextureHandle textureHandle) final |
Sets the texture slot given by unit with the given name to contain the given texture. | |
void | setTexture (const StringView &name, TextureViewHandle textureViewHandle) final |
void | setSamplerState (const StringView &name, unsigned int unit, SamplerStateHandle handle) final |
Sets the sampler slot given by unit with the given name to contain the given sampler state. | |
void | setVertexArrayObject (VertexArrayObjectHandle vertexArrayObject) override |
virtual void | signal (FenceHandle) override |
Insert a fence in the command stream that will signal when all commands before the fence are completed. | |
void | updateBuffer (BufferHandle bufferHandle, const void *data, size_t size) override |
Replace contents of buffer with new data. | |
void | frameStatisticsBeginFrame () |
virtual void | setConstantBuffer (const StringView &name, const BufferHandle bufferHandle, const uint32_t offset=0, const uint32_t size=~0u)=0 |
Sets a constant buffer to be bound to the given name and slot. | |
virtual void | setConstantBuffer (const ConstantBufferBindingHandle bufferBindingHandle, const BufferHandle bufferHandle, const uint32_t offset=0, const uint32_t size=~0u)=0 |
Sets a constant buffer to the given constant buffer binding. | |
virtual void | setBuffer (const StringView &name, BufferHandle bufferHandle)=0 |
Sets the given buffer to the buffer binding slot with the given name. | |
virtual void | setBuffer (const BufferBindingHandle bufferBindingHandle, BufferHandle bufferHandle)=0 |
Sets a buffer to bind to the given binding. | |
virtual void | setTexture (const StringView &name, unsigned int unit, TextureHandle textureHandle)=0 |
Sets the texture slot given by unit with the given name to contain the given texture. | |
virtual void | setTexture (const TextureBindingHandle textureBindingHandle, const TextureHandle textureHandle)=0 |
Sets the texture given to the binding given by textureBindingHandle. | |
virtual void | setTexture (const StringView &name, TextureViewHandle textureViewHandle)=0 |
virtual void | setTexture (const TextureBindingHandle textureBindingHandle, TextureViewHandle textureViewHandle)=0 |
virtual void | setSamplerState (const StringView &name, unsigned int unit, SamplerStateHandle samplerStateHandle)=0 |
Sets the sampler slot given by unit with the given name to contain the given sampler state. | |
virtual void | setSamplerState (const SamplerStateBindingHandle samplerStateBindingHandle, const SamplerStateHandle samplerStateHandle)=0 |
Sets the sampler state binding given to the given sampler state. | |
![]() | |
virtual const Cogs::FrameStatistics & | getLastFrameStatistics ()=0 |
virtual const Cogs::UploadStatistics & | getLastUploadStatistics ()=0 |
virtual void | frameStatisticsConfigure (bool enable)=0 |
virtual void | clearCachedState () |
Prepare context for external manipulation of graphics device. | |
virtual void | pushCommandGroupAnnotation (const StringView &name) |
Begin to tag a sequence of commands as a group in graphics debugger. | |
virtual void | popCommandGroupAnnotation () |
End to tag a sequence of commands as a group in graphics debugger. | |
virtual void | setAnnotationMarker (const StringView &name) |
Add a tag in the sequence of commands in graphics debugger. | |
virtual void | beginRenderPass (const RenderPassInfo &info)=0 |
Begin a render pass. | |
virtual void | endRenderPass ()=0 |
End a render pass. | |
virtual void | setRenderTarget (const RenderTargetHandle handle, const DepthStencilHandle depthStencilHandle)=0 |
Sets the current render target and an associated depth stencil target. | |
virtual void | setViewport (const float x, const float y, const float width, const float height)=0 |
Sets the current viewport to the given location and dimensions. | |
virtual void | setScissor (const int x, const int y, const int width, const int height)=0 |
Sets the current scissor rectangle. | |
virtual void | clearRenderTarget (const float *value)=0 |
Clear the currently set render target to the given value (4 component floating point RGBA). | |
virtual void | clearRenderTarget (const float **values, const int numvalues)=0 |
Clear the currently set render target, setting the individual render target views to the given values (4 component floating point RGBA). | |
virtual void | clearDepth (const float depth=1.0f)=0 |
Clear the currently set depth/stencil target to the given depth. | |
virtual void | setDepthStencilState (const DepthStencilStateHandle handle)=0 |
Set the current depth stencil state. | |
virtual void | setBlendState (const BlendStateHandle handle, const float *constant=nullptr)=0 |
Set the current blend state. | |
virtual void | setRasterizerState (const RasterizerStateHandle handle)=0 |
Set the current rasterizer state. | |
virtual void | setEffect (EffectHandle handle)=0 |
Set the current effect. | |
virtual void | setMatrixVariable (const StringView &name, const float *value)=0 |
Sets the matrix variable with the given name in the current effect to value. | |
virtual void | setScalarVariable (const StringView &name, const float value)=0 |
Sets the scalar floating point variable with the given name to the given value. | |
virtual void | setScalarVariable (const StringView &name, int value)=0 |
Sets the scalar integer variable with the given name to the given value. | |
virtual void | setVector2Variable (const StringView &name, const float *value)=0 |
Sets the vector variable with the given name to the given two-component value. | |
virtual void | setVector3Variable (const StringView &name, const float *value)=0 |
Sets the vector variable with the given name to the given three-component value. | |
virtual void | setVector4Variable (const StringView &name, const float *value)=0 |
Sets the vector variable with the given name to the given four-component value. | |
virtual void | setVariable (const EffectVariableHandle index, const uint8_t *data, size_t size)=0 |
Sets the variable with the given name and size. | |
virtual void | setMatrixVariable (const EffectVariableHandle variableHandle, const float *value)=0 |
Sets the given matrix variable to value. | |
virtual void | setMatrixVariable (const EffectVariableHandle variableHandle, const float *value, size_t count)=0 |
Sets the given matrix variable to value. | |
virtual void | setScalarVariable (const EffectVariableHandle variableHandle, const float value)=0 |
Sets the given scalar floating point variable to the given value. | |
virtual void | setScalarVariable (const EffectVariableHandle variableHandle, const float *value, size_t count)=0 |
Sets the given scalar integer point variable to the given value. | |
virtual void | setScalarVariable (const EffectVariableHandle variableHandle, int value)=0 |
Sets the given scalar integer point variable to the given value. | |
virtual void | setScalarVariable (const EffectVariableHandle variableHandle, const int *value, size_t count)=0 |
Sets the given scalar integer point variable to the given value. | |
virtual void | setVector2Variable (const EffectVariableHandle variableHandle, const float *value, size_t count=1)=0 |
Sets the given vector variable to the given two-component value. | |
virtual void | setVector3Variable (const EffectVariableHandle variableHandle, const float *value, size_t count=1)=0 |
Sets the given vector variable to the given three-component value. | |
virtual void | setVector4Variable (const EffectVariableHandle variableHandle, const float *value, size_t count=1)=0 |
Sets the given vector variable to the given four-component value. | |
virtual void | setVector4Variable (const EffectVariableHandle variableHandle, const int *value, size_t count=1)=0 |
Sets the given vector variable to the given four-component value. | |
virtual void | setTexture (const StringView &name, unsigned int unit, TextureHandle textureHandle)=0 |
Sets the texture slot given by unit with the given name to contain the given texture. | |
virtual void | setTexture (const TextureBindingHandle textureBindingHandle, const TextureHandle textureHandle)=0 |
Sets the texture given to the binding given by textureBindingHandle. | |
virtual void | setTexture (const StringView &name, TextureViewHandle textureViewHandle)=0 |
virtual void | setTexture (const TextureBindingHandle textureBindingHandle, TextureViewHandle textureViewHandle)=0 |
virtual void | setSamplerState (const StringView &name, unsigned int unit, SamplerStateHandle samplerStateHandle)=0 |
Sets the sampler slot given by unit with the given name to contain the given sampler state. | |
virtual void | setSamplerState (const SamplerStateBindingHandle samplerStateBindingHandle, const SamplerStateHandle samplerStateHandle)=0 |
Sets the sampler state binding given to the given sampler state. | |
virtual void | setInputLayout (const InputLayoutHandle inputLayoutHandle)=0 |
Sets the current input layout. | |
virtual void | setVertexBuffers (const VertexBufferHandle *vertexBufferHandles, const size_t count, const uint32_t *strides, const uint32_t *offsets)=0 |
Sets the current vertex buffers. | |
virtual void | setVertexBuffers (const VertexBufferHandle *vertexBufferHandles, const size_t count)=0 |
Overload provided to support transitioning. | |
virtual void | setIndexBuffer (IndexBufferHandle bufferHandle, uint32_t stride=4, uint32_t offset=0)=0 |
Sets the current index buffer. | |
virtual void | setVertexArrayObject (VertexArrayObjectHandle vertexArrayObject)=0 |
Sets vertexBuffers and index buffers using a prevalidated vertex array object. | |
virtual void | setConstantBuffer (const StringView &name, const BufferHandle bufferHandle, const uint32_t offset=0, const uint32_t size=~0u)=0 |
Sets a constant buffer to be bound to the given name and slot. | |
virtual void | setConstantBuffer (const ConstantBufferBindingHandle bufferBindingHandle, const BufferHandle bufferHandle, const uint32_t offset=0, const uint32_t size=~0u)=0 |
Sets a constant buffer to the given constant buffer binding. | |
virtual void | setBuffer (const StringView &name, BufferHandle bufferHandle)=0 |
Sets the given buffer to the buffer binding slot with the given name. | |
virtual void | setBuffer (const BufferBindingHandle bufferBindingHandle, BufferHandle bufferHandle)=0 |
Sets a buffer to bind to the given binding. | |
virtual void | setBufferCounter (BufferHandle bufferHandle, uint32_t value)=0 |
Set the associated counter of a buffer. | |
virtual void | setBufferCounter (BufferHandle bufferHandle, BufferHandle sourceBufferHandle)=0 |
Set the associated counter of a buffer. | |
virtual void | getBufferCounter (BufferHandle bufferHandle, BufferHandle destinationBufferHandle)=0 |
Get the associated counter of a buffer. | |
virtual uint32_t | getBufferCounter (BufferHandle bufferHandle)=0 |
Get the associated counter of a buffer. | |
virtual void | draw (PrimitiveType::EPrimitiveType primitiveType, const size_t startVertex, const size_t numVertexes)=0 |
Draws non-indexed, non-instanced primitives. | |
virtual void | drawIndexed (PrimitiveType::EPrimitiveType primitiveType, const size_t startIndex, const size_t numIndexes, const size_t startVertex=0)=0 |
Draws indexed, non-instanced primitives. | |
virtual void | drawInstanced (PrimitiveType::EPrimitiveType primitiveType, const size_t startVertex, const size_t numVertexes, const size_t startInstance, const size_t numInstances)=0 |
Draws non-indexed, instanced primitives. | |
virtual void | drawInstancedIndexed (PrimitiveType::EPrimitiveType primitiveType, const size_t startInstance, const size_t numInstances, const size_t startIndex, const size_t numIndexes)=0 |
Draws indexed, instanced primitives. | |
virtual void | dispatchCompute (const unsigned int threadGroupsX, const unsigned int threadGroupsY, const unsigned int threadGroupsZ)=0 |
Dispatch computing work on the graphics device using the desired thread group count. | |
virtual void | resolveResource (TextureHandle source, TextureHandle destination)=0 |
Resolves the given source resource target into the given destination texture. | |
virtual void | readDepthBuffer (BufferHandle bufferHandle, int x, int y, int width, int height, Framebuffer::EFrameBuffer framebuffer)=0 |
Reads data from the current depth target into the given bufferHandle. | |
virtual void | readColorBuffer (BufferHandle bufferHandle, int x, int y, int width, int height, Framebuffer::EFrameBuffer framebuffer)=0 |
Reads data from the current render target into the given bufferHandle. | |
virtual void * | map (BufferHandle bufferHandle, MapMode::EMapMode mapMode, uint32_t *stride=nullptr)=0 |
Maps the given buffer so it can be accessed. | |
virtual void | unmap (BufferHandle bufferHandle)=0 |
Unmaps the given buffer, applying any synchronization necessary to reflect changes in the mapped memory. | |
virtual void | updateBuffer (BufferHandle bufferHandle, const void *data, size_t size)=0 |
Replace contents of buffer with new data. | |
virtual void * | map (TextureHandle textureHandle, MapMode::EMapMode accessMode, uint32_t *rowPitch, uint32_t *depthPitch)=0 |
Create host mapping of a staging texture. | |
virtual void | unmap (TextureHandle textureHandle)=0 |
Release a host mapping of a staging texture. | |
virtual void | signal (FenceHandle fenceHandle)=0 |
Insert a fence in the command stream that will signal when all commands before the fence are completed. | |
virtual void | updateSubTexture (TextureHandle textureHandle, const size_t level, const void *data)=0 |
Update the data of a level in the given texture. | |
virtual void | updateSubBuffer (BufferHandle bufferHandle, const size_t offset, const size_t size, const void *data)=0 |
Update a region of data in a buffer. | |
virtual void | copyResource (BufferHandle destinationHandle, BufferHandle sourceHandle)=0 |
virtual void | copyResource (TextureHandle destinationHandle, TextureHandle sourceHandle)=0 |
virtual void | copyTexture (TextureHandle dstHandle, unsigned dstSub, unsigned dstX, unsigned dstY, unsigned dstZ, TextureHandle sourceHandle, unsigned srcSub)=0 |
virtual void | clearResource (BufferHandle destinationHandle, uint32_t *Values)=0 |
virtual void | clearResource (BufferHandle destinationHandle, float *Values)=0 |
virtual void | reset () |
Resets all state changes made to the GPU since the last call to beginFrame. | |
Additional Inherited Members | |
![]() | |
void | setCurrentEffect (Effect *currentEffect) |
void | updateConstantBuffers () |
void | frameStatisticsAccountDrawCall (size_t count, bool indexed) |
void | uploadStatisticsBufferUpload (size_t size) |
void | uploadStatisticsTextureUpload (size_t size) |
![]() | |
FrameStatistics | prevStats {} |
FrameStatistics | currStats {} |
UploadStatistics | prevUploadStats {} |
UploadStatistics | currUploadStats {} |
struct Cogs::ContextCommon::TrackedState | state |
Effect * | effect = nullptr |
bool | constantBuffersUpdated = true |
bool | frameStatisticsEnabled = false |
bool | uploadStatisticsEnabled = true |
Definition at line 19 of file ContextD3D12.h.
Cogs::ContextD3D12::ContextD3D12 | ( | ) |
Definition at line 61 of file ContextD3D12.cpp.
Cogs::ContextD3D12::~ContextD3D12 | ( | ) |
Definition at line 72 of file ContextD3D12.cpp.
void Cogs::ContextD3D12::beginFrame | ( | ) |
Definition at line 174 of file ContextD3D12.cpp.
|
inlineoverridevirtual |
Begin a render pass.
Render passes encapsulate binding render targets, multisample resolve and load and store operations.
While in a render pass do NOT use setRenderTarget(), clearRenderTarget(), clearDepth().
Check GraphicsDeviceCapabilities::RenderPass for support.
Implements Cogs::IContext.
Definition at line 41 of file ContextD3D12.h.
void Cogs::ContextD3D12::checkState | ( | PrimitiveType::EPrimitiveType | topology | ) |
Definition at line 702 of file ContextD3D12.cpp.
void Cogs::ContextD3D12::checkTextureState | ( | TextureD3D12 & | texture | ) |
Definition at line 1213 of file ContextD3D12.cpp.
|
overridevirtual |
Clear the currently set depth/stencil target to the given depth.
Implements Cogs::IContext.
Definition at line 649 of file ContextD3D12.cpp.
|
overridevirtual |
Clear the currently set render target, setting the individual render target views to the given values (4 component floating point RGBA).
Implements Cogs::IContext.
Definition at line 640 of file ContextD3D12.cpp.
|
overridevirtual |
Clear the currently set render target to the given value (4 component floating point RGBA).
If the render target has less than 4 components, only the first n components need to be intended values.
Implements Cogs::IContext.
Definition at line 631 of file ContextD3D12.cpp.
|
inlineoverridevirtual |
Implements Cogs::IContext.
Definition at line 94 of file ContextD3D12.h.
|
inlineoverridevirtual |
Implements Cogs::IContext.
Definition at line 93 of file ContextD3D12.h.
|
overridevirtual |
Implements Cogs::IContext.
Definition at line 1163 of file ContextD3D12.cpp.
|
overridevirtual |
Implements Cogs::IContext.
Definition at line 1172 of file ContextD3D12.cpp.
|
inlineoverridevirtual |
Implements Cogs::IContext.
Definition at line 91 of file ContextD3D12.h.
void Cogs::ContextD3D12::destroy | ( | ) |
Definition at line 79 of file ContextD3D12.cpp.
|
overridevirtual |
Dispatch computing work on the graphics device using the desired thread group count.
threadGroupsX | Number of work groups spawned in the X dimension. |
threadGroupsY | Number of work groups spawned in the Y dimension. |
threadGroupsZ | Number of work groups spawned in the Z dimension. |
Implements Cogs::IContext.
Definition at line 1379 of file ContextD3D12.cpp.
|
overridevirtual |
Draws non-indexed, non-instanced primitives.
primitiveType | Primitive type to assemble from the bound vertex buffers. |
startVertex | Index of the first vertex in the bound vertex buffers to start at when drawing. |
numVertexes | Number of vertexes to draw. |
Implements Cogs::IContext.
Definition at line 531 of file ContextD3D12.cpp.
|
overridevirtual |
Draws indexed, non-instanced primitives.
primitiveType | Primitive type to assemble from the bound vertex buffers. |
startIndex | Index of the first item in the index buffer to start at when drawing. |
numIndexes | Number of indexes to draw. |
startVertex | Index of the base vertex in the vertex buffer to index from. |
Implements Cogs::IContext.
Definition at line 540 of file ContextD3D12.cpp.
|
overridevirtual |
Draws non-indexed, instanced primitives.
primitiveType | Primitive type to assemble from the bound vertex buffers. |
startVertex | Index of the first vertex in the bound vertex buffers to start at when drawing each instance. |
numVertexes | Number of vertexes to draw per instance. |
startInstance | Index of the first instance to start drawing at. |
numInstances | Number of instances to draw. |
Implements Cogs::IContext.
Definition at line 790 of file ContextD3D12.cpp.
|
overridevirtual |
Draws indexed, instanced primitives.
primitiveType | Primitive type to assemble from the bound vertex buffers. |
startInstance | Index of the first instance to start drawing at. |
numInstances | Number of instances to draw. |
startIndex | Index of the first item in the index buffer to start at when drawing each instance. |
numIndexes | Number of indexes to draw per instance. |
Implements Cogs::IContext.
Definition at line 799 of file ContextD3D12.cpp.
void Cogs::ContextD3D12::endFrame | ( | ) |
Definition at line 255 of file ContextD3D12.cpp.
|
inlineoverridevirtual |
void Cogs::ContextD3D12::executeCommandList | ( | ) |
Definition at line 264 of file ContextD3D12.cpp.
void Cogs::ContextD3D12::flush | ( | ) |
Definition at line 278 of file ContextD3D12.cpp.
|
virtual |
Get the associated counter of a buffer.
Implements Cogs::IContext.
Definition at line 1273 of file ContextD3D12.cpp.
References Cogs::BindFlags::None, Cogs::AccessMode::Read, and Cogs::Usage::Staging.
|
virtual |
Get the associated counter of a buffer.
bufferHandle | Handle to the buffer to get the counter from. This buffer must have been created with the StructuredBufferWithCounter bind flag. |
destinationBufferHandle | Handle to a buffer to copy the counter value to. |
Implements Cogs::IContext.
Definition at line 1280 of file ContextD3D12.cpp.
|
inlineoverridevirtual |
Implements Cogs::ContextCommon.
Definition at line 116 of file ContextD3D12.h.
|
overridevirtual |
Implements Cogs::ContextCommon.
Definition at line 301 of file ContextD3D12.cpp.
|
inlineoverridevirtual |
Implements Cogs::ContextCommon.
Definition at line 115 of file ContextD3D12.h.
void Cogs::ContextD3D12::initialize | ( | struct GraphicsDeviceD3D12 * | graphicsDevice | ) |
Definition at line 92 of file ContextD3D12.cpp.
|
overridevirtual |
Maps the given buffer so it can be accessed.
bufferHandle | Valid handle to a buffer containing data to be read. |
mapMode | Mapping mode to apply when mapping the buffer. |
stride | Optional pointer to a stride value. Must be set for aliased buffer texture resources. |
Implements Cogs::IContext.
Definition at line 1059 of file ContextD3D12.cpp.
References Cogs::MapMode::Read, Cogs::MapMode::Write, and Cogs::MapMode::WriteDiscard.
|
inlineoverridevirtual |
Create host mapping of a staging texture.
textureHandle | Staging texture. | |
accessMode | MapMode::Write (requires TextureFlags::UsageWriteStaging) or MapMode::Read (requires TextureFlags::UsageReadStaging). | |
[out] | rowPitch | Number of bytes between successive rows in the mapping. |
[out] | depthPitch | Number of bytes between successive slices in the mapping. |
Implements Cogs::IContext.
Definition at line 82 of file ContextD3D12.h.
|
overridevirtual |
Reads data from the current render target into the given bufferHandle.
bufferHandle | Buffer to read the data into. Must be at least of size (width * height * sizeof(ColorFormat)). |
x | Address of the first pixel on the x-axis to read from. |
y | Address of the first pixel on the y-axis to read from. |
width | Width of the data to read in pixels. |
height | Height of the data to read in pixels. |
framebuffer | Frame buffer to read from. Applicable when e.g reading from the default double-buffered render target. |
Implements Cogs::IContext.
Definition at line 952 of file ContextD3D12.cpp.
|
overridevirtual |
Reads data from the current depth target into the given bufferHandle.
bufferHandle | Buffer to read the data into. Must be at least of size (width * height * sizeof(DepthFormat)). |
x | Address of the first pixel on the x-axis to read from. |
y | Address of the first pixel on the y-axis to read from. |
width | Width of the data to read in pixels. |
height | Height of the data to read in pixels. |
framebuffer | Frame buffer to read from. Applicable when e.g reading from the default double-buffered depth target. |
Implements Cogs::IContext.
Definition at line 810 of file ContextD3D12.cpp.
|
overridevirtual |
Resolves the given source resource target into the given destination texture.
The source texture is assumed to be a multisample format handled by the GPU internally. This method can be used to resolve such a texture so that it may later be used as a regular texture data (multisampled textures cannot be read by standard samplers).
If using multisample samplers in shaders, this step is not necessary to perform.
Implements Cogs::IContext.
Definition at line 779 of file ContextD3D12.cpp.
|
overridevirtual |
Set the current blend state.
Implements Cogs::IContext.
Definition at line 557 of file ContextD3D12.cpp.
|
overridevirtual |
Sets a buffer to bind to the given binding.
bufferBindingHandle | Handle to a buffer binding. |
bufferHandle | Handle to a buffer to set. |
Implements Cogs::IContext.
Definition at line 1285 of file ContextD3D12.cpp.
|
virtual |
Set the associated counter of a buffer.
bufferHandle | Handle to the buffer to set the counter for. This buffer must have been created with the StructuredBufferWithCounter bind flag. |
sourceBufferHandle | Handle to a buffer to copy the counter value from. |
Implements Cogs::IContext.
Definition at line 1255 of file ContextD3D12.cpp.
References Cogs::BindFlags::StructuredBufferWithCounter.
|
virtual |
Set the associated counter of a buffer.
bufferHandle | Handle to the buffer to set the counter for. This buffer must have been created with the StructuredBufferWithCounter bind flag. |
value | The new value of the counter. |
Implements Cogs::IContext.
Definition at line 1245 of file ContextD3D12.cpp.
References Cogs::BindFlags::None, Cogs::Usage::Staging, and Cogs::AccessMode::Write.
|
overridevirtual |
Sets a constant buffer to the given constant buffer binding.
bufferBindingHandle | Valid handle to a buffer binding previously created. |
bufferHandle | Handle to a buffer created with the BindFlags::ConstantBuffer flag, or NoHandle to remove any existing buffer from the binding. |
Implements Cogs::IContext.
Definition at line 360 of file ContextD3D12.cpp.
References Cogs::Handle_t< Type, Convertible >::handle.
|
overridevirtual |
Set the current depth stencil state.
Implements Cogs::IContext.
Definition at line 568 of file ContextD3D12.cpp.
|
overridevirtual |
Set the current effect.
This sets up all shader stages included in the effect (e.g if the effect contains VS and PS shaders both the VS stage and PS stage is set up.
Implements Cogs::IContext.
Definition at line 658 of file ContextD3D12.cpp.
|
overridevirtual |
Sets the current index buffer.
bufferHandle | Valid handle to an index buffer. |
stride | Byte stride of the index data. Currently only supports 2 and 4. Setting stride to zero defaults to the buffers natural stride, if any. If no natural stride is set, no buffer will be bound. |
offset | Offset in bytes from the start of the buffer to the first index to use. |
Implements Cogs::IContext.
Definition at line 341 of file ContextD3D12.cpp.
|
overridevirtual |
Sets the current input layout.
inputLayoutHandle | Valid handle to a previously created input layout. |
Implements Cogs::IContext.
Definition at line 696 of file ContextD3D12.cpp.
|
overridevirtual |
Set the current rasterizer state.
Implements Cogs::IContext.
Definition at line 551 of file ContextD3D12.cpp.
|
overridevirtual |
Sets the current render target and an associated depth stencil target.
Implements Cogs::IContext.
Definition at line 574 of file ContextD3D12.cpp.
References Cogs::Handle_t< DepthStencilTag >::InvalidHandle, Cogs::Handle_t< RenderTargetTag >::InvalidHandle, Cogs::Handle_t< RenderTargetTag >::NoHandle, and Cogs::Handle_t< DepthStencilTag >::NoHandle.
|
overridevirtual |
Sets the sampler state binding given to the given sampler state.
If the sampler state is set to NoHandle the default sampler state is set for the binding.
samplerStateBindingHandle | Valid handle to a previously created sampler state binding object. |
samplerStateHandle | Handle to a valid sampler state, or NoHandle to set the default sampler state. |
Implements Cogs::IContext.
Definition at line 1330 of file ContextD3D12.cpp.
References Cogs::Handle_t< Type, Convertible >::handle.
|
overridevirtual |
Sets the current scissor rectangle.
Only used if the current rasterizer state enabled scissor testing.
Implements Cogs::IContext.
Definition at line 625 of file ContextD3D12.cpp.
|
overridevirtual |
Sets the texture given to the binding given by textureBindingHandle.
textureBindingHandle | Valid handle to a previously created texture binding. |
textureHandle | Handle to a texture object, or NoHandle to set the default texture to the given binding. |
Implements Cogs::IContext.
Definition at line 1176 of file ContextD3D12.cpp.
References Cogs::Handle_t< Type, Convertible >::handle.
|
overridevirtual |
Implements Cogs::IContext.
Definition at line 1194 of file ContextD3D12.cpp.
void Cogs::ContextD3D12::setupConstantBuffers | ( | ) |
Definition at line 1346 of file ContextD3D12.cpp.
void Cogs::ContextD3D12::setupDrawBuffers | ( | ) |
Definition at line 377 of file ContextD3D12.cpp.
void Cogs::ContextD3D12::setupPipelineState | ( | PrimitiveType::EPrimitiveType | topology | ) |
Definition at line 389 of file ContextD3D12.cpp.
|
overridevirtual |
Overload provided to support transitioning.
Only supports vertex buffers created with legacy loadVertexBuffer API.
Implements Cogs::IContext.
Definition at line 306 of file ContextD3D12.cpp.
|
overridevirtual |
Sets the current vertex buffers.
vertexBufferHandles | Pointer to an array of vertex buffer handles of size at least count. |
count | Number of vertex buffers to bind. |
strides | Pointer to array of stride values. Must be non-null and at least of size count. |
offsets | Optional pointer to array of offset values. If non-null, must be at least of size count. |
Implements Cogs::IContext.
Definition at line 323 of file ContextD3D12.cpp.
References Cogs::BindFlags::VertexBuffer.
|
overridevirtual |
Sets the current viewport to the given location and dimensions.
Implements Cogs::IContext.
Definition at line 608 of file ContextD3D12.cpp.
|
overridevirtual |
Insert a fence in the command stream that will signal when all commands before the fence are completed.
fenceHandle | The fence to signal. |
Reimplemented from Cogs::ContextCommon.
Definition at line 166 of file ContextD3D12.cpp.
|
overridevirtual |
Unmaps the given buffer, applying any synchronization necessary to reflect changes in the mapped memory.
bufferHandle | Valid handle to a buffer that is currently mapped. |
Implements Cogs::IContext.
Definition at line 1109 of file ContextD3D12.cpp.
|
inlinevirtual |
Release a host mapping of a staging texture.
textureHandle | Staging texture that is currently mapped. |
Implements Cogs::IContext.
Definition at line 83 of file ContextD3D12.h.
void Cogs::ContextD3D12::updateFrameResources | ( | ) |
Definition at line 202 of file ContextD3D12.cpp.
|
overridevirtual |
Update a region of data in a buffer.
bufferHandle | Valid handle to a buffer to update data in. |
offset | Offset in bytes from the start of the buffer to where the new data should be written. |
size | Size of the data given. Offset + size must be inside the allocated size of the buffer. |
data | Pointer to the data to store at the given offset in the buffer. |
invalidate | Invalidate existing buffer contents before updating buffer, i.e. no need to maintain old values. |
Implements Cogs::IContext.
Definition at line 1150 of file ContextD3D12.cpp.
References Cogs::Usage::Default, Cogs::BindFlags::None, and Cogs::AccessMode::Write.
|
overridevirtual |
Update the data of a level in the given texture.
textureHandle | Valid handle to a texture to update data in. |
level | Index of the mip level to update. |
data | Pointer to the data to store in the indicated mip level. Must be sized according to the dimensions, format and mip level. |
Implements Cogs::IContext.
Definition at line 1118 of file ContextD3D12.cpp.
BuffersD3D12* Cogs::ContextD3D12::buffers |
Definition at line 163 of file ContextD3D12.h.
CD3DX12_CPU_DESCRIPTOR_HANDLE Cogs::ContextD3D12::cbvCurrentCpuHandle |
Definition at line 122 of file ContextD3D12.h.
CD3DX12_CPU_DESCRIPTOR_HANDLE Cogs::ContextD3D12::cbvCurrentCpuHandleCPU |
Definition at line 125 of file ContextD3D12.h.
CD3DX12_GPU_DESCRIPTOR_HANDLE Cogs::ContextD3D12::cbvCurrentGpuHandle |
Definition at line 123 of file ContextD3D12.h.
ID3D12CommandAllocator* Cogs::ContextD3D12::commandAllocator |
Definition at line 148 of file ContextD3D12.h.
ID3D12GraphicsCommandList* Cogs::ContextD3D12::commandList |
Definition at line 149 of file ContextD3D12.h.
bool Cogs::ContextD3D12::constantBuffersUpdated |
Definition at line 153 of file ContextD3D12.h.
EffectHandle Cogs::ContextD3D12::currentEffect |
Definition at line 159 of file ContextD3D12.h.
uint64_t Cogs::ContextD3D12::currentFenceValue = 0 |
Definition at line 146 of file ContextD3D12.h.
FrameResources* Cogs::ContextD3D12::currentFrameResources = nullptr |
Definition at line 144 of file ContextD3D12.h.
BlendStateHandle Cogs::ContextD3D12::defaultBlendState |
Definition at line 170 of file ContextD3D12.h.
DepthStencilHandle Cogs::ContextD3D12::defaultDepthStencil |
Definition at line 174 of file ContextD3D12.h.
DepthStencilStateHandle Cogs::ContextD3D12::defaultDepthStencilState |
Definition at line 168 of file ContextD3D12.h.
RasterizerStateHandle Cogs::ContextD3D12::defaultRasterizerState |
Definition at line 169 of file ContextD3D12.h.
RenderTargetHandle Cogs::ContextD3D12::defaultRenderTarget |
Definition at line 173 of file ContextD3D12.h.
SamplerStateHandle Cogs::ContextD3D12::defaultSamplerState |
Definition at line 171 of file ContextD3D12.h.
ResourcePointer<ID3D12DescriptorHeap> Cogs::ContextD3D12::descriptorHeap |
Definition at line 121 of file ContextD3D12.h.
ResourcePointer<ID3D12DescriptorHeap> Cogs::ContextD3D12::descriptorHeapCPU |
Definition at line 120 of file ContextD3D12.h.
UINT Cogs::ContextD3D12::descriptorSize |
Definition at line 132 of file ContextD3D12.h.
ResourcePointer<ID3D12Device> Cogs::ContextD3D12::device |
Definition at line 161 of file ContextD3D12.h.
EffectsD3D12* Cogs::ContextD3D12::effects |
Definition at line 165 of file ContextD3D12.h.
HANDLE Cogs::ContextD3D12::eventHandle |
Definition at line 140 of file ContextD3D12.h.
ResourcePointer<ID3D12Fence> Cogs::ContextD3D12::fence |
Definition at line 139 of file ContextD3D12.h.
size_t Cogs::ContextD3D12::frameResourceIndex = 0 |
Definition at line 143 of file ContextD3D12.h.
std::array<FrameResources, 3> Cogs::ContextD3D12::frameResources |
Definition at line 142 of file ContextD3D12.h.
struct GraphicsDeviceD3D12* Cogs::ContextD3D12::graphicsDevice |
Definition at line 108 of file ContextD3D12.h.
Direct3D12::InputAssemblerState Cogs::ContextD3D12::iaState |
Definition at line 155 of file ContextD3D12.h.
std::unordered_map<size_t, ResourcePointer<ID3D12PipelineState> > Cogs::ContextD3D12::PSOs |
Definition at line 151 of file ContextD3D12.h.
RenderTargetsD3D12* Cogs::ContextD3D12::renderTargets |
Definition at line 166 of file ContextD3D12.h.
CD3DX12_CPU_DESCRIPTOR_HANDLE Cogs::ContextD3D12::samplerCurrentCpuHandle |
Definition at line 135 of file ContextD3D12.h.
CD3DX12_GPU_DESCRIPTOR_HANDLE Cogs::ContextD3D12::samplerCurrentGpuHandle |
Definition at line 136 of file ContextD3D12.h.
ResourcePointer<ID3D12DescriptorHeap> Cogs::ContextD3D12::samplerDescriptorHeap |
Definition at line 134 of file ContextD3D12.h.
UINT Cogs::ContextD3D12::samplerHandleIncrement |
Definition at line 137 of file ContextD3D12.h.
Direct3D12::ShaderState Cogs::ContextD3D12::shaderState |
Definition at line 157 of file ContextD3D12.h.
CD3DX12_CPU_DESCRIPTOR_HANDLE Cogs::ContextD3D12::srvCurrentCpuHandle |
Definition at line 127 of file ContextD3D12.h.
CD3DX12_GPU_DESCRIPTOR_HANDLE Cogs::ContextD3D12::srvCurrentGpuHandle |
Definition at line 128 of file ContextD3D12.h.
Direct3D12::PipelineState Cogs::ContextD3D12::state |
Definition at line 156 of file ContextD3D12.h.
TexturesD3D12* Cogs::ContextD3D12::textures |
Definition at line 164 of file ContextD3D12.h.
CD3DX12_CPU_DESCRIPTOR_HANDLE Cogs::ContextD3D12::uavCurrentCpuHandle |
Definition at line 130 of file ContextD3D12.h.
CD3DX12_GPU_DESCRIPTOR_HANDLE Cogs::ContextD3D12::uavCurrentGpuHandle |
Definition at line 131 of file ContextD3D12.h.