Nameless Engine
Loading...
Searching...
No Matches
GlslComputeShaderInterface.h
1#pragma once
2
3// Custom.
4#include "shader/ComputeShaderInterface.h"
5
6// External.
7#include "vulkan/vulkan.h"
8
9namespace ne {
12 // Only parent class can create instances of this class because there are some specific things
13 // we need to do when creating objects of this class and parent class handles these things.
14 friend class ComputeShaderInterface;
15
16 public:
18 virtual ~GlslComputeShaderInterface() override = default;
19
22
42 [[nodiscard]] virtual std::optional<Error> bindResource(
43 GpuResource* pResource,
44 const std::string& sShaderResourceName,
45 ComputeResourceUsage usage,
46 bool bUpdateOnlyCurrentFrameResourceDescriptors = false) override;
47
55 inline void dispatchOnGraphicsQueue(VkCommandBuffer pCommandBuffer) {
56 vkCmdDispatch(
58 }
59
60 protected:
72 const std::string& sComputeShaderName,
73 ComputeExecutionStage executionStage,
74 ComputeExecutionGroup executionGroup);
75 };
76}
Definition: ComputeShaderInterface.h:46
unsigned int getThreadGroupCountX() const
Definition: ComputeShaderInterface.h:223
Renderer * pRenderer
Definition: ComputeShaderInterface.h:241
unsigned int getThreadGroupCountY() const
Definition: ComputeShaderInterface.h:230
const ComputeExecutionGroup executionGroup
Definition: ComputeShaderInterface.h:259
const ComputeExecutionStage executionStage
Definition: ComputeShaderInterface.h:256
unsigned int getThreadGroupCountZ() const
Definition: ComputeShaderInterface.h:237
const std::string sComputeShaderName
Definition: ComputeShaderInterface.h:262
Definition: GlslComputeShaderInterface.h:11
void dispatchOnGraphicsQueue(VkCommandBuffer pCommandBuffer)
Definition: GlslComputeShaderInterface.h:55
virtual std::optional< Error > bindResource(GpuResource *pResource, const std::string &sShaderResourceName, ComputeResourceUsage usage, bool bUpdateOnlyCurrentFrameResourceDescriptors=false) override
Definition: GlslComputeShaderInterface.cpp:16
Definition: GpuResource.h:16
Definition: Renderer.h:44