diff options
| author | bunnei <bunneidev@gmail.com> | 2018-09-08 16:14:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-08 16:14:46 -0400 |
| commit | af074ee422a5350a3adb7586fab3c3fb5ed6bdc4 (patch) | |
| tree | 6425e9818766c88b2fe33aa559b4815b3f6cf9f1 /src/video_core/renderer_opengl/gl_state.cpp | |
| parent | deff28d3c0f0af291946fe55f3f63af1cf83b0b1 (diff) | |
| parent | 23ae7cf9dbdfc7924974a6e418207443f5839d75 (diff) | |
Merge pull request #1256 from bunnei/tex-target-support
Initial support for non-2D textures
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 8 |
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(); } } |
