GPUSource: Add error message on source not found
Without this, we could have crashes during static compilation of shaders without knowing where it would come from.
This commit is contained in:
@@ -670,14 +670,20 @@ Vector<const char *> gpu_shader_dependency_get_resolved_source(
|
||||
const StringRefNull shader_source_name)
|
||||
{
|
||||
Vector<const char *> result;
|
||||
GPUSource *source = g_sources->lookup(shader_source_name);
|
||||
source->build(result);
|
||||
GPUSource *src = g_sources->lookup_default(shader_source_name, nullptr);
|
||||
if (src == nullptr) {
|
||||
std::cout << "Error source not found : " << shader_source_name << std::endl;
|
||||
}
|
||||
src->build(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
StringRefNull gpu_shader_dependency_get_source(const StringRefNull shader_source_name)
|
||||
{
|
||||
GPUSource *src = g_sources->lookup(shader_source_name);
|
||||
GPUSource *src = g_sources->lookup_default(shader_source_name, nullptr);
|
||||
if (src == nullptr) {
|
||||
std::cout << "Error source not found : " << shader_source_name << std::endl;
|
||||
}
|
||||
return src->source;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user