Nameless Engine
|
#include <GlslComputeShaderInterface.h>
Public Member Functions | |
GlslComputeShaderInterface (const GlslComputeShaderInterface &)=delete | |
GlslComputeShaderInterface & | operator= (const GlslComputeShaderInterface &)=delete |
virtual std::optional< Error > | bindResource (GpuResource *pResource, const std::string &sShaderResourceName, ComputeResourceUsage usage, bool bUpdateOnlyCurrentFrameResourceDescriptors=false) override |
void | dispatchOnGraphicsQueue (VkCommandBuffer pCommandBuffer) |
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 | |
GlslComputeShaderInterface (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 |
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 a GLSL 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 buffer to execute this compute shader.
pCommandBuffer | Command buffer to add dispatch command to. |