summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-09-08 22:14:46 +0200
committerGitHub <noreply@github.com>2018-09-08 22:14:46 +0200
commitaf074ee422a5350a3adb7586fab3c3fb5ed6bdc4 (patch)
tree6425e9818766c88b2fe33aa559b4815b3f6cf9f1 /src/video_core/renderer_opengl/gl_state.cpp
parentMerge pull request #1265 from zhaowenlan1779/patch-1 (diff)
parentgl_rasterizer_cache: Improve accuracy of RecreateSurface for non-2D textures. (diff)
downloadyuzu-af074ee422a5350a3adb7586fab3c3fb5ed6bdc4.tar
yuzu-af074ee422a5350a3adb7586fab3c3fb5ed6bdc4.tar.gz
yuzu-af074ee422a5350a3adb7586fab3c3fb5ed6bdc4.tar.bz2
yuzu-af074ee422a5350a3adb7586fab3c3fb5ed6bdc4.tar.lz
yuzu-af074ee422a5350a3adb7586fab3c3fb5ed6bdc4.tar.xz
yuzu-af074ee422a5350a3adb7586fab3c3fb5ed6bdc4.tar.zst
yuzu-af074ee422a5350a3adb7586fab3c3fb5ed6bdc4.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 60a4defd1..6f70deb96 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -200,9 +200,9 @@ void OpenGLState::Apply() const {
const auto& texture_unit = texture_units[i];
const auto& cur_state_texture_unit = cur_state.texture_units[i];
- if (texture_unit.texture_2d != cur_state_texture_unit.texture_2d) {
+ if (texture_unit.texture != cur_state_texture_unit.texture) {
glActiveTexture(TextureUnits::MaxwellTexture(static_cast<int>(i)).Enum());
- glBindTexture(GL_TEXTURE_2D, texture_unit.texture_2d);
+ glBindTexture(texture_unit.target, texture_unit.texture);
}
if (texture_unit.sampler != cur_state_texture_unit.sampler) {
glBindSampler(static_cast<GLuint>(i), texture_unit.sampler);
@@ -214,7 +214,7 @@ void OpenGLState::Apply() const {
texture_unit.swizzle.a != cur_state_texture_unit.swizzle.a) {
std::array<GLint, 4> mask = {texture_unit.swizzle.r, texture_unit.swizzle.g,
texture_unit.swizzle.b, texture_unit.swizzle.a};
- glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, mask.data());
+ glTexParameteriv(texture_unit.target, GL_TEXTURE_SWIZZLE_RGBA, mask.data());
}
}
@@ -287,7 +287,7 @@ void OpenGLState::Apply() const {
OpenGLState& OpenGLState::UnbindTexture(GLuint handle) {
for (auto& unit : texture_units) {
- if (unit.texture_2d == handle) {
+ if (unit.texture == handle) {
unit.Unbind();
}
}