0
0
mirror of https://github.com/Ishan09811/pine.git synced 2025-04-28 09:35:08 +00:00

Update shader_manager.cpp

This commit is contained in:
Ishan09811 2025-01-16 14:48:30 +05:30 committed by GitHub
parent fd9ca88983
commit 6bb0de1a9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -438,7 +438,7 @@ namespace skyline::gpu {
Shader::Maxwell::ConvertLegacyToGeneric(program, runtimeInfo);
}
auto future = std::async(std::launch::async, [this, &runtimeInfo, &program, &bindings, hash]() {
auto compileShader = [this, &runtimeInfo, &program, &bindings, hash]() {
auto spirvEmitted{Shader::Backend::SPIRV::EmitSPIRV(profile, runtimeInfo, program, bindings)};
auto spirv{ProcessShaderBinary(true, hash, span<u32>{spirvEmitted}.cast<u8>()).cast<u32>()};
@ -447,9 +447,14 @@ namespace skyline::gpu {
.codeSize = spirv.size_bytes(),
};
return (*gpu.vkDevice).createShaderModule(createInfo, nullptr, *gpu.vkDevice.getDispatcher());
});
};
if (*gpu.getState().settings->useAsyncShaders) {
auto future = std::async(std::launch::async, compileShader);
return future.get();
} else {
return compileShader();
}
}
void ShaderManager::ResetPools() {