added GetIndex at VKShaderParse.h
This commit is contained in:
parent
1c92d0eeaa
commit
b8f8c9a337
@ -49,7 +49,12 @@ public:
|
|||||||
return compiler->get_name(res.id);
|
return compiler->get_name(res.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t GetSet(const spirv_cross::Resource &res)const
|
const uint32_t GetIndex(const spirv_cross::Resource &res)const
|
||||||
|
{
|
||||||
|
return compiler->get_decoration(res.id,spv::DecorationIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint32_t GetDescriptorSet(const spirv_cross::Resource &res)const
|
||||||
{
|
{
|
||||||
return compiler->get_decoration(res.id,spv::DecorationDescriptorSet);
|
return compiler->get_decoration(res.id,spv::DecorationDescriptorSet);
|
||||||
}
|
}
|
||||||
@ -64,6 +69,16 @@ public:
|
|||||||
return compiler->get_decoration(res.id,spv::DecorationLocation);
|
return compiler->get_decoration(res.id,spv::DecorationLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const uint32_t GetOffset(const spirv_cross::Resource& res)const
|
||||||
|
{
|
||||||
|
return compiler->get_decoration(res.id,spv::DecorationOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint32_t GetInputAttachmentIndex(const spirv_cross::Resource& res)const
|
||||||
|
{
|
||||||
|
return compiler->get_decoration(res.id,spv::DecorationInputAttachmentIndex);
|
||||||
|
}
|
||||||
|
|
||||||
void GetFormat(const spirv_cross::Resource &res,spirv_cross::SPIRType::BaseType *base_type,uint8_t *vecsize)
|
void GetFormat(const spirv_cross::Resource &res,spirv_cross::SPIRType::BaseType *base_type,uint8_t *vecsize)
|
||||||
{
|
{
|
||||||
const spirv_cross::SPIRType &type=compiler->get_type(res.type_id);
|
const spirv_cross::SPIRType &type=compiler->get_type(res.type_id);
|
||||||
@ -72,18 +87,8 @@ public:
|
|||||||
*vecsize =type.vecsize;
|
*vecsize =type.vecsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t GetOffset(const spirv_cross::Resource& res)const
|
|
||||||
{
|
|
||||||
return compiler->get_decoration(res.id,spv::DecorationOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
const uint32_t GetBufferSize(const spirv_cross::Resource& res)const
|
const uint32_t GetBufferSize(const spirv_cross::Resource& res)const
|
||||||
{
|
{
|
||||||
return (uint32_t)(compiler->get_declared_struct_size(compiler->get_type(res.base_type_id)));
|
return (uint32_t)(compiler->get_declared_struct_size(compiler->get_type(res.base_type_id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t GetInputAttachmentIndex(const spirv_cross::Resource& res)const
|
|
||||||
{
|
|
||||||
return compiler->get_decoration(res.id,spv::DecorationInputAttachmentIndex);
|
|
||||||
}
|
|
||||||
};//class ShaderParse
|
};//class ShaderParse
|
||||||
|
@ -399,7 +399,7 @@ void OutputShaderResource(ShaderResourceData<Descriptor> *ssd,ShaderParse *sp,co
|
|||||||
for(const spirv_cross::Resource &obj:res)
|
for(const spirv_cross::Resource &obj:res)
|
||||||
{
|
{
|
||||||
strcpy(sr->name,sp->GetName(obj).c_str());
|
strcpy(sr->name,sp->GetName(obj).c_str());
|
||||||
sr->set = sp->GetSet(obj);
|
sr->set = sp->GetDescriptorSet(obj);
|
||||||
sr->binding=sp->GetBinding(obj);
|
sr->binding=sp->GetBinding(obj);
|
||||||
|
|
||||||
++sr;
|
++sr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user