Formalize builtin shader resource contracts
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "ShaderFileUtils.h"
|
||||
|
||||
#include <XCEngine/Core/Asset/ResourceManager.h>
|
||||
#include <XCEngine/Rendering/Builtin/BuiltinPassLayoutUtils.h>
|
||||
#include <XCEngine/Resources/BuiltinResources.h>
|
||||
#include <XCEngine/Resources/Shader/ShaderLoader.h>
|
||||
|
||||
@@ -207,6 +208,14 @@ ShaderPass BuildConcretePass(
|
||||
for (const ShaderResourceBindingDesc& resourceBinding : pass.resources) {
|
||||
shaderPass.resources.PushBack(resourceBinding);
|
||||
}
|
||||
if (shaderPass.resources.Empty()) {
|
||||
Containers::Array<ShaderResourceBindingDesc> defaultBindings;
|
||||
if (::XCEngine::Rendering::TryBuildBuiltinPassDefaultResourceBindings(shaderPass, defaultBindings)) {
|
||||
for (const ShaderResourceBindingDesc& resourceBinding : defaultBindings) {
|
||||
shaderPass.resources.PushBack(resourceBinding);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const ShaderKeywordDeclaration& keywordDeclaration : pass.keywordDeclarations) {
|
||||
shaderPass.keywordDeclarations.PushBack(keywordDeclaration);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user