2023-09-21 22:11:20 +08:00
|
|
|
|
#include<hgl/shadergen/ShaderCreateInfoGeometry.h>
|
2023-09-21 21:36:37 +08:00
|
|
|
|
|
|
|
|
|
namespace hgl
|
|
|
|
|
{
|
|
|
|
|
namespace graph
|
|
|
|
|
{
|
|
|
|
|
bool ShaderCreateInfoGeometry::SetGeom(const Prim &ip,const Prim &op,const uint32_t mv)
|
|
|
|
|
{
|
|
|
|
|
if(ip==Prim::Points )input_prim="points";else
|
|
|
|
|
if(ip==Prim::Lines )input_prim="lines";else
|
|
|
|
|
if(ip==Prim::LinesAdj )input_prim="lines_adjacency";else
|
|
|
|
|
if(ip==Prim::Triangles )input_prim="triangles";else
|
|
|
|
|
if(ip==Prim::TrianglesAdj )input_prim="triangles_adjacency";else
|
|
|
|
|
return(false);
|
|
|
|
|
|
|
|
|
|
if(op==Prim::Points )output_prim="points";else
|
|
|
|
|
if(op==Prim::LineStrip )output_prim="line_strip";else
|
|
|
|
|
if(op==Prim::TriangleStrip )output_prim="triangle_strip";else
|
|
|
|
|
return(false);
|
|
|
|
|
|
|
|
|
|
if(mv==0)
|
|
|
|
|
return(false);
|
|
|
|
|
|
|
|
|
|
max_vertices=mv;
|
|
|
|
|
return(true);
|
|
|
|
|
}
|
2023-09-21 22:11:20 +08:00
|
|
|
|
|
|
|
|
|
bool ShaderCreateInfoGeometry::ProcLayout()
|
|
|
|
|
{
|
|
|
|
|
final_shader+="layout("+input_prim+") in;\n"
|
|
|
|
|
"layout("+output_prim+", max_vertices = "+AnsiString::numberOf(max_vertices)+") out;\n";
|
|
|
|
|
|
|
|
|
|
return(true);
|
|
|
|
|
}
|
2023-09-21 21:36:37 +08:00
|
|
|
|
}//namespace graph
|
|
|
|
|
}//namespace hgl
|