optimized codes that added new_strcpy
This commit is contained in:
Submodule SPIRV-Cross updated: ac5524ef52...4be568c004
26
glsl2spv.cpp
26
glsl2spv.cpp
@@ -259,6 +259,17 @@ extern "C"
|
|||||||
|
|
||||||
return VertexAttribBaseType::MAX;
|
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
|
struct ShaderStage
|
||||||
{
|
{
|
||||||
@@ -296,8 +307,7 @@ extern "C"
|
|||||||
{
|
{
|
||||||
uint8_t input_attachment_index;
|
uint8_t input_attachment_index;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ShaderResourceData
|
struct ShaderResourceData
|
||||||
@@ -321,10 +331,7 @@ extern "C"
|
|||||||
|
|
||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
memset(&input,0,sizeof(ShaderStageData));
|
memset(this,0,sizeof(SPVData));
|
||||||
memset(&output,0,sizeof(ShaderStageData));
|
|
||||||
|
|
||||||
memset(&resource,0,sizeof(resource));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
@@ -342,11 +349,8 @@ extern "C"
|
|||||||
{
|
{
|
||||||
result=false;
|
result=false;
|
||||||
|
|
||||||
log=new char[strlen(l)+1];
|
log=new_strcpy(l);
|
||||||
strcpy(log,l);
|
debug_log=new_strcpy(dl);
|
||||||
|
|
||||||
debug_log=new char[strlen(dl)+1];
|
|
||||||
strcpy(debug_log,dl);
|
|
||||||
|
|
||||||
spv_data=nullptr;
|
spv_data=nullptr;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user