summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorHexagon12 <Hexagon12@users.noreply.github.com>2019-04-23 17:30:35 +0200
committerGitHub <noreply@github.com>2019-04-23 17:30:35 +0200
commit8df9449bb8c34737ffa4b759104562fb0905f1a7 (patch)
treea8bc6d37faeb6063dfb5211695443523e8c44e25 /src/video_core
parentMerge pull request #2425 from FernandoS27/y-direction (diff)
parentgl_state: Fix samplers memory corruption (diff)
downloadyuzu-8df9449bb8c34737ffa4b759104562fb0905f1a7.tar
yuzu-8df9449bb8c34737ffa4b759104562fb0905f1a7.tar.gz
yuzu-8df9449bb8c34737ffa4b759104562fb0905f1a7.tar.bz2
yuzu-8df9449bb8c34737ffa4b759104562fb0905f1a7.tar.lz
yuzu-8df9449bb8c34737ffa4b759104562fb0905f1a7.tar.xz
yuzu-8df9449bb8c34737ffa4b759104562fb0905f1a7.tar.zst
yuzu-8df9449bb8c34737ffa4b759104562fb0905f1a7.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 52d569a1b..7425fbe5d 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -471,8 +471,9 @@ void OpenGLState::ApplyTextures() const {
const auto& texture_unit = texture_units[i];
auto& cur_state_texture_unit = cur_state.texture_units[i];
textures[i] = texture_unit.texture;
- if (cur_state_texture_unit.texture == textures[i])
+ if (cur_state_texture_unit.texture == textures[i]) {
continue;
+ }
cur_state_texture_unit.texture = textures[i];
if (!has_delta) {
first = i;
@@ -493,10 +494,11 @@ void OpenGLState::ApplySamplers() const {
std::array<GLuint, Maxwell::NumTextureSamplers> samplers;
for (std::size_t i = 0; i < std::size(samplers); ++i) {
- if (cur_state.texture_units[i].sampler == texture_units[i].sampler)
+ samplers[i] = texture_units[i].sampler;
+ if (cur_state.texture_units[i].sampler == texture_units[i].sampler) {
continue;
+ }
cur_state.texture_units[i].sampler = texture_units[i].sampler;
- samplers[i] = texture_units[i].sampler;
if (!has_delta) {
first = i;
has_delta = true;