summaryrefslogtreecommitdiff
path: root/src/video_core/shader_cache.cpp
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-05-23 04:28:34 -0300
committerGravatar ameerj2021-07-22 21:51:30 -0400
commitd621e96d0de212cc16897eadf71e8a1b2e1eb5dc (patch)
tree8695f2f4dddf2564b63e4574d6616ccb0e79568c /src/video_core/shader_cache.cpp
parentspirv: Be aware of NAN unaware drivers (diff)
downloadyuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.gz
yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.xz
yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.zip
shader: Initial OpenGL implementation
Diffstat (limited to 'src/video_core/shader_cache.cpp')
-rw-r--r--src/video_core/shader_cache.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/video_core/shader_cache.cpp b/src/video_core/shader_cache.cpp
index b8b8eace5..78bf90c48 100644
--- a/src/video_core/shader_cache.cpp
+++ b/src/video_core/shader_cache.cpp
@@ -91,6 +91,23 @@ const ShaderInfo* ShaderCache::ComputeShader() {
91 return MakeShaderInfo(env, *cpu_shader_addr); 91 return MakeShaderInfo(env, *cpu_shader_addr);
92} 92}
93 93
94void ShaderCache::GetGraphicsEnvironments(GraphicsEnvironments& result,
95 const std::array<u64, NUM_PROGRAMS>& unique_hashes) {
96 size_t env_index{};
97 const GPUVAddr base_addr{maxwell3d.regs.code_address.CodeAddress()};
98 for (size_t index = 0; index < NUM_PROGRAMS; ++index) {
99 if (unique_hashes[index] == 0) {
100 continue;
101 }
102 const auto program{static_cast<Tegra::Engines::Maxwell3D::Regs::ShaderProgram>(index)};
103 auto& env{result.envs[index]};
104 const u32 start_address{maxwell3d.regs.shader_config[index].offset};
105 env = GraphicsEnvironment{maxwell3d, gpu_memory, program, base_addr, start_address};
106 env.SetCachedSize(shader_infos[index]->size_bytes);
107 result.env_ptrs[env_index++] = &env;
108 }
109}
110
94ShaderInfo* ShaderCache::TryGet(VAddr addr) const { 111ShaderInfo* ShaderCache::TryGet(VAddr addr) const {
95 std::scoped_lock lock{lookup_mutex}; 112 std::scoped_lock lock{lookup_mutex};
96 113