fixed a bug in ShaderCreateInfoVertex.cpp, put "C-style string" in function that it's a bug.

This commit is contained in:
hyzboy 2024-03-07 00:07:49 +08:00
parent 5ba3c1790d
commit 2ce36ec26c
No known key found for this signature in database
GPG Key ID: 067EE4525D4FB6D3
3 changed files with 6 additions and 4 deletions

View File

@ -59,7 +59,7 @@ private:
pgci.grid_size.Set(32,32);
pgci.sub_count.Set(8,8);
pgci.lum=0.5;
pgci.lum=0.75;
pgci.sub_lum=1.0;
prim_plane_grid=CreatePlaneGrid(db,material->GetDefaultVIL(),&pgci);

View File

@ -80,7 +80,6 @@ public:
int AddOutput(const AnsiString &type,const AnsiString &name,Interpolation inter=Interpolation::Smooth);
void AddFunction(const char *str){function_list.Add(str);}
void AddFunction(const AnsiString *str){function_list.Add(str->c_str());}
void SetMaterialInstance(UBODescriptor *,const AnsiString &);
void AddMaterialInstanceOutput();

View File

@ -43,6 +43,11 @@ void ShaderCreateInfoVertex::AddJoint()
AddInput(VAT_VEC4, VAN::JointWeight,VK_VERTEX_INPUT_RATE_VERTEX,VertexInputGroup::JointWeight);
}
namespace
{
constexpr const char MF_GetLocalToWorld[]="\nmat4 GetLocalToWorld(){return l2w.mats[Assign.x];}\n";
}
void ShaderCreateInfoVertex::AddAssign()
{
AddInput( ASSIGN_VAT_FMT,
@ -50,8 +55,6 @@ void ShaderCreateInfoVertex::AddAssign()
VK_VERTEX_INPUT_RATE_INSTANCE,
VertexInputGroup::Assign);
constexpr const char MF_GetLocalToWorld[]="\nmat4 GetLocalToWorld(){return l2w.mats[Assign.x];}\n";
AddFunction(MF_GetLocalToWorld);
}