diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-12-16 07:35:34 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-12-16 08:08:05 +0100 |
commit | e4e962bc7c593c7dd0957af12e56b30e6bee5c06 (patch) | |
tree | d830aa090e1d1881b4cf26026ab9fbb02dfcfd5f /src/video_core/shader/shader.h | |
parent | VideoCore/Shader: Move DebugData to a separate file (diff) | |
download | yuzu-e4e962bc7c593c7dd0957af12e56b30e6bee5c06.tar yuzu-e4e962bc7c593c7dd0957af12e56b30e6bee5c06.tar.gz yuzu-e4e962bc7c593c7dd0957af12e56b30e6bee5c06.tar.bz2 yuzu-e4e962bc7c593c7dd0957af12e56b30e6bee5c06.tar.lz yuzu-e4e962bc7c593c7dd0957af12e56b30e6bee5c06.tar.xz yuzu-e4e962bc7c593c7dd0957af12e56b30e6bee5c06.tar.zst yuzu-e4e962bc7c593c7dd0957af12e56b30e6bee5c06.zip |
Diffstat (limited to 'src/video_core/shader/shader.h')
-rw-r--r-- | src/video_core/shader/shader.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h index 87c4e0b6f..d96724860 100644 --- a/src/video_core/shader/shader.h +++ b/src/video_core/shader/shader.h @@ -161,21 +161,16 @@ struct ShaderSetup { std::array<Math::Vec4<u8>, 4> i; } uniforms; - static size_t UniformOffset(RegisterType type, unsigned index) { - switch (type) { - case RegisterType::FloatUniform: - return offsetof(ShaderSetup, uniforms.f) + index * sizeof(Math::Vec4<float24>); - - case RegisterType::BoolUniform: - return offsetof(ShaderSetup, uniforms.b) + index * sizeof(bool); + static size_t GetFloatUniformOffset(unsigned index) { + return offsetof(ShaderSetup, uniforms.f) + index * sizeof(Math::Vec4<float24>); + } - case RegisterType::IntUniform: - return offsetof(ShaderSetup, uniforms.i) + index * sizeof(Math::Vec4<u8>); + static size_t GetBoolUniformOffset(unsigned index) { + return offsetof(ShaderSetup, uniforms.b) + index * sizeof(bool); + } - default: - UNREACHABLE(); - return 0; - } + static size_t GetIntUniformOffset(unsigned index) { + return offsetof(ShaderSetup, uniforms.i) + index * sizeof(Math::Vec4<u8>); } std::array<u32, 1024> program_code; |