chore: checkpoint current workspace changes

This commit is contained in:
2026-04-11 22:14:02 +08:00
parent 3e55f8c204
commit 8848cfd958
227 changed files with 34027 additions and 6711 deletions

View File

@@ -53,6 +53,18 @@ inline RHI::ShaderBinaryBackend ToRHIShaderBinaryBackend(Resources::ShaderBacken
}
}
inline RHI::ShaderBinaryBackend ResolveCompiledBinaryBackend(
Resources::ShaderBackend backend,
const Resources::ShaderStageVariant& variant) {
if (backend == Resources::ShaderBackend::OpenGL &&
variant.language == Resources::ShaderLanguage::HLSL) {
// OpenGL runtime consumes HLSL-authored precompiled SPIR-V through the Vulkan SPIR-V path.
return RHI::ShaderBinaryBackend::Vulkan;
}
return ToRHIShaderBinaryBackend(backend);
}
inline std::wstring ToWideAscii(const Containers::String& value) {
std::wstring wide;
wide.reserve(value.Length());
@@ -385,7 +397,7 @@ inline void ApplyShaderStageVariant(
compileDesc.sourceLanguage = ToRHIShaderLanguage(variant.language);
compileDesc.entryPoint = ToWideAscii(variant.entryPoint);
compileDesc.profile = ToWideAscii(variant.profile);
compileDesc.compiledBinaryBackend = ToRHIShaderBinaryBackend(variant.backend);
compileDesc.compiledBinaryBackend = ResolveCompiledBinaryBackend(variant.backend, variant);
compileDesc.compiledBinary.clear();
if (!variant.compiledBinary.Empty()) {
compileDesc.compiledBinary.assign(
@@ -433,7 +445,7 @@ inline void ApplyShaderStageVariant(
compileDesc.compiledBinaryBackend = RHI::ShaderBinaryBackend::Unknown;
compileDesc.compiledBinary.clear();
if (const Containers::Array<Core::uint8>* binary = variant.GetCompiledBinaryForBackend(backend)) {
compileDesc.compiledBinaryBackend = ToRHIShaderBinaryBackend(backend);
compileDesc.compiledBinaryBackend = ResolveCompiledBinaryBackend(backend, variant);
compileDesc.compiledBinary.assign(binary->Data(), binary->Data() + binary->Size());
}
InjectShaderBackendMacros(backend, compileDesc);