summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-11-19 01:38:15 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-11-23 01:28:49 +0100
commit180417c51438e2c97b800f4b19e621dbc8288493 (patch)
treef9b6d755d10c80a0bef5cda6a2254a0a497f93a2 /src/video_core/renderer_opengl/gl_state.cpp
parentvideo_core: Unify ProgramType and ShaderStage into ShaderType (diff)
downloadyuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar
yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar.gz
yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar.bz2
yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar.lz
yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar.xz
yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar.zst
yuzu-180417c51438e2c97b800f4b19e621dbc8288493.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index ccbe5912e..4cf3d0a8a 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -417,14 +417,20 @@ void OpenGLState::ApplyClipControl() {
}
void OpenGLState::ApplyTextures() {
- if (const auto update = UpdateArray(cur_state.textures, textures)) {
- glBindTextures(update->first, update->second, textures.data() + update->first);
+ const std::size_t size = std::size(textures);
+ for (std::size_t i = 0; i < size; ++i) {
+ if (UpdateValue(cur_state.textures[i], textures[i])) {
+ glBindTextureUnit(static_cast<GLuint>(i), textures[i]);
+ }
}
}
void OpenGLState::ApplySamplers() {
- if (const auto update = UpdateArray(cur_state.samplers, samplers)) {
- glBindSamplers(update->first, update->second, samplers.data() + update->first);
+ const std::size_t size = std::size(samplers);
+ for (std::size_t i = 0; i < size; ++i) {
+ if (UpdateValue(cur_state.samplers[i], samplers[i])) {
+ glBindSampler(static_cast<GLuint>(i), samplers[i]);
+ }
}
}