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:
parent
fd9ca88983
commit
6bb0de1a9c
@ -438,7 +438,7 @@ namespace skyline::gpu {
|
|||||||
Shader::Maxwell::ConvertLegacyToGeneric(program, runtimeInfo);
|
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 spirvEmitted{Shader::Backend::SPIRV::EmitSPIRV(profile, runtimeInfo, program, bindings)};
|
||||||
auto spirv{ProcessShaderBinary(true, hash, span<u32>{spirvEmitted}.cast<u8>()).cast<u32>()};
|
auto spirv{ProcessShaderBinary(true, hash, span<u32>{spirvEmitted}.cast<u8>()).cast<u32>()};
|
||||||
|
|
||||||
@ -447,9 +447,14 @@ namespace skyline::gpu {
|
|||||||
.codeSize = spirv.size_bytes(),
|
.codeSize = spirv.size_bytes(),
|
||||||
};
|
};
|
||||||
return (*gpu.vkDevice).createShaderModule(createInfo, nullptr, *gpu.vkDevice.getDispatcher());
|
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();
|
return future.get();
|
||||||
|
} else {
|
||||||
|
return compileShader();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShaderManager::ResetPools() {
|
void ShaderManager::ResetPools() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user