updated layout of codes
This commit is contained in:
parent
9cfb88235a
commit
5ba705cd6b
@ -101,22 +101,19 @@ bool MaterialCreater::CreateShader()
|
|||||||
if(shader_map.IsEmpty())
|
if(shader_map.IsEmpty())
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
//mdm.Resort();
|
mdm.Resort();
|
||||||
|
|
||||||
ShaderCreater *sc,*last=nullptr;
|
ShaderCreater *sc,*last=nullptr;
|
||||||
|
|
||||||
//for(int i=0;i<shader_map.GetCount();i++)
|
for(int i=0;i<shader_map.GetCount();i++)
|
||||||
//{
|
{
|
||||||
// if(!shader_map.GetValue(i,sc))
|
if(!shader_map.GetValue(i,sc))
|
||||||
// return(false);
|
return(false);
|
||||||
|
|
||||||
// sc->CreateShader(last);
|
sc->CreateShader(last);
|
||||||
|
|
||||||
// last=sc;
|
last=sc;
|
||||||
//}
|
}
|
||||||
|
|
||||||
//vert->CreateShader(nullptr);
|
|
||||||
frag->CreateShader(vert);
|
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
@ -238,21 +238,25 @@ bool ShaderCreater::CreateShader(ShaderCreater *last_sc)
|
|||||||
if(!ProcStruct())
|
if(!ProcStruct())
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
//if(!ProcUBO())
|
if(!ProcUBO())
|
||||||
// return(false);
|
return(false);
|
||||||
////if(!ProcSSBO())
|
//if(!ProcSSBO())
|
||||||
// //return(false);
|
//return(false);
|
||||||
//if(!ProcConst())
|
if(!ProcConst())
|
||||||
// return(false);
|
return(false);
|
||||||
//if(!ProcSampler())
|
if(!ProcSampler())
|
||||||
// return(false);
|
return(false);
|
||||||
|
|
||||||
ProcOutput();
|
ProcOutput();
|
||||||
|
|
||||||
final_shader+="\n";
|
|
||||||
|
|
||||||
final_shader+=main_codes;
|
final_shader+=main_codes;
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
|
||||||
|
LOG_INFO(AnsiString(GetShaderStageName(shader_stage))+" shader: \n"+final_shader);
|
||||||
|
|
||||||
|
#endif//_DEBUG
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,17 +32,20 @@ int ShaderCreaterVertex::AddInput(const AnsiString &type,const AnsiString &name)
|
|||||||
|
|
||||||
bool ShaderCreaterVertex::ProcInput(ShaderCreater *)
|
bool ShaderCreaterVertex::ProcInput(ShaderCreater *)
|
||||||
{
|
{
|
||||||
const auto &io=sdm->GetShaderStageIO();
|
const auto &input=sdm->GetShaderStageIO().input;
|
||||||
|
|
||||||
if(io.input.IsEmpty())
|
if(input.IsEmpty())
|
||||||
{
|
{
|
||||||
//no input ? this isn't a bug.
|
//no input ? this isn't a bug.
|
||||||
//maybe position info from UBO/SBBO/Texture.
|
//maybe position info from UBO/SBBO/Texture.
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!input.IsEmpty())
|
||||||
{
|
{
|
||||||
for(auto *ss:io.input)
|
final_shader+="\n";
|
||||||
|
|
||||||
|
for(auto *ss:input)
|
||||||
{
|
{
|
||||||
final_shader+="layout(location=";
|
final_shader+="layout(location=";
|
||||||
final_shader+=UTF8String::numberOf(ss->location);
|
final_shader+=UTF8String::numberOf(ss->location);
|
||||||
@ -51,8 +54,6 @@ bool ShaderCreaterVertex::ProcInput(ShaderCreater *)
|
|||||||
final_shader+=" "+UTF8String(ss->name);
|
final_shader+=" "+UTF8String(ss->name);
|
||||||
final_shader+=";\n";
|
final_shader+=";\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
final_shader+="\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user