summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/shader/registry.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/video_core/shader/registry.cpp b/src/video_core/shader/registry.cpp
index cdf274e54..de9a3df90 100644
--- a/src/video_core/shader/registry.cpp
+++ b/src/video_core/shader/registry.cpp
@@ -24,31 +24,33 @@ GraphicsInfo MakeGraphicsInfo(ShaderType shader_stage, ConstBufferEngineInterfac
24 if (shader_stage == ShaderType::Compute) { 24 if (shader_stage == ShaderType::Compute) {
25 return {}; 25 return {};
26 } 26 }
27 auto& graphics = static_cast<Tegra::Engines::Maxwell3D&>(engine); 27
28 28 auto& graphics = dynamic_cast<Tegra::Engines::Maxwell3D&>(engine);
29 GraphicsInfo info; 29
30 info.tfb_layouts = graphics.regs.tfb_layouts; 30 return {
31 info.tfb_varying_locs = graphics.regs.tfb_varying_locs; 31 .tfb_layouts = graphics.regs.tfb_layouts,
32 info.primitive_topology = graphics.regs.draw.topology; 32 .tfb_varying_locs = graphics.regs.tfb_varying_locs,
33 info.tessellation_primitive = graphics.regs.tess_mode.prim; 33 .primitive_topology = graphics.regs.draw.topology,
34 info.tessellation_spacing = graphics.regs.tess_mode.spacing; 34 .tessellation_primitive = graphics.regs.tess_mode.prim,
35 info.tfb_enabled = graphics.regs.tfb_enabled; 35 .tessellation_spacing = graphics.regs.tess_mode.spacing,
36 info.tessellation_clockwise = graphics.regs.tess_mode.cw; 36 .tfb_enabled = graphics.regs.tfb_enabled != 0,
37 return info; 37 .tessellation_clockwise = graphics.regs.tess_mode.cw.Value() != 0,
38 };
38} 39}
39 40
40ComputeInfo MakeComputeInfo(ShaderType shader_stage, ConstBufferEngineInterface& engine) { 41ComputeInfo MakeComputeInfo(ShaderType shader_stage, ConstBufferEngineInterface& engine) {
41 if (shader_stage != ShaderType::Compute) { 42 if (shader_stage != ShaderType::Compute) {
42 return {}; 43 return {};
43 } 44 }
44 auto& compute = static_cast<Tegra::Engines::KeplerCompute&>(engine); 45
46 auto& compute = dynamic_cast<Tegra::Engines::KeplerCompute&>(engine);
45 const auto& launch = compute.launch_description; 47 const auto& launch = compute.launch_description;
46 48
47 ComputeInfo info; 49 return {
48 info.workgroup_size = {launch.block_dim_x, launch.block_dim_y, launch.block_dim_z}; 50 .workgroup_size = {launch.block_dim_x, launch.block_dim_y, launch.block_dim_z},
49 info.local_memory_size_in_words = launch.local_pos_alloc; 51 .shared_memory_size_in_words = launch.shared_alloc,
50 info.shared_memory_size_in_words = launch.shared_alloc; 52 .local_memory_size_in_words = launch.local_pos_alloc,
51 return info; 53 };
52} 54}
53 55
54} // Anonymous namespace 56} // Anonymous namespace