Optimization and tweaks

This commit is contained in:
Wojtek Figat
2021-04-29 23:20:37 +02:00
parent e2789214ae
commit 05f919c50f
36 changed files with 100 additions and 133 deletions

View File

@@ -311,7 +311,12 @@ Asset::LoadResult Material::load()
{
// Load material (load shader from cache, load params, setup pipeline stuff)
MemoryReadStream shaderCacheStream(shaderCache.Data.Get(), shaderCache.Data.Length());
_materialShader = MaterialShader::Create(GetPath(), shaderCacheStream, _shaderHeader.Material.Info);
#if GPU_ENABLE_RESOURCE_NAMING
const StringView name(GetPath());
#else
const StringView name;
#endif
_materialShader = MaterialShader::Create(name, shaderCacheStream, _shaderHeader.Material.Info);
if (_materialShader == nullptr)
{
LOG(Warning, "Cannot load material.");
@@ -483,7 +488,7 @@ BytesContainer Material::LoadSurface(bool createDefaultIfMissing)
}
}
LOG(Warning, "Material \'{0}\' surface data is missing.", GetPath());
LOG(Warning, "Material \'{0}\' surface data is missing.", ToString());
#if COMPILE_WITH_MATERIAL_GRAPH