[WIP] next step is ShaderCreateInfo::ProcOutput
This commit is contained in:
parent
90a4f1d49f
commit
806bf5dfdd
@ -1 +1 @@
|
||||
Subproject commit 31a4223bd8646dfb603502f4c5bb51e5bd12f5e5
|
||||
Subproject commit 78b650ebfec0bbcbff948284ebf54344f8413275
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include<hgl/graph/VertexAttrib.h>
|
||||
#include<hgl/graph/VKInterpolation.h>
|
||||
#include<hgl/graph/VKSamplerType.h>
|
||||
#include<hgl/graph/VKImageType.h>
|
||||
#include<hgl/CompOperator.h>
|
||||
@ -13,13 +14,12 @@ namespace hgl
|
||||
{
|
||||
Scalar=0,
|
||||
Vector,
|
||||
Materix,
|
||||
Matrix,
|
||||
Sampler,
|
||||
Image,
|
||||
AtomicCounter,
|
||||
ImplicitConversion,
|
||||
|
||||
ENUM_CLASS_RANGE(Scalar,Materix)
|
||||
ENUM_CLASS_RANGE(Scalar,AtomicCounter)
|
||||
};//enum class ShaderVariableBaseType
|
||||
|
||||
using SVBaseType=ShaderVariableBaseType;
|
||||
@ -123,7 +123,7 @@ namespace hgl
|
||||
{
|
||||
svt_code=0;
|
||||
|
||||
base_type=SVBaseType::Materix;
|
||||
base_type=SVBaseType::Matrix;
|
||||
|
||||
matrix.type=vabt;
|
||||
matrix.n=col;
|
||||
@ -170,7 +170,7 @@ namespace hgl
|
||||
return(true);
|
||||
}
|
||||
|
||||
if(base_type==SVBaseType::Materix)
|
||||
if(base_type==SVBaseType::Matrix)
|
||||
{
|
||||
if(matrix.m==0)
|
||||
{
|
||||
@ -216,7 +216,7 @@ namespace hgl
|
||||
return int(vector.type)-int(svt.vector.type);
|
||||
}
|
||||
|
||||
if(base_type==SVBaseType::Materix)
|
||||
if(base_type==SVBaseType::Matrix)
|
||||
{
|
||||
off=int(matrix.type)-int(svt.matrix.type);
|
||||
|
||||
@ -240,6 +240,8 @@ namespace hgl
|
||||
|
||||
CompOperator(const ShaderVariableType &,Comp)
|
||||
|
||||
const char *GetTypename()const;
|
||||
|
||||
const uint64 ToCode()const{return svt_code;}
|
||||
const bool FromCode(const uint64 code)
|
||||
{
|
||||
@ -366,5 +368,150 @@ namespace hgl
|
||||
|
||||
const SVType SVT_Image2DMS(ShaderImageType::Image2DMS,1);
|
||||
const SVType SVT_Image2DMSArray(ShaderImageType::Image2DMSArray,1);
|
||||
|
||||
struct ShaderVariable
|
||||
{
|
||||
char name[VERTEX_ATTRIB_NAME_MAX_LENGTH];
|
||||
uint location;
|
||||
SVType type;
|
||||
Interpolation interpolation; //插值方式
|
||||
};
|
||||
|
||||
struct ShaderVariableArray
|
||||
{
|
||||
uint count;
|
||||
|
||||
ShaderVariable *items;
|
||||
|
||||
public:
|
||||
|
||||
ShaderVariableArray()
|
||||
{
|
||||
count=0;
|
||||
items=nullptr;
|
||||
}
|
||||
|
||||
~ShaderVariableArray()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
int Comp(const ShaderVariableArray *sva)const
|
||||
{
|
||||
if(!sva)
|
||||
return 1;
|
||||
|
||||
int off=count-sva->count;
|
||||
if(off)return off;
|
||||
|
||||
for(uint i=0;i<count;i++)
|
||||
{
|
||||
off=items[i].location-sva->items[i].location;
|
||||
if(off)
|
||||
return off;
|
||||
|
||||
if(items[i].type.ToCode()>sva->items[i].type.ToCode())
|
||||
return 1;
|
||||
|
||||
//ToCode返回的是uint64,可能差值超大,所以不能直接用-的结果
|
||||
|
||||
if(items[i].type.ToCode()<sva->items[i].type.ToCode())
|
||||
return -1;
|
||||
|
||||
off=int(items[i].interpolation)-int(sva->items[i].interpolation);
|
||||
if(off)
|
||||
return off;
|
||||
|
||||
off=hgl::strcmp(items[i].name,sva->items[i].name);
|
||||
if(off)
|
||||
return off;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Comp(const ShaderVariableArray &sva)const{return Comp(&sva);}
|
||||
|
||||
CompOperator(const ShaderVariableArray *,Comp)
|
||||
CompOperator(const ShaderVariableArray &,Comp)
|
||||
|
||||
bool Init(const uint c=0)
|
||||
{
|
||||
if(items)
|
||||
return(false);
|
||||
|
||||
if(c>0)
|
||||
{
|
||||
count=c;
|
||||
items=array_alloc<ShaderVariable>(count);
|
||||
}
|
||||
else
|
||||
{
|
||||
count=0;
|
||||
items=nullptr;
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool IsMember(const char *name)const
|
||||
{
|
||||
if(count<=0)
|
||||
return(false);
|
||||
|
||||
for(uint i=0;i<count;i++)
|
||||
if(hgl::strcmp(items[i].name,name)==0)
|
||||
return(true);
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
bool Add(ShaderVariable &sv)
|
||||
{
|
||||
if(IsMember(sv.name))
|
||||
return(false);
|
||||
|
||||
sv.location=count;
|
||||
|
||||
if(!items)
|
||||
{
|
||||
items=array_alloc<ShaderVariable>(1);
|
||||
count=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
++count;
|
||||
items=array_realloc(items,count);
|
||||
}
|
||||
|
||||
hgl_cpy(items[count-1],sv);
|
||||
return(true);
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
if(items)
|
||||
{
|
||||
array_free(items);
|
||||
items=nullptr;
|
||||
}
|
||||
|
||||
count=0;
|
||||
}
|
||||
|
||||
bool Clone(const ShaderVariableArray *src)
|
||||
{
|
||||
if(!src)
|
||||
return(false);
|
||||
|
||||
if(!Init(src->count))
|
||||
return(false);
|
||||
|
||||
hgl_cpy(items,src->items,src->count);
|
||||
return(true);
|
||||
}
|
||||
};//struct ShaderVariableArray
|
||||
|
||||
using SVArray=ShaderVariableArray;
|
||||
}//namespace graph
|
||||
}//namespace hgl
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include<hgl/graph/VertexAttrib.h>
|
||||
#include<hgl/graph/VK.h>
|
||||
#include<hgl/graph/VKInterpolation.h>
|
||||
#include<hgl/graph/VKDescriptorSetType.h>
|
||||
#include<hgl/graph/mtl/ShaderVariableType.h>
|
||||
#include<hgl/type/StringList.h>
|
||||
|
||||
@ -15,6 +16,7 @@ class MaterialDescriptorInfo;
|
||||
class ShaderDescriptorInfo;
|
||||
|
||||
struct UBODescriptor;
|
||||
struct SamplerDescriptor;
|
||||
|
||||
class ShaderCreateInfo
|
||||
{
|
||||
@ -28,8 +30,8 @@ protected:
|
||||
|
||||
AnsiStringList define_macro_list;
|
||||
AnsiStringList define_value_list;
|
||||
uint32_t define_macro_max_length;
|
||||
uint32_t define_value_max_length;
|
||||
int define_macro_max_length;
|
||||
int define_value_max_length;
|
||||
|
||||
AnsiString output_struct;
|
||||
|
||||
@ -49,7 +51,6 @@ protected:
|
||||
virtual bool ProcDefine();
|
||||
virtual bool ProcLayout(){return(true);}
|
||||
|
||||
virtual bool ProcSubpassInput();
|
||||
virtual bool ProcInput(ShaderCreateInfo *);
|
||||
virtual bool ProcOutput();
|
||||
|
||||
@ -66,25 +67,28 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
ShaderDescriptorInfo *sdi;
|
||||
|
||||
virtual ShaderDescriptorInfo *GetSDI()=0;
|
||||
const VkShaderStageFlagBits GetShaderStage()const{return shader_stage;}
|
||||
|
||||
protected:
|
||||
|
||||
void Init(ShaderDescriptorInfo *sdi,MaterialDescriptorInfo *m);
|
||||
|
||||
public:
|
||||
|
||||
ShaderCreateInfo(VkShaderStageFlagBits ss,MaterialDescriptorInfo *m);
|
||||
ShaderCreateInfo();
|
||||
virtual ~ShaderCreateInfo();
|
||||
|
||||
bool AddDefine(const AnsiString &m,const AnsiString &v);
|
||||
|
||||
int AddOutput(const graph::VAType &type,const AnsiString &name,Interpolation inter=Interpolation::Smooth);
|
||||
int AddOutput(const AnsiString &type,const AnsiString &name,Interpolation inter=Interpolation::Smooth);
|
||||
//int AddOutput(const ShaderVariableType &type,const AnsiString &name,Interpolation inter=Interpolation::Smooth);
|
||||
void AddStruct(const AnsiString &);
|
||||
bool AddUBO(DescriptorSetType type,const UBODescriptor *sd);
|
||||
bool AddSampler(DescriptorSetType type,const SamplerDescriptor *sd);
|
||||
|
||||
void AddFunction(const char *str){function_list.Add(str);}
|
||||
|
||||
void SetMaterialInstance(UBODescriptor *,const AnsiString &);
|
||||
void AddMaterialInstanceOutput();
|
||||
virtual void AddMaterialInstanceOutput()=0;
|
||||
|
||||
void SetMain(const AnsiString &str){main_function=str;}
|
||||
void SetMain(const char *str,const int len)
|
||||
|
@ -1,16 +1,28 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include<hgl/shadergen/ShaderCreateInfo.h>
|
||||
#include<hgl/shadergen/ShaderDescriptorInfo.h>
|
||||
|
||||
namespace hgl{namespace graph{
|
||||
|
||||
class ShaderCreateInfoFragment:public ShaderCreateInfo
|
||||
{
|
||||
FragmentShaderDescriptorInfo fsdi;
|
||||
|
||||
protected:
|
||||
|
||||
bool ProcOutput() override;
|
||||
|
||||
public:
|
||||
|
||||
ShaderCreateInfoFragment(MaterialDescriptorInfo *m):ShaderCreateInfo(VK_SHADER_STAGE_FRAGMENT_BIT,m){}
|
||||
ShaderDescriptorInfo *GetSDI()override{return &fsdi;}
|
||||
|
||||
public:
|
||||
|
||||
ShaderCreateInfoFragment(MaterialDescriptorInfo *m):ShaderCreateInfo(){ShaderCreateInfo::Init(&fsdi,m);}
|
||||
~ShaderCreateInfoFragment()=default;
|
||||
|
||||
int AddOutput(const graph::VAType &type,const AnsiString &name,Interpolation inter=Interpolation::Smooth);
|
||||
int AddOutput(const AnsiString &type,const AnsiString &name,Interpolation inter=Interpolation::Smooth);
|
||||
};
|
||||
}}//namespace hgl::graph
|
@ -1,20 +1,30 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include<hgl/shadergen/ShaderCreateInfo.h>
|
||||
#include<hgl/shadergen/ShaderDescriptorInfo.h>
|
||||
|
||||
namespace hgl{namespace graph{
|
||||
class ShaderCreateInfoGeometry:public ShaderCreateInfo
|
||||
{
|
||||
GeometryShaderDescriptorInfo gsdi;
|
||||
|
||||
AnsiString input_prim;
|
||||
AnsiString output_prim;
|
||||
uint32_t max_vertices;
|
||||
uint32_t max_vertices;
|
||||
|
||||
public:
|
||||
|
||||
ShaderCreateInfoGeometry(MaterialDescriptorInfo *m):ShaderCreateInfo(VK_SHADER_STAGE_GEOMETRY_BIT,m){}
|
||||
~ShaderCreateInfoGeometry()=default;
|
||||
ShaderDescriptorInfo *GetSDI()override{return &gsdi;}
|
||||
|
||||
public:
|
||||
|
||||
ShaderCreateInfoGeometry(MaterialDescriptorInfo *m):ShaderCreateInfo(){ShaderCreateInfo::Init(&gsdi,m);}
|
||||
~ShaderCreateInfoGeometry()override=default;
|
||||
|
||||
bool SetGeom(const Prim &ip,const Prim &op,const uint32_t mv);
|
||||
|
||||
int AddOutput(const ShaderVariableType &type,const AnsiString &name,Interpolation inter=Interpolation::Smooth);
|
||||
void AddMaterialInstanceOutput() override;
|
||||
|
||||
bool ProcLayout() override;
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include<hgl/shadergen/ShaderCreateInfo.h>
|
||||
#include<hgl/graph/VKShaderStage.h>
|
||||
#include<hgl/shadergen/ShaderDescriptorInfo.h>
|
||||
|
||||
namespace hgl
|
||||
{
|
||||
@ -9,17 +9,27 @@ namespace hgl
|
||||
{
|
||||
class ShaderCreateInfoVertex:public ShaderCreateInfo
|
||||
{
|
||||
VertexShaderDescriptorInfo vsdi;
|
||||
|
||||
bool ProcSubpassInput();
|
||||
bool ProcInput(ShaderCreateInfo *) override;
|
||||
|
||||
public:
|
||||
|
||||
ShaderCreateInfoVertex(MaterialDescriptorInfo *);
|
||||
~ShaderCreateInfoVertex()=default;
|
||||
ShaderDescriptorInfo *GetSDI()override{return &vsdi;}
|
||||
|
||||
public:
|
||||
|
||||
ShaderCreateInfoVertex(MaterialDescriptorInfo *m):ShaderCreateInfo(){ShaderCreateInfo::Init(&vsdi,m);}
|
||||
~ShaderCreateInfoVertex()override=default;
|
||||
|
||||
int AddInput(const graph::VAType &type,const AnsiString &name,const VkVertexInputRate input_rate=VK_VERTEX_INPUT_RATE_VERTEX,const VertexInputGroup &group=VertexInputGroup::Basic);
|
||||
int AddInput(const AnsiString &type,const AnsiString &name,const VkVertexInputRate input_rate=VK_VERTEX_INPUT_RATE_VERTEX,const VertexInputGroup &group=VertexInputGroup::Basic);
|
||||
|
||||
int hasInput(const char *);
|
||||
|
||||
int AddOutput(const SVType &type,const AnsiString &name,Interpolation inter=Interpolation::Smooth);
|
||||
void AddMaterialInstanceOutput() override;
|
||||
|
||||
void AddAssign();
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include<hgl/type/StringList.h>
|
||||
#include<hgl/graph/VKShaderStage.h>
|
||||
#include<hgl/graph/VKDescriptorSetType.h>
|
||||
#include<hgl/graph/mtl/ShaderVariableType.h>
|
||||
#include<hgl/shadergen/MaterialDescriptorInfo.h>
|
||||
|
||||
namespace hgl{namespace graph
|
||||
@ -18,9 +19,9 @@ using SubpassInputDescriptorList=ObjectList<SubpassInputDescriptor>;
|
||||
*/
|
||||
class ShaderDescriptorInfo
|
||||
{
|
||||
VkShaderStageFlagBits stage_flag;
|
||||
protected:
|
||||
|
||||
ShaderStageIO stage_io;
|
||||
VkShaderStageFlagBits stage_flag;
|
||||
|
||||
AnsiStringList struct_list; //用到的结构列表
|
||||
|
||||
@ -29,22 +30,19 @@ class ShaderDescriptorInfo
|
||||
SamplerDescriptorList sampler_list;
|
||||
|
||||
ConstValueDescriptorList const_value_list;
|
||||
SubpassInputDescriptorList subpass_input;
|
||||
|
||||
ShaderPushConstant push_constant;
|
||||
|
||||
public:
|
||||
|
||||
ShaderDescriptorInfo(VkShaderStageFlagBits);
|
||||
~ShaderDescriptorInfo()=default;
|
||||
virtual ~ShaderDescriptorInfo()=default;
|
||||
|
||||
const VkShaderStageFlagBits GetStageFlag()const { return stage_flag; }
|
||||
const VkShaderStageFlagBits GetShaderStage()const { return stage_flag; }
|
||||
const AnsiString GetStageName()const { return AnsiString(GetShaderStageName(stage_flag)); }
|
||||
|
||||
public:
|
||||
|
||||
const ShaderStageIO & GetShaderStageIO()const{return stage_io;}
|
||||
|
||||
const AnsiStringList & GetStructList()const{return struct_list;}
|
||||
|
||||
const UBODescriptorList & GetUBOList()const{return ubo_list;}
|
||||
@ -52,22 +50,57 @@ public:
|
||||
|
||||
const ConstValueDescriptorList & GetConstList()const{return const_value_list;}
|
||||
|
||||
const SubpassInputDescriptorList & GetSubpassInputList()const{return subpass_input;}
|
||||
|
||||
public:
|
||||
|
||||
bool AddInput(VertexInputAttribute *);
|
||||
bool AddOutput(VertexInputAttribute *);
|
||||
|
||||
bool hasInput(const char *)const; ///<是否有指定输入
|
||||
|
||||
void AddStruct(const AnsiString &);
|
||||
bool AddUBO(DescriptorSetType type,const UBODescriptor *sd);
|
||||
bool AddSampler(DescriptorSetType type,const SamplerDescriptor *sd);
|
||||
|
||||
bool AddConstValue(ConstValueDescriptor *sd);
|
||||
bool AddSubpassInput(const AnsiString name,uint8_t index);
|
||||
bool AddConstValue(ConstValueDescriptor *sd);
|
||||
|
||||
void SetPushConstant(const AnsiString name,uint8_t offset,uint8_t size);
|
||||
};//class ShaderDescriptorInfo
|
||||
|
||||
template<VkShaderStageFlagBits SS,typename IArray,typename I,typename OArray,typename O> class CustomShaderDescriptorInfo:public ShaderDescriptorInfo
|
||||
{
|
||||
IArray input;
|
||||
OArray output;
|
||||
|
||||
public:
|
||||
|
||||
CustomShaderDescriptorInfo():ShaderDescriptorInfo(SS){}
|
||||
virtual ~CustomShaderDescriptorInfo()override=default;
|
||||
|
||||
bool AddInput(I &item){return input.Add(item);}
|
||||
bool AddOutput(O &item){return output.Add(item);}
|
||||
|
||||
bool hasInput(const char *name)const{return input.IsMember(name);} ///<是否有指定输入
|
||||
|
||||
public:
|
||||
|
||||
IArray &GetInput(){return input;}
|
||||
OArray &GetOutput(){return output;}
|
||||
};//class CustomShaderDescriptorInfo
|
||||
|
||||
class VertexShaderDescriptorInfo:public CustomShaderDescriptorInfo<VK_SHADER_STAGE_VERTEX_BIT,VIAArray,VIA,SVArray,ShaderVariable >
|
||||
{
|
||||
SubpassInputDescriptorList subpass_input;
|
||||
|
||||
public:
|
||||
|
||||
const SubpassInputDescriptorList & GetSubpassInputList()const{return subpass_input;}
|
||||
|
||||
public:
|
||||
|
||||
using CustomShaderDescriptorInfo<VK_SHADER_STAGE_VERTEX_BIT,VIAArray,VIA,SVArray,ShaderVariable>::CustomShaderDescriptorInfo;
|
||||
~VertexShaderDescriptorInfo()override=default;
|
||||
|
||||
bool AddSubpassInput(const AnsiString name,uint8_t index);
|
||||
};//class VertexShaderDescriptorInfo
|
||||
|
||||
using TessCtrlShaderDescriptorInfo=CustomShaderDescriptorInfo<VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, SVArray, ShaderVariable, SVArray, ShaderVariable >;
|
||||
using TessEvalShaderDescriptorInfo=CustomShaderDescriptorInfo<VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, SVArray, ShaderVariable, SVArray, ShaderVariable >;
|
||||
using GeometryShaderDescriptorInfo=CustomShaderDescriptorInfo<VK_SHADER_STAGE_GEOMETRY_BIT, SVArray, ShaderVariable, SVArray, ShaderVariable >;
|
||||
using FragmentShaderDescriptorInfo=CustomShaderDescriptorInfo<VK_SHADER_STAGE_FRAGMENT_BIT, SVArray, ShaderVariable, VIAArray, VIA >;
|
||||
|
||||
}}//namespace hgl::graph
|
||||
|
@ -40,6 +40,7 @@ SET(SHADERGEN_COMMON_FILES ${STD_MTL_HEADER_PATH}/UniformBuffer.h
|
||||
${STD_MTL_HEADER_PATH}/UBOCommon.h
|
||||
${STD_MTL_HEADER_PATH}/SamplerName.h
|
||||
${STD_MTL_HEADER_PATH}/ShaderVariableType.h
|
||||
ShaderVariableType.cpp
|
||||
common/MFCommon.h
|
||||
common/MFGetPosition.h
|
||||
common/MFGetNormal.h
|
||||
|
@ -58,7 +58,7 @@ bool MaterialCreateInfo::AddUBO(const VkShaderStageFlagBits flag_bit,const Descr
|
||||
|
||||
ubo->stage_flag|=flag_bit;
|
||||
|
||||
return sc->sdi->AddUBO(set_type,ubo);
|
||||
return sc->AddUBO(set_type,ubo);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -67,7 +67,7 @@ bool MaterialCreateInfo::AddUBO(const VkShaderStageFlagBits flag_bit,const Descr
|
||||
ubo->type=struct_name;
|
||||
hgl::strcpy(ubo->name,DESCRIPTOR_NAME_MAX_LENGTH,name);
|
||||
|
||||
return sc->sdi->AddUBO(set_type,mdi.AddUBO(flag_bit,set_type,ubo));
|
||||
return sc->AddUBO(set_type,mdi.AddUBO(flag_bit,set_type,ubo));
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ bool MaterialCreateInfo::AddSampler(const VkShaderStageFlagBits flag_bit,const D
|
||||
|
||||
sampler->stage_flag|=flag_bit;
|
||||
|
||||
return sc->sdi->AddSampler(set_type,sampler);
|
||||
return sc->AddSampler(set_type,sampler);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -125,7 +125,7 @@ bool MaterialCreateInfo::AddSampler(const VkShaderStageFlagBits flag_bit,const D
|
||||
sampler->type=st_name;
|
||||
hgl::strcpy(sampler->name,DESCRIPTOR_NAME_MAX_LENGTH,name);
|
||||
|
||||
return sc->sdi->AddSampler(set_type,mdi.AddSampler(flag_bit,set_type,sampler));
|
||||
return sc->AddSampler(set_type,mdi.AddSampler(flag_bit,set_type,sampler));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,11 +9,10 @@
|
||||
|
||||
namespace hgl{namespace graph{
|
||||
|
||||
ShaderCreateInfo::ShaderCreateInfo(VkShaderStageFlagBits ss,MaterialDescriptorInfo *m)
|
||||
ShaderCreateInfo::ShaderCreateInfo()
|
||||
{
|
||||
shader_stage=ss;
|
||||
mdi=m;
|
||||
sdi=new ShaderDescriptorInfo(ss);
|
||||
hgl_zero(shader_stage);
|
||||
mdi=nullptr;
|
||||
|
||||
spv_data=nullptr;
|
||||
|
||||
@ -21,12 +20,16 @@ ShaderCreateInfo::ShaderCreateInfo(VkShaderStageFlagBits ss,MaterialDescriptorIn
|
||||
define_value_max_length=0;
|
||||
}
|
||||
|
||||
void ShaderCreateInfo::Init(ShaderDescriptorInfo *sdi,MaterialDescriptorInfo *m)
|
||||
{
|
||||
shader_stage=sdi->GetShaderStage();
|
||||
mdi=m;
|
||||
}
|
||||
|
||||
ShaderCreateInfo::~ShaderCreateInfo()
|
||||
{
|
||||
if(spv_data)
|
||||
FreeSPVData(spv_data);
|
||||
|
||||
delete sdi;
|
||||
}
|
||||
|
||||
bool ShaderCreateInfo::AddDefine(const AnsiString &m,const AnsiString &v)
|
||||
@ -100,30 +103,19 @@ bool ShaderCreateInfo::ProcDefine()
|
||||
return(true);
|
||||
}
|
||||
|
||||
int ShaderCreateInfo::AddOutput(const VAType &type,const AnsiString &name,Interpolation inter)
|
||||
void ShaderCreateInfo::AddStruct(const AnsiString &name)
|
||||
{
|
||||
VertexInputAttribute *ss=new VertexInputAttribute;
|
||||
|
||||
hgl::strcpy(ss->name,sizeof(ss->name),name.c_str());
|
||||
|
||||
ss->basetype =(uint8)type.basetype;
|
||||
ss->vec_size = type.vec_size;
|
||||
ss->interpolation = inter;
|
||||
|
||||
return sdi->AddOutput(ss);
|
||||
return GetSDI()->AddStruct(name);
|
||||
}
|
||||
|
||||
int ShaderCreateInfo::AddOutput(const AnsiString &type,const AnsiString &name,Interpolation inter)
|
||||
bool ShaderCreateInfo::AddUBO(DescriptorSetType type,const UBODescriptor *sd)
|
||||
{
|
||||
VAType vat;
|
||||
return GetSDI()->AddUBO(type,sd);
|
||||
}
|
||||
|
||||
if(name.IsEmpty())
|
||||
return -1;
|
||||
|
||||
if(!ParseVertexAttribType(&vat,type))
|
||||
return -2;
|
||||
|
||||
return AddOutput(vat,name,inter);
|
||||
bool ShaderCreateInfo::AddSampler(DescriptorSetType type,const SamplerDescriptor *sd)
|
||||
{
|
||||
return GetSDI()->AddSampler(type,sd);
|
||||
}
|
||||
|
||||
//int ShaderCreateInfo::AddOutput(const ShaderVariableType &type,const AnsiString &name,Interpolation inter=Interpolation::Smooth)
|
||||
@ -140,64 +132,16 @@ int ShaderCreateInfo::AddOutput(const AnsiString &type,const AnsiString &name,In
|
||||
//
|
||||
//}
|
||||
|
||||
bool ShaderCreateInfo::ProcSubpassInput()
|
||||
{
|
||||
auto sil=sdi->GetSubpassInputList();
|
||||
|
||||
if(sil.IsEmpty())
|
||||
return(true);
|
||||
|
||||
final_shader+="\n";
|
||||
|
||||
auto si=sil.GetData();
|
||||
int si_count=sil.GetCount();
|
||||
|
||||
for(int i=0;i<si_count;i++)
|
||||
{
|
||||
final_shader+="layout(input_attachment_index=";
|
||||
final_shader+=AnsiString::numberOf((*si)->input_attachment_index);
|
||||
final_shader+=", binding=";
|
||||
final_shader+=AnsiString::numberOf((*si)->binding);
|
||||
final_shader+=") uniform subpassInput ";
|
||||
final_shader+=(*si)->name;
|
||||
final_shader+=";\n";
|
||||
|
||||
++si;
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr const char MI_ID_OUTPUT[]="MaterialInstanceID";
|
||||
constexpr const char MF_GetMI_VS []="\nMaterialInstance GetMI(){return mtl.mi[Assign.y];}\n";
|
||||
constexpr const char MF_GetMI_Other []="\nMaterialInstance GetMI(){return mtl.mi[Input.MaterialInstanceID];}\n";
|
||||
|
||||
constexpr const char MF_HandoverMI_VS[]= "\nvoid HandoverMI(){Output.MaterialInstanceID=Assign.y;}\n";
|
||||
constexpr const char MF_HandoverMI_GS[]= "\nvoid HandoverMI(){Output.MaterialInstanceID=Input[0].MaterialInstanceID;}\n";
|
||||
constexpr const char MF_HandoverMI_OTHER[]= "\nvoid HandoverMI(){Output.MaterialInstanceID=Input.MaterialInstanceID;}\n";
|
||||
}//namespace
|
||||
|
||||
void ShaderCreateInfo::SetMaterialInstance(UBODescriptor *ubo,const AnsiString &mi)
|
||||
{
|
||||
sdi->AddUBO(DescriptorSetType::PerMaterial,ubo);
|
||||
sdi->AddStruct(mtl::MaterialInstanceStruct);
|
||||
AddUBO(DescriptorSetType::PerMaterial,ubo);
|
||||
AddStruct(mtl::MaterialInstanceStruct);
|
||||
|
||||
AddFunction(shader_stage==VK_SHADER_STAGE_VERTEX_BIT?MF_GetMI_VS:MF_GetMI_Other);
|
||||
AddFunction(shader_stage==VK_SHADER_STAGE_VERTEX_BIT?mtl::func::MF_GetMI_VS:mtl::func::MF_GetMI_Other);
|
||||
|
||||
mi_codes=mi;
|
||||
}
|
||||
|
||||
void ShaderCreateInfo::AddMaterialInstanceOutput()
|
||||
{
|
||||
AddOutput(VAT_UINT,MI_ID_OUTPUT,Interpolation::Flat);
|
||||
|
||||
if(shader_stage==VK_SHADER_STAGE_VERTEX_BIT) AddFunction(MF_HandoverMI_VS);else
|
||||
if(shader_stage==VK_SHADER_STAGE_GEOMETRY_BIT) AddFunction(MF_HandoverMI_GS);else
|
||||
AddFunction(MF_HandoverMI_OTHER);
|
||||
}
|
||||
|
||||
bool ShaderCreateInfo::ProcInput(ShaderCreateInfo *last_sc)
|
||||
{
|
||||
if(!last_sc)
|
||||
@ -222,37 +166,42 @@ bool ShaderCreateInfo::ProcInput(ShaderCreateInfo *last_sc)
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool ShaderCreateInfo::ProcOutput()
|
||||
void ToStringList(AnsiString &output_struct,const SVArray &sv_array)
|
||||
{
|
||||
output_struct.Clear();
|
||||
const ShaderVariable *sv=sv_array.items;
|
||||
|
||||
const VertexInputAttributeArray &ssd=sdi->GetShaderStageIO().output;
|
||||
|
||||
if(ssd.count<=0)return(true);
|
||||
|
||||
output_struct=GetShaderStageName(shader_stage);
|
||||
output_struct+="_Output\n{\n";
|
||||
|
||||
const VertexInputAttribute *ss=ssd.items;
|
||||
|
||||
for(uint i=0;i<ssd.count;i++)
|
||||
for(uint i=0;i<sv_array.count;i++)
|
||||
{
|
||||
output_struct+=" ";
|
||||
|
||||
if(ss->interpolation!=Interpolation::Smooth)
|
||||
if(sv->interpolation!=Interpolation::Smooth)
|
||||
{
|
||||
output_struct+=InterpolationName[size_t(ss->interpolation)];
|
||||
output_struct+=InterpolationName[size_t(sv->interpolation)];
|
||||
|
||||
output_struct+=" ";
|
||||
}
|
||||
|
||||
output_struct+=GetShaderAttributeTypename(ss);
|
||||
output_struct+=sv->type.GetTypename();
|
||||
output_struct+=" ";
|
||||
output_struct+=ss->name;
|
||||
output_struct+=sv->name;
|
||||
output_struct+=";\n";
|
||||
|
||||
++ss;
|
||||
++sv;
|
||||
}
|
||||
}
|
||||
|
||||
bool ShaderCreateInfo::ProcOutput()
|
||||
{
|
||||
output_struct.Clear();
|
||||
|
||||
const SVArray &sv_array=GetSDI()->GetOutput();
|
||||
|
||||
if(sv_array.count<=0)return(true);
|
||||
|
||||
output_struct=GetShaderStageName(shader_stage);
|
||||
output_struct+="_Output\n{\n";
|
||||
|
||||
ToStringList(output_struct,sv_array);
|
||||
|
||||
output_struct+="}";
|
||||
|
||||
@ -430,8 +379,6 @@ bool ShaderCreateInfo::CreateShader(ShaderCreateInfo *last_sc)
|
||||
if(!ProcLayout())
|
||||
return(false);
|
||||
|
||||
if(!ProcSubpassInput())
|
||||
return(false);
|
||||
if(!ProcInput(last_sc))
|
||||
return(false);
|
||||
// if(!ProcStruct())
|
||||
|
@ -2,12 +2,36 @@
|
||||
#include<hgl/shadergen/ShaderDescriptorInfo.h>
|
||||
|
||||
namespace hgl{namespace graph{
|
||||
|
||||
int ShaderCreateInfoFragment::AddOutput(const VAType &type,const AnsiString &name,Interpolation inter)
|
||||
{
|
||||
VertexInputAttribute via;
|
||||
|
||||
using namespace hgl::graph;
|
||||
hgl::strcpy(via.name,sizeof(via.name),name.c_str());
|
||||
|
||||
via.basetype =(uint8)type.basetype;
|
||||
via.vec_size = type.vec_size;
|
||||
via.interpolation = inter;
|
||||
|
||||
return fsdi.AddOutput(via);
|
||||
}
|
||||
|
||||
int ShaderCreateInfoFragment::AddOutput(const AnsiString &type,const AnsiString &name,Interpolation inter)
|
||||
{
|
||||
VAType vat;
|
||||
|
||||
if(name.IsEmpty())
|
||||
return -1;
|
||||
|
||||
if(!ParseVertexAttribType(&vat,type))
|
||||
return -2;
|
||||
|
||||
return AddOutput(vat,name,inter);
|
||||
}
|
||||
|
||||
bool ShaderCreateInfoFragment::ProcOutput()
|
||||
{
|
||||
const auto &output_list=sdi->GetShaderStageIO().output;
|
||||
const auto &output_list=fsdi.GetOutput();
|
||||
|
||||
const VertexInputAttribute *o=output_list.items;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include<hgl/shadergen/ShaderCreateInfoGeometry.h>
|
||||
#include"common/MFCommon.h"
|
||||
|
||||
namespace hgl
|
||||
{
|
||||
@ -19,6 +20,24 @@ namespace hgl
|
||||
return(true);
|
||||
}
|
||||
|
||||
void ShaderCreateInfoGeometry::AddMaterialInstanceOutput()
|
||||
{
|
||||
AddOutput(SVT_UINT,mtl::func::MI_ID_OUTPUT,Interpolation::Flat);
|
||||
AddFunction(mtl::func::MF_HandoverMI_GS);
|
||||
}
|
||||
|
||||
int ShaderCreateInfoGeometry::AddOutput(const SVType &type,const AnsiString &name,Interpolation inter)
|
||||
{
|
||||
ShaderVariable sv;
|
||||
|
||||
hgl::strcpy(sv.name,sizeof(sv.name),name.c_str());
|
||||
|
||||
sv.type=type;
|
||||
sv.interpolation=inter;
|
||||
|
||||
return gsdi.AddOutput(sv);
|
||||
}
|
||||
|
||||
bool ShaderCreateInfoGeometry::ProcLayout()
|
||||
{
|
||||
final_shader+="layout("+input_prim+") in;\n"
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include<hgl/shadergen/ShaderCreateInfoVertex.h>
|
||||
#include<hgl/shadergen/ShaderDescriptorInfo.h>
|
||||
#include<hgl/graph/VertexAttrib.h>
|
||||
#include<hgl/graph/VKShaderStage.h>
|
||||
#include<hgl/graph/VKRenderAssign.h>
|
||||
@ -8,23 +7,34 @@
|
||||
#include"ShaderLibrary.h"
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
ShaderCreateInfoVertex::ShaderCreateInfoVertex(MaterialDescriptorInfo *m):ShaderCreateInfo(VK_SHADER_STAGE_VERTEX_BIT,m)
|
||||
|
||||
void ShaderCreateInfoVertex::AddMaterialInstanceOutput()
|
||||
{
|
||||
AddOutput(SVT_UINT,mtl::func::MI_ID_OUTPUT,Interpolation::Flat);
|
||||
AddFunction(mtl::func::MF_HandoverMI_VS);
|
||||
}
|
||||
else
|
||||
if(shader_stage==VK_SHADER_STAGE_GEOMETRY_BIT)
|
||||
{
|
||||
AddFunction(MF_HandoverMI_GS);
|
||||
}
|
||||
//else
|
||||
//AddFunction(MF_HandoverMI_OTHER);
|
||||
}
|
||||
|
||||
int ShaderCreateInfoVertex::AddInput(const VAType &type,const AnsiString &name,const VkVertexInputRate input_rate,const VertexInputGroup &group)
|
||||
{
|
||||
VertexInputAttribute *ss=new VertexInputAttribute;
|
||||
VertexInputAttribute via;
|
||||
|
||||
hgl::strcpy(ss->name,sizeof(ss->name),name.c_str());
|
||||
hgl::strcpy(via.name,sizeof(via.name),name.c_str());
|
||||
|
||||
ss->basetype=(uint8) type.basetype;
|
||||
ss->vec_size= type.vec_size;
|
||||
via.basetype=(uint8) type.basetype;
|
||||
via.vec_size= type.vec_size;
|
||||
|
||||
ss->input_rate =input_rate;
|
||||
ss->group =group;
|
||||
via.input_rate =input_rate;
|
||||
via.group =group;
|
||||
|
||||
return sdi->AddInput(ss);
|
||||
return vsdi.AddInput(via);
|
||||
}
|
||||
|
||||
int ShaderCreateInfoVertex::AddInput(const AnsiString &type,const AnsiString &name,const VkVertexInputRate input_rate,const VertexInputGroup &group)
|
||||
@ -39,7 +49,19 @@ int ShaderCreateInfoVertex::AddInput(const AnsiString &type,const AnsiString &na
|
||||
|
||||
int ShaderCreateInfoVertex::hasInput(const char *name)
|
||||
{
|
||||
return sdi->hasInput(name);
|
||||
return vsdi.hasInput(name);
|
||||
}
|
||||
|
||||
int ShaderCreateInfoVertex::AddOutput(const SVType &type,const AnsiString &name,Interpolation inter)
|
||||
{
|
||||
ShaderVariable sv;
|
||||
|
||||
hgl::strcpy(sv.name,sizeof(sv.name),name.c_str());
|
||||
|
||||
sv.type=type;
|
||||
sv.interpolation=inter;
|
||||
|
||||
return vsdi.AddOutput(sv);
|
||||
}
|
||||
|
||||
void ShaderCreateInfoVertex::AddJoint()
|
||||
@ -58,9 +80,40 @@ void ShaderCreateInfoVertex::AddAssign()
|
||||
AddFunction(STD_MTL_FUNC_NAMESPACE::MF_GetLocalToWorld_ByAssign);
|
||||
}
|
||||
|
||||
bool ShaderCreateInfoVertex::ProcSubpassInput()
|
||||
{
|
||||
auto sil=vsdi.GetSubpassInputList();
|
||||
|
||||
if(sil.IsEmpty())
|
||||
return(true);
|
||||
|
||||
final_shader+="\n";
|
||||
|
||||
auto si=sil.GetData();
|
||||
int si_count=sil.GetCount();
|
||||
|
||||
for(int i=0;i<si_count;i++)
|
||||
{
|
||||
final_shader+="layout(input_attachment_index=";
|
||||
final_shader+=AnsiString::numberOf((*si)->input_attachment_index);
|
||||
final_shader+=", binding=";
|
||||
final_shader+=AnsiString::numberOf((*si)->binding);
|
||||
final_shader+=") uniform subpassInput ";
|
||||
final_shader+=(*si)->name;
|
||||
final_shader+=";\n";
|
||||
|
||||
++si;
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool ShaderCreateInfoVertex::ProcInput(ShaderCreateInfo *)
|
||||
{
|
||||
const auto &input=sdi->GetShaderStageIO().input;
|
||||
{
|
||||
if(!ProcSubpassInput())
|
||||
return(false);
|
||||
|
||||
const auto &input=vsdi.GetInput();
|
||||
|
||||
if(input.count<=0)
|
||||
{
|
||||
|
@ -4,60 +4,10 @@ namespace hgl{namespace graph{
|
||||
ShaderDescriptorInfo::ShaderDescriptorInfo(VkShaderStageFlagBits flag_bit)
|
||||
{
|
||||
stage_flag=flag_bit;
|
||||
|
||||
Init(stage_io);
|
||||
|
||||
|
||||
hgl_zero(push_constant);
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
bool Find(const VertexInputAttributeArray &sad,const char *name)
|
||||
{
|
||||
if(sad.count<=0)
|
||||
return(false);
|
||||
|
||||
for(uint i=0;i<sad.count;i++)
|
||||
if(hgl::strcmp(sad.items[i].name,name)==0)
|
||||
return(true);
|
||||
|
||||
return(false);
|
||||
}
|
||||
}//namespace
|
||||
|
||||
bool ShaderDescriptorInfo::AddInput(VertexInputAttribute *ss)
|
||||
{
|
||||
if(!ss)return(false);
|
||||
|
||||
if(Find(stage_io.input,ss->name))return(false);
|
||||
|
||||
ss->location=stage_io.input.count;
|
||||
|
||||
Append(&stage_io.input,ss);
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
bool ShaderDescriptorInfo::hasInput(const char *name)const
|
||||
{
|
||||
if(!name||!*name)return(false);
|
||||
|
||||
return Find(stage_io.input,name);
|
||||
|
||||
}
|
||||
|
||||
bool ShaderDescriptorInfo::AddOutput(VertexInputAttribute *ss)
|
||||
{
|
||||
if(!ss)return(false);
|
||||
|
||||
if(Find(stage_io.output,ss->name))return(false);
|
||||
|
||||
ss->location=stage_io.output.count;
|
||||
|
||||
Append(&stage_io.output,ss);
|
||||
return(true);
|
||||
}
|
||||
|
||||
void ShaderDescriptorInfo::AddStruct(const AnsiString &name)
|
||||
{
|
||||
struct_list.AddUnique(name);
|
||||
@ -95,7 +45,7 @@ bool ShaderDescriptorInfo::AddConstValue(ConstValueDescriptor *sd)
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool ShaderDescriptorInfo::AddSubpassInput(const UTF8String name,uint8_t index)
|
||||
bool VertexShaderDescriptorInfo::AddSubpassInput(const UTF8String name,uint8_t index)
|
||||
{
|
||||
for(auto *si:subpass_input)
|
||||
{
|
||||
|
102
src/ShaderGen/ShaderVariableType.cpp
Normal file
102
src/ShaderGen/ShaderVariableType.cpp
Normal file
@ -0,0 +1,102 @@
|
||||
#include<hgl/graph/mtl/ShaderVariableType.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr const char *scalar_typename[]=
|
||||
{
|
||||
"bool",
|
||||
"int",
|
||||
"uint",
|
||||
"float",
|
||||
"double"
|
||||
};
|
||||
|
||||
constexpr const char *vector_typename[][3]=
|
||||
{
|
||||
{"bvec2","bvec3","bvec4"},
|
||||
{"ivec2","ivec3","ivec4"},
|
||||
{"uvec2","uvec3","uvec4"},
|
||||
{ "vec2", "vec3", "vec4"},
|
||||
{"dvec2","dvec3","dvec4"}
|
||||
};
|
||||
|
||||
constexpr const char *mat_1_typename[][3]=
|
||||
{
|
||||
{"mat2","mat3","mat4"},
|
||||
{"dmat2","dmat3","dmat4"}
|
||||
};
|
||||
|
||||
constexpr const char *mat_2_typename[][3][3]=
|
||||
{
|
||||
{
|
||||
{"mat2x2","mat2x3","mat2x4"},
|
||||
{"mat3x2","mat3x3","mat3x4"},
|
||||
{"mat4x2","mat4x3","mat4x4"}
|
||||
},
|
||||
{
|
||||
{"dmat2x2","dmat2x3","dmat2x4"},
|
||||
{"dmat3x2","dmat3x3","dmat3x4"},
|
||||
{"dmat4x2","dmat4x3","dmat4x4"}
|
||||
}
|
||||
};
|
||||
|
||||
constexpr const char AtomicCounterTypename[]="atomic_uint";
|
||||
}//namespace
|
||||
|
||||
const char *ShaderVariableType::GetTypename()const
|
||||
{
|
||||
if(base_type==SVBaseType::Scalar)
|
||||
{
|
||||
RANGE_CHECK_RETURN_NULLPTR(scalar.type)
|
||||
|
||||
return scalar_typename[int(scalar.type)];
|
||||
}
|
||||
|
||||
if(base_type==SVBaseType::Vector)
|
||||
{
|
||||
RANGE_CHECK_RETURN_NULLPTR(vector.type)
|
||||
|
||||
if(vector.vec_size<2||vector.vec_size>4)
|
||||
return(nullptr);
|
||||
|
||||
return vector_typename[int(vector.type)][vector.vec_size-2];
|
||||
}
|
||||
|
||||
if(base_type==SVBaseType::Matrix)
|
||||
{
|
||||
if(matrix.type!=VABaseType::Float&&matrix.type==VABaseType::Double)
|
||||
return(nullptr);
|
||||
|
||||
if(matrix.n<2||matrix.n>4)
|
||||
return(nullptr);
|
||||
|
||||
if(matrix.m==0)
|
||||
return mat_1_typename[int(matrix.type)-int(VABaseType::Float)][matrix.n-2];
|
||||
|
||||
if(matrix.m<2||matrix.m>4)
|
||||
return(nullptr);
|
||||
|
||||
return mat_2_typename[int(matrix.type)-int(VABaseType::Float)][matrix.n-2][matrix.m-2];
|
||||
}
|
||||
|
||||
if(base_type==SVBaseType::Sampler)
|
||||
{
|
||||
return GetSamplerTypeName(sampler.type);
|
||||
}
|
||||
|
||||
if(base_type==SVBaseType::Image)
|
||||
{
|
||||
return GetShaderImageTypeName(image.type);
|
||||
}
|
||||
|
||||
if(base_type==SVBaseType::AtomicCounter)
|
||||
{
|
||||
return AtomicCounterTypename;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
VK_NAMESPACE_END
|
@ -8,5 +8,14 @@ STD_MTL_FUNC_NAMESPACE_BEGIN
|
||||
constexpr const char MF_GetLocalToWorld_ByAssign[]= "\nmat4 GetLocalToWorld(){return l2w.mats[Assign.x];}\n";
|
||||
|
||||
constexpr const char MF_GetMaterialInstance_ByAssign[]= "\nMaterialInstance GetMaterialInstance(){return mi_set[Assign.y];}\n";
|
||||
|
||||
constexpr const char MI_ID_OUTPUT[]="MaterialInstanceID";
|
||||
|
||||
constexpr const char MF_HandoverMI_VS[]= "\nvoid HandoverMI(){Output.MaterialInstanceID=Assign.y;}\n";
|
||||
constexpr const char MF_HandoverMI_GS[]= "\nvoid HandoverMI(){Output.MaterialInstanceID=Input[0].MaterialInstanceID;}\n";
|
||||
constexpr const char MF_HandoverMI_OTHER[]= "\nvoid HandoverMI(){Output.MaterialInstanceID=Input.MaterialInstanceID;}\n";
|
||||
|
||||
constexpr const char MF_GetMI_VS []="\nMaterialInstance GetMI(){return mtl.mi[Assign.y];}\n";
|
||||
constexpr const char MF_GetMI_Other []="\nMaterialInstance GetMI(){return mtl.mi[Input.MaterialInstanceID];}\n";
|
||||
|
||||
STD_MTL_FUNC_NAMESPACE_END
|
||||
|
Loading…
x
Reference in New Issue
Block a user