removed ShaderResource
This commit is contained in:
parent
4251493415
commit
6b9ac3220b
@ -1,42 +0,0 @@
|
|||||||
#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>
|
|
||||||
#include<hgl/graph/VKShaderStage.h>
|
|
||||||
#include<hgl/graph/VKStruct.h>
|
|
||||||
|
|
||||||
VK_NAMESPACE_BEGIN
|
|
||||||
|
|
||||||
class ShaderResource
|
|
||||||
{
|
|
||||||
VkShaderStageFlagBits stage_flag;
|
|
||||||
|
|
||||||
const uint32_t *spv_data;
|
|
||||||
uint32 spv_size;
|
|
||||||
|
|
||||||
ShaderStageIO stage_io;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
ShaderResource(const VkShaderStageFlagBits &,const uint32_t *,const uint32);
|
|
||||||
virtual ~ShaderResource();
|
|
||||||
|
|
||||||
const VkShaderStageFlagBits GetStage ()const {return stage_flag;}
|
|
||||||
const char * GetStageName ()const {return GetShaderStageName(stage_flag);}
|
|
||||||
|
|
||||||
const uint32_t * GetSPVData ()const {return spv_data;}
|
|
||||||
const uint32_t GetSPVSize ()const {return spv_size;}
|
|
||||||
|
|
||||||
ShaderAttributeArray & GetInputs () {return stage_io.input;}
|
|
||||||
// ShaderAttributeArray & GetOutputs () {return stage_io.output;}
|
|
||||||
|
|
||||||
const uint GetInputCount ()const {return stage_io.input.count;}
|
|
||||||
// const uint GetOutputCount ()const {return stage_io.output.count;}
|
|
||||||
|
|
||||||
const ShaderAttribute * GetInput (const AnsiString &)const;
|
|
||||||
const int GetInputBinding (const AnsiString &)const;
|
|
||||||
};//class ShaderResource
|
|
||||||
VK_NAMESPACE_END
|
|
||||||
#endif//HGL_GRAPH_VULKAN_SHADER_RESOURCE_INCLUDE
|
|
@ -1,55 +0,0 @@
|
|||||||
#include<hgl/graph/VKShaderResource.h>
|
|
||||||
#include<hgl/graph/VKFormat.h>
|
|
||||||
#include<hgl/filesystem/FileSystem.h>
|
|
||||||
#include<hgl/type/Map.h>
|
|
||||||
#include<hgl/io/ConstBufferReader.h>
|
|
||||||
|
|
||||||
VK_NAMESPACE_BEGIN
|
|
||||||
ShaderResource::ShaderResource(const VkShaderStageFlagBits &flag,const uint32_t *sd,const uint32 size)
|
|
||||||
{
|
|
||||||
stage_flag=flag;
|
|
||||||
spv_data=sd;
|
|
||||||
spv_size=size;
|
|
||||||
|
|
||||||
Init(stage_io);
|
|
||||||
}
|
|
||||||
|
|
||||||
ShaderResource::~ShaderResource()
|
|
||||||
{
|
|
||||||
Clear(stage_io);
|
|
||||||
}
|
|
||||||
|
|
||||||
const ShaderAttribute *ShaderResource::GetInput(const AnsiString &name) const
|
|
||||||
{
|
|
||||||
if(stage_io.input.count<=0)return(nullptr);
|
|
||||||
|
|
||||||
const ShaderAttribute *ss=stage_io.input.items;
|
|
||||||
|
|
||||||
for(uint i=0;i<stage_io.input.count;i++)
|
|
||||||
{
|
|
||||||
if(name==ss->name)
|
|
||||||
return ss;
|
|
||||||
|
|
||||||
++ss;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int ShaderResource::GetInputBinding(const AnsiString &name) const
|
|
||||||
{
|
|
||||||
if(stage_io.input.count<=0)return(-1);
|
|
||||||
|
|
||||||
const ShaderAttribute *ss=stage_io.input.items;
|
|
||||||
|
|
||||||
for(uint i=0;i<stage_io.input.count;i++)
|
|
||||||
{
|
|
||||||
if(name==ss->name)
|
|
||||||
return i;
|
|
||||||
|
|
||||||
++ss;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
VK_NAMESPACE_END
|
|
Loading…
x
Reference in New Issue
Block a user