summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2018-11-29 20:13:13 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2018-11-29 20:58:20 +0100
commit2908d302748c1db6df3f44cd27d51a34a1b50c31 (patch)
tree3a8c722a381133eb7316973b2aef282f770ea4fd /src/video_core/renderer_opengl/gl_shader_decompiler.cpp
parentMerge pull request #1768 from greggameplayer/patch-2 (diff)
downloadyuzu-2908d302748c1db6df3f44cd27d51a34a1b50c31.tar
yuzu-2908d302748c1db6df3f44cd27d51a34a1b50c31.tar.gz
yuzu-2908d302748c1db6df3f44cd27d51a34a1b50c31.tar.bz2
yuzu-2908d302748c1db6df3f44cd27d51a34a1b50c31.tar.lz
yuzu-2908d302748c1db6df3f44cd27d51a34a1b50c31.tar.xz
yuzu-2908d302748c1db6df3f44cd27d51a34a1b50c31.tar.zst
yuzu-2908d302748c1db6df3f44cd27d51a34a1b50c31.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_decompiler.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 0c4524d5c..0c1632bd1 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -525,6 +525,7 @@ public:
((header.vtg.clip_distances >> index) & 1) == 0,
"Shader is setting gl_ClipDistance{} without enabling it in the header", index);
+ clip_distances[index] = true;
fixed_pipeline_output_attributes_used.insert(attribute);
shader.AddLine(dest + '[' + std::to_string(index) + "] = " + src + ';');
break;
@@ -602,6 +603,11 @@ public:
return used_samplers;
}
+ /// Returns an array of the used clip distances.
+ const std::array<bool, Maxwell::NumClipDistances>& GetClipDistances() const {
+ return clip_distances;
+ }
+
/// Returns the GLSL sampler used for the input shader sampler, and creates a new one if
/// necessary.
std::string AccessSampler(const Sampler& sampler, Tegra::Shader::TextureType type,
@@ -975,6 +981,7 @@ private:
const std::string& suffix;
const Tegra::Shader::Header& header;
std::unordered_set<Attribute::Index> fixed_pipeline_output_attributes_used;
+ std::array<bool, Maxwell::NumClipDistances> clip_distances{};
u64 local_memory_size;
};
@@ -997,7 +1004,8 @@ public:
/// Returns entries in the shader that are useful for external functions
ShaderEntries GetEntries() const {
- return {regs.GetConstBuffersDeclarations(), regs.GetSamplers(), shader_length};
+ return {regs.GetConstBuffersDeclarations(), regs.GetSamplers(), regs.GetClipDistances(),
+ shader_length};
}
private: