Fix empty shader resource loading
(cherry picked from commit 15eec2450a
)
This commit is contained in:
parent
a606b03fd7
commit
3920b2db05
@ -239,8 +239,10 @@ Ref<Resource> ResourceFormatLoaderShader::load(const String &p_path, const Strin
|
|||||||
ERR_FAIL_COND_V_MSG(error, nullptr, "Cannot load shader: " + p_path);
|
ERR_FAIL_COND_V_MSG(error, nullptr, "Cannot load shader: " + p_path);
|
||||||
|
|
||||||
String str;
|
String str;
|
||||||
error = str.parse_utf8((const char *)buffer.ptr(), buffer.size());
|
if (buffer.size() > 0) {
|
||||||
ERR_FAIL_COND_V_MSG(error, nullptr, "Cannot parse shader: " + p_path);
|
error = str.parse_utf8((const char *)buffer.ptr(), buffer.size());
|
||||||
|
ERR_FAIL_COND_V_MSG(error, nullptr, "Cannot parse shader: " + p_path);
|
||||||
|
}
|
||||||
|
|
||||||
Ref<Shader> shader;
|
Ref<Shader> shader;
|
||||||
shader.instantiate();
|
shader.instantiate();
|
||||||
|
@ -93,8 +93,10 @@ Ref<Resource> ResourceFormatLoaderShaderInclude::load(const String &p_path, cons
|
|||||||
ERR_FAIL_COND_V_MSG(error, nullptr, "Cannot load shader include: " + p_path);
|
ERR_FAIL_COND_V_MSG(error, nullptr, "Cannot load shader include: " + p_path);
|
||||||
|
|
||||||
String str;
|
String str;
|
||||||
error = str.parse_utf8((const char *)buffer.ptr(), buffer.size());
|
if (buffer.size() > 0) {
|
||||||
ERR_FAIL_COND_V_MSG(error, nullptr, "Cannot parse shader include: " + p_path);
|
error = str.parse_utf8((const char *)buffer.ptr(), buffer.size());
|
||||||
|
ERR_FAIL_COND_V_MSG(error, nullptr, "Cannot parse shader include: " + p_path);
|
||||||
|
}
|
||||||
|
|
||||||
Ref<ShaderInclude> shader_inc;
|
Ref<ShaderInclude> shader_inc;
|
||||||
shader_inc.instantiate();
|
shader_inc.instantiate();
|
||||||
|
Loading…
Reference in New Issue
Block a user