optimized codes that added new_strcpy
This commit is contained in:
parent
1b777626f7
commit
80e09fb99c
@ -1 +1 @@
|
||||
Subproject commit ac5524ef523e663e19493e77013873391e866340
|
||||
Subproject commit 4be568c0047163d61859c0be2411b48d29672ba7
|
24
glsl2spv.cpp
24
glsl2spv.cpp
@ -260,6 +260,17 @@ extern "C"
|
||||
return VertexAttribBaseType::MAX;
|
||||
}
|
||||
|
||||
char *new_strcpy(const char *src)
|
||||
{
|
||||
int len=1+strlen(src);
|
||||
|
||||
char *str=new char[len];
|
||||
|
||||
memcpy(str,src,len);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
struct ShaderStage
|
||||
{
|
||||
char name[128];
|
||||
@ -297,7 +308,6 @@ extern "C"
|
||||
uint8_t input_attachment_index;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
struct ShaderResourceData
|
||||
@ -321,10 +331,7 @@ extern "C"
|
||||
|
||||
void Init()
|
||||
{
|
||||
memset(&input,0,sizeof(ShaderStageData));
|
||||
memset(&output,0,sizeof(ShaderStageData));
|
||||
|
||||
memset(&resource,0,sizeof(resource));
|
||||
memset(this,0,sizeof(SPVData));
|
||||
}
|
||||
|
||||
void Clear()
|
||||
@ -342,11 +349,8 @@ extern "C"
|
||||
{
|
||||
result=false;
|
||||
|
||||
log=new char[strlen(l)+1];
|
||||
strcpy(log,l);
|
||||
|
||||
debug_log=new char[strlen(dl)+1];
|
||||
strcpy(debug_log,dl);
|
||||
log=new_strcpy(l);
|
||||
debug_log=new_strcpy(dl);
|
||||
|
||||
spv_data=nullptr;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user