2021-09-13 20:39:25 +08:00
|
|
|
|
#ifndef HGL_GRAPH_VULKAN_SHADER_RESOURCE_INCLUDE
|
|
|
|
|
#define HGL_GRAPH_VULKAN_SHADER_RESOURCE_INCLUDE
|
|
|
|
|
|
|
|
|
|
#include<hgl/type/String.h>
|
|
|
|
|
#include<hgl/type/List.h>
|
|
|
|
|
#include<hgl/type/StringList.h>
|
2023-03-02 20:19:25 +08:00
|
|
|
|
#include<hgl/graph/VKShaderStage.h>
|
|
|
|
|
#include<hgl/graph/VKStruct.h>
|
2021-09-13 20:39:25 +08:00
|
|
|
|
|
|
|
|
|
VK_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
|
|
class ShaderResource
|
|
|
|
|
{
|
|
|
|
|
VkShaderStageFlagBits stage_flag;
|
|
|
|
|
|
2023-03-19 20:18:10 +08:00
|
|
|
|
const uint32_t *spv_data;
|
2021-09-13 20:39:25 +08:00
|
|
|
|
uint32 spv_size;
|
|
|
|
|
|
2023-03-17 16:06:11 +08:00
|
|
|
|
ShaderStageIO stage_io;
|
2021-09-13 20:39:25 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2023-03-19 20:18:10 +08:00
|
|
|
|
ShaderResource(const VkShaderStageFlagBits &,const uint32_t *,const uint32);
|
2023-03-17 21:06:05 +08:00
|
|
|
|
virtual ~ShaderResource();
|
2021-09-13 20:39:25 +08:00
|
|
|
|
|
2023-03-17 16:21:12 +08:00
|
|
|
|
const VkShaderStageFlagBits GetStage ()const {return stage_flag;}
|
|
|
|
|
const char * GetStageName ()const {return GetShaderStageName(stage_flag);}
|
2021-09-13 20:39:25 +08:00
|
|
|
|
|
2023-03-19 20:23:54 +08:00
|
|
|
|
const uint32_t * GetSPVData ()const {return spv_data;}
|
|
|
|
|
const uint32_t GetSPVSize ()const {return spv_size;}
|
2021-09-13 20:39:25 +08:00
|
|
|
|
|
2023-03-19 13:37:55 +08:00
|
|
|
|
ShaderAttributeArray & GetInputs () {return stage_io.input;}
|
|
|
|
|
// ShaderAttributeArray & GetOutputs () {return stage_io.output;}
|
2021-09-13 20:39:25 +08:00
|
|
|
|
|
2023-03-17 21:06:05 +08:00
|
|
|
|
const uint GetInputCount ()const {return stage_io.input.count;}
|
|
|
|
|
// const uint GetOutputCount ()const {return stage_io.output.count;}
|
2021-09-13 20:39:25 +08:00
|
|
|
|
|
2023-03-17 16:21:12 +08:00
|
|
|
|
const ShaderAttribute * GetInput (const AnsiString &)const;
|
|
|
|
|
const int GetInputBinding (const AnsiString &)const;
|
2021-09-13 20:39:25 +08:00
|
|
|
|
};//class ShaderResource
|
|
|
|
|
VK_NAMESPACE_END
|
2023-03-17 16:21:12 +08:00
|
|
|
|
#endif//HGL_GRAPH_VULKAN_SHADER_RESOURCE_INCLUDE
|