mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-27 08:04:25 +01:00
shader/registry: Make use of designated initializers where applicable
Same behavior, less repetition.
This commit is contained in:
parent
2b863c9aa3
commit
ffeb4ef83e
@ -24,31 +24,33 @@ GraphicsInfo MakeGraphicsInfo(ShaderType shader_stage, ConstBufferEngineInterfac
|
|||||||
if (shader_stage == ShaderType::Compute) {
|
if (shader_stage == ShaderType::Compute) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
auto& graphics = static_cast<Tegra::Engines::Maxwell3D&>(engine);
|
|
||||||
|
|
||||||
GraphicsInfo info;
|
auto& graphics = dynamic_cast<Tegra::Engines::Maxwell3D&>(engine);
|
||||||
info.tfb_layouts = graphics.regs.tfb_layouts;
|
|
||||||
info.tfb_varying_locs = graphics.regs.tfb_varying_locs;
|
return {
|
||||||
info.primitive_topology = graphics.regs.draw.topology;
|
.tfb_layouts = graphics.regs.tfb_layouts,
|
||||||
info.tessellation_primitive = graphics.regs.tess_mode.prim;
|
.tfb_varying_locs = graphics.regs.tfb_varying_locs,
|
||||||
info.tessellation_spacing = graphics.regs.tess_mode.spacing;
|
.primitive_topology = graphics.regs.draw.topology,
|
||||||
info.tfb_enabled = graphics.regs.tfb_enabled;
|
.tessellation_primitive = graphics.regs.tess_mode.prim,
|
||||||
info.tessellation_clockwise = graphics.regs.tess_mode.cw;
|
.tessellation_spacing = graphics.regs.tess_mode.spacing,
|
||||||
return info;
|
.tfb_enabled = graphics.regs.tfb_enabled != 0,
|
||||||
|
.tessellation_clockwise = graphics.regs.tess_mode.cw.Value() != 0,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
ComputeInfo MakeComputeInfo(ShaderType shader_stage, ConstBufferEngineInterface& engine) {
|
ComputeInfo MakeComputeInfo(ShaderType shader_stage, ConstBufferEngineInterface& engine) {
|
||||||
if (shader_stage != ShaderType::Compute) {
|
if (shader_stage != ShaderType::Compute) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
auto& compute = static_cast<Tegra::Engines::KeplerCompute&>(engine);
|
|
||||||
|
auto& compute = dynamic_cast<Tegra::Engines::KeplerCompute&>(engine);
|
||||||
const auto& launch = compute.launch_description;
|
const auto& launch = compute.launch_description;
|
||||||
|
|
||||||
ComputeInfo info;
|
return {
|
||||||
info.workgroup_size = {launch.block_dim_x, launch.block_dim_y, launch.block_dim_z};
|
.workgroup_size = {launch.block_dim_x, launch.block_dim_y, launch.block_dim_z},
|
||||||
info.local_memory_size_in_words = launch.local_pos_alloc;
|
.shared_memory_size_in_words = launch.shared_alloc,
|
||||||
info.shared_memory_size_in_words = launch.shared_alloc;
|
.local_memory_size_in_words = launch.local_pos_alloc,
|
||||||
return info;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user