From be9e952bdc33b6763618ee66046ce84c0ff18a34 Mon Sep 17 00:00:00 2001 From: wwylele Date: Fri, 16 Jun 2017 16:16:28 +0300 Subject: gl_rasterizer: manage texture ids in one place --- src/video_core/renderer_opengl/gl_state.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/video_core/renderer_opengl/gl_state.cpp') diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 40d7cee96..6ef6d6c4c 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -183,7 +183,7 @@ void OpenGLState::Apply() const { // Textures for (unsigned i = 0; i < ARRAY_SIZE(texture_units); ++i) { if (texture_units[i].texture_2d != cur_state.texture_units[i].texture_2d) { - glActiveTexture(GL_TEXTURE0 + i); + glActiveTexture(TextureUnits::PicaTexture(i).Enum()); glBindTexture(GL_TEXTURE_2D, texture_units[i].texture_2d); } if (texture_units[i].sampler != cur_state.texture_units[i].sampler) { @@ -193,43 +193,43 @@ void OpenGLState::Apply() const { // Lighting LUTs if (lighting_lut.texture_buffer != cur_state.lighting_lut.texture_buffer) { - glActiveTexture(GL_TEXTURE15); + glActiveTexture(TextureUnits::LightingLUT.Enum()); glBindTexture(GL_TEXTURE_BUFFER, cur_state.lighting_lut.texture_buffer); } // Fog LUT if (fog_lut.texture_1d != cur_state.fog_lut.texture_1d) { - glActiveTexture(GL_TEXTURE9); + glActiveTexture(TextureUnits::FogLUT.Enum()); glBindTexture(GL_TEXTURE_1D, fog_lut.texture_1d); } // ProcTex Noise LUT if (proctex_noise_lut.texture_1d != cur_state.proctex_noise_lut.texture_1d) { - glActiveTexture(GL_TEXTURE10); + glActiveTexture(TextureUnits::ProcTexNoiseLUT.Enum()); glBindTexture(GL_TEXTURE_1D, proctex_noise_lut.texture_1d); } // ProcTex Color Map if (proctex_color_map.texture_1d != cur_state.proctex_color_map.texture_1d) { - glActiveTexture(GL_TEXTURE11); + glActiveTexture(TextureUnits::ProcTexColorMap.Enum()); glBindTexture(GL_TEXTURE_1D, proctex_color_map.texture_1d); } // ProcTex Alpha Map if (proctex_alpha_map.texture_1d != cur_state.proctex_alpha_map.texture_1d) { - glActiveTexture(GL_TEXTURE12); + glActiveTexture(TextureUnits::ProcTexAlphaMap.Enum()); glBindTexture(GL_TEXTURE_1D, proctex_alpha_map.texture_1d); } // ProcTex LUT if (proctex_lut.texture_1d != cur_state.proctex_lut.texture_1d) { - glActiveTexture(GL_TEXTURE13); + glActiveTexture(TextureUnits::ProcTexLUT.Enum()); glBindTexture(GL_TEXTURE_1D, proctex_lut.texture_1d); } // ProcTex Diff LUT if (proctex_diff_lut.texture_1d != cur_state.proctex_diff_lut.texture_1d) { - glActiveTexture(GL_TEXTURE14); + glActiveTexture(TextureUnits::ProcTexDiffLUT.Enum()); glBindTexture(GL_TEXTURE_1D, proctex_diff_lut.texture_1d); } -- cgit v1.2.3