2023-03-06 14:06:20 +08:00
|
|
|
#include<hgl/shadergen/ShaderCreaterFragment.h>
|
|
|
|
|
|
|
|
SHADERGEN_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
void ShaderCreaterFragment::UseDefaultMain()
|
|
|
|
{
|
2023-03-08 14:02:51 +08:00
|
|
|
shader_codes="void main()\n{\n";
|
2023-03-06 14:06:20 +08:00
|
|
|
|
|
|
|
const auto &output_list=sdm.GetShaderStageIO().output;
|
|
|
|
|
|
|
|
const uint count=output_list.GetCount();
|
|
|
|
for(uint i=0;i<count;i++)
|
|
|
|
{
|
2023-03-08 14:02:51 +08:00
|
|
|
shader_codes+="\t";
|
|
|
|
shader_codes+=output_list[i]->name;
|
|
|
|
shader_codes+="=Get";
|
|
|
|
shader_codes+=output_list[i]->name;
|
|
|
|
shader_codes+="();\n";
|
2023-03-06 14:06:20 +08:00
|
|
|
}
|
|
|
|
|
2023-03-08 14:02:51 +08:00
|
|
|
shader_codes+="}";
|
2023-03-06 14:06:20 +08:00
|
|
|
}
|
|
|
|
SHADERGEN_NAMESPACE_END
|