Add partial support for legacy attribute conversion

We previously missed the hades pass for attribute conversion leading to crashes when games would attempt to use such an attribute. The hades pass for this isn't a proper fix however as it modifies the IR directly and will break if any of the previous stages in the pipeline change. Enable it to allow for games using them to at least have a chance at working. In the long term the pass will be reworked on the hades side to avoid modifying the IR in a way that can't be undone.
This commit is contained in:
Billy Laws 2022-08-04 20:11:07 +01:00
parent 540437b547
commit 390558c802

View File

@ -367,6 +367,11 @@ namespace skyline::gpu {
lock.unlock(); lock.unlock();
// Note: EmitSPIRV will change bindings so we explicitly have pre/post emit bindings // Note: EmitSPIRV will change bindings so we explicitly have pre/post emit bindings
if (program->program.info.loads.Legacy() || program->program.info.stores.Legacy()) {
// The legacy conversion pass modifies the underlying program based on runtime state, so without making a copy of the program there may be issues if runtimeInfo changes
Logger::Warn("Shader uses legacy attributes, beware!");
Shader::Maxwell::ConvertLegacyToGeneric(program->program, runtimeInfo);
}
auto spirv{Shader::Backend::SPIRV::EmitSPIRV(profile, runtimeInfo, program->program, bindings)}; auto spirv{Shader::Backend::SPIRV::EmitSPIRV(profile, runtimeInfo, program->program, bindings)};
vk::ShaderModuleCreateInfo createInfo{ vk::ShaderModuleCreateInfo createInfo{