diff options
author | Markus Wick <markus@selfnet.de> | 2018-09-04 20:55:34 +0200 |
---|---|---|
committer | Markus Wick <markus@selfnet.de> | 2018-09-04 21:04:41 +0200 |
commit | 99a71580c4356c51bcb5f18b10be55f1e62a65e5 (patch) | |
tree | 8e32bd63d0d5e0297208959bbb9b6851ab39ba8f /src/video_core/renderer_opengl/gl_shader_gen.h | |
parent | Merge pull request #1238 from lioncash/explicit (diff) | |
download | yuzu-99a71580c4356c51bcb5f18b10be55f1e62a65e5.tar yuzu-99a71580c4356c51bcb5f18b10be55f1e62a65e5.tar.gz yuzu-99a71580c4356c51bcb5f18b10be55f1e62a65e5.tar.bz2 yuzu-99a71580c4356c51bcb5f18b10be55f1e62a65e5.tar.lz yuzu-99a71580c4356c51bcb5f18b10be55f1e62a65e5.tar.xz yuzu-99a71580c4356c51bcb5f18b10be55f1e62a65e5.tar.zst yuzu-99a71580c4356c51bcb5f18b10be55f1e62a65e5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_gen.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.h b/src/video_core/renderer_opengl/gl_shader_gen.h index c788099d4..cbb2090ea 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.h +++ b/src/video_core/renderer_opengl/gl_shader_gen.h @@ -53,6 +53,10 @@ public: return BufferBaseNames[static_cast<size_t>(stage)] + std::to_string(index); } + u32 GetHash() const { + return (static_cast<u32>(stage) << 16) | index; + } + private: static constexpr std::array<const char*, Maxwell::MaxShaderStage> BufferBaseNames = { "buffer_vs_c", "buffer_tessc_c", "buffer_tesse_c", "buffer_gs_c", "buffer_fs_c", @@ -89,6 +93,10 @@ public: std::to_string(sampler_index) + ']'; } + u32 GetHash() const { + return (static_cast<u32>(stage) << 16) | static_cast<u32>(sampler_index); + } + static std::string GetArrayName(Maxwell::ShaderStage stage) { return TextureSamplerNames[static_cast<size_t>(stage)]; } |