Nameless Engine
|
#include <HlslComputeShaderInterface.h>
Public Member Functions | |
HlslComputeShaderInterface (const HlslComputeShaderInterface &)=delete | |
HlslComputeShaderInterface & | operator= (const HlslComputeShaderInterface &)=delete |
virtual std::optional< Error > | bindResource (GpuResource *pResource, const std::string &sShaderResourceName, ComputeResourceUsage usage, bool bUpdateOnlyCurrentFrameResourceDescriptors=false) override |
void | dispatchOnGraphicsQueue (ID3D12GraphicsCommandList *pCommandList) |
Public Member Functions inherited from ne::ComputeShaderInterface | |
ComputeShaderInterface (const ComputeShaderInterface &)=delete | |
ComputeShaderInterface & | operator= (const ComputeShaderInterface &)=delete |
virtual std::optional< Error > | bindResource (GpuResource *pResource, const std::string &sShaderResourceName, ComputeResourceUsage usage, bool bUpdateOnlyCurrentFrameResourceDescriptors=false)=0 |
void | submitForExecution (unsigned int iThreadGroupCountX, unsigned int iThreadGroupCountY, unsigned int iThreadGroupCountZ) |
ComputeExecutionGroup | getExecutionGroup () const |
ComputeExecutionStage | getExecutionStage () const |
std::string | getComputeShaderName () const |
Pipeline * | getUsedPipeline () const |
Protected Member Functions | |
HlslComputeShaderInterface (Renderer *pRenderer, const std::string &sComputeShaderName, ComputeExecutionStage executionStage, ComputeExecutionGroup executionGroup) | |
Protected Member Functions inherited from ne::ComputeShaderInterface | |
ComputeShaderInterface (Renderer *pRenderer, const std::string &sComputeShaderName, ComputeExecutionStage executionStage, ComputeExecutionGroup executionGroup) | |
Renderer * | getRenderer () |
Pipeline * | getPipeline () const |
unsigned int | getThreadGroupCountX () const |
unsigned int | getThreadGroupCountY () const |
unsigned int | getThreadGroupCountZ () const |
Protected Attributes | |
std::unordered_map< UINT, DirectXResource * > | cbvResources |
std::unordered_map< UINT, DirectXResource * > | uavResources |
std::unordered_map< UINT, DirectXResource * > | srvResources |
std::unordered_map< UINT, DirectXDescriptor * > | tableResources |
DirectXDescriptorHeap * | pCbvSrvUavHeap = nullptr |
UINT | iCbvSrvUavDescriptorSize = 0 |
Friends | |
class | ComputeShaderInterface |
Additional Inherited Members | |
Static Public Member Functions inherited from ne::ComputeShaderInterface | |
static std::variant< std::unique_ptr< ComputeShaderInterface >, Error > | createUsingGraphicsQueue (Renderer *pRenderer, const std::string &sCompiledComputeShaderName, ComputeExecutionStage executionStage, ComputeExecutionGroup executionGroup=ComputeExecutionGroup::FIRST) |
Static Protected Member Functions inherited from ne::ComputeShaderInterface | |
static std::variant< std::unique_ptr< ComputeShaderInterface >, Error > | createRenderSpecificInterface (Renderer *pRenderer, const std::string &sComputeShaderName, ComputeExecutionStage executionStage, ComputeExecutionGroup executionGroup) |
static std::unique_ptr< ComputeShaderInterface > | createPartiallyInitializedRenderSpecificInterface (Renderer *pRenderer, const std::string &sComputeShaderName, ComputeExecutionStage executionStage, ComputeExecutionGroup executionGroup) |
Interface to configure and run an HLSL compute shader.
|
protected |
Initializes the interface.
pRenderer | Used renderer. |
sComputeShaderName | Name of the compiled compute shader to use. |
executionStage | Determines when the shader will be executed. |
executionGroup | Determines execution group of this shader where shaders of the first group will be executed before shaders from the second group and so on. |
|
overridevirtual |
Binds the specified resource to be available in compute shaders.
pResource | Resource to bind to compute shader. |
sShaderResourceName | Resource name from shader. |
usage | Resource usage. |
bUpdateOnlyCurrentFrameResourceDescriptors | Specify true if you guarantee that you will bind a different GPU resource on the next frame, specify false if you are not sure if you will rebind the resource on the next frame or not. When true is specified only descriptors of the current frame resource will be updated (because descriptors of other frame resources might be in use and it's invalid to update them), when false descriptors of all frame resources will be updated. |
Implements ne::ComputeShaderInterface.
|
inline |
Adds a dispatch command to the specified command list to execute this compute shader.
pCommandList | Graphics command list. |
|
protected |
Stores pairs of "root parameter index" - "resource to bind as CBV".
|
protected |
Size of one CBV/SRV/UAV descriptor.
|
protected |
Descriptor heap for CBV/SRV/UAV descriptors.
|
protected |
Stores pairs of "root parameter index" - "resource to bind as SRV".
|
protected |
Stores pairs of "root parameter index" - "descriptor to bind as a table.
|
protected |
Stores pairs of "root parameter index" - "resource to bind as UAV".