summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-12-21 02:51:19 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-12-21 02:51:21 +0100
commit1e16023d6000395b71e1a5d00e38e84bade12f20 (patch)
tree388adb52f131cbfe7fb7ba291f7acaa9cc59b8ea /src
parentgl_shader_cache: Remove unused entry in GetPrimitiveDescription (diff)
downloadyuzu-1e16023d6000395b71e1a5d00e38e84bade12f20.tar
yuzu-1e16023d6000395b71e1a5d00e38e84bade12f20.tar.gz
yuzu-1e16023d6000395b71e1a5d00e38e84bade12f20.tar.bz2
yuzu-1e16023d6000395b71e1a5d00e38e84bade12f20.tar.lz
yuzu-1e16023d6000395b71e1a5d00e38e84bade12f20.tar.xz
yuzu-1e16023d6000395b71e1a5d00e38e84bade12f20.tar.zst
yuzu-1e16023d6000395b71e1a5d00e38e84bade12f20.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index c2ec120ba..de742d11c 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -264,28 +264,25 @@ CachedProgram BuildShader(const Device& device, u64 unique_identifier, ShaderTyp
"#extension GL_NV_shader_thread_group : require\n"
"#extension GL_NV_shader_thread_shuffle : require\n";
}
- source += '\n';
if (shader_type == ShaderType::Geometry) {
const auto [glsl_topology, max_vertices] = GetPrimitiveDescription(variant.primitive_mode);
source += fmt::format("#define MAX_VERTEX_INPUT {}\n", max_vertices);
- source += fmt::format("layout ({}) in;\n\n", glsl_topology);
+ source += fmt::format("layout ({}) in;\n", glsl_topology);
}
if (shader_type == ShaderType::Compute) {
+ if (variant.local_memory_size > 0) {
+ source += fmt::format("#define LOCAL_MEMORY_SIZE {}\n",
+ Common::AlignUp(variant.local_memory_size, 4) / 4);
+ }
source +=
fmt::format("layout (local_size_x = {}, local_size_y = {}, local_size_z = {}) in;\n",
variant.block_x, variant.block_y, variant.block_z);
if (variant.shared_memory_size > 0) {
- // TODO(Rodrigo): We should divide by four here, but having a larger shared memory pool
- // avoids out of bound stores. Find out why shared memory size is being invalid.
+ // shared_memory_size is described in number of words
source += fmt::format("shared uint smem[{}];\n", variant.shared_memory_size);
}
-
- if (variant.local_memory_size > 0) {
- source += fmt::format("#define LOCAL_MEMORY_SIZE {}\n",
- Common::AlignUp(variant.local_memory_size, 4) / 4);
- }
}
source += '\n';