From 285ac34bf3bada1737dd1e0a2f30af575435828e Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 25 May 2015 15:14:20 +0200 Subject: [PATCH] OGL: use GL_TEXTURE* constants --- Source/Core/VideoBackends/OGL/FramebufferManager.cpp | 6 +++--- Source/Core/VideoBackends/OGL/PostProcessing.cpp | 2 +- Source/Core/VideoBackends/OGL/RasterFont.cpp | 2 +- Source/Core/VideoBackends/OGL/TextureCache.cpp | 12 ++++++------ Source/Core/VideoBackends/OGL/TextureConverter.cpp | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/FramebufferManager.cpp b/Source/Core/VideoBackends/OGL/FramebufferManager.cpp index 10b37befd4..784e424c29 100644 --- a/Source/Core/VideoBackends/OGL/FramebufferManager.cpp +++ b/Source/Core/VideoBackends/OGL/FramebufferManager.cpp @@ -65,7 +65,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms // The distinction becomes important for certain operations, i.e. the // alpha channel should be ignored if the EFB does not have one. - glActiveTexture(GL_TEXTURE0 + 9); + glActiveTexture(GL_TEXTURE9); GLuint glObj[3]; glGenTextures(3, glObj); @@ -540,7 +540,7 @@ void FramebufferManager::ReinterpretPixelData(unsigned int convtype) FramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, m_textureType, m_efbColor, 0); glViewport(0,0, m_targetWidth, m_targetHeight); - glActiveTexture(GL_TEXTURE0 + 9); + glActiveTexture(GL_TEXTURE9); glBindTexture(m_textureType, src_texture); m_pixel_format_shaders[convtype ? 1 : 0].Bind(); @@ -593,7 +593,7 @@ XFBSourceBase* FramebufferManager::CreateXFBSource(unsigned int target_width, un glGenTextures(1, &texture); - glActiveTexture(GL_TEXTURE0 + 9); + glActiveTexture(GL_TEXTURE9); glBindTexture(GL_TEXTURE_2D_ARRAY, texture); glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, 0); glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, target_width, target_height, layers, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); diff --git a/Source/Core/VideoBackends/OGL/PostProcessing.cpp b/Source/Core/VideoBackends/OGL/PostProcessing.cpp index af26e398fb..92ca734398 100644 --- a/Source/Core/VideoBackends/OGL/PostProcessing.cpp +++ b/Source/Core/VideoBackends/OGL/PostProcessing.cpp @@ -152,7 +152,7 @@ void OpenGLPostProcessing::BlitFromTexture(TargetRectangle src, TargetRectangle m_config.SetDirty(false); } - glActiveTexture(GL_TEXTURE0+9); + glActiveTexture(GL_TEXTURE9); glBindTexture(GL_TEXTURE_2D_ARRAY, src_texture); glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR); diff --git a/Source/Core/VideoBackends/OGL/RasterFont.cpp b/Source/Core/VideoBackends/OGL/RasterFont.cpp index d436f9ce25..ebc303c9d6 100644 --- a/Source/Core/VideoBackends/OGL/RasterFont.cpp +++ b/Source/Core/VideoBackends/OGL/RasterFont.cpp @@ -142,7 +142,7 @@ RasterFont::RasterFont() { // generate the texture glGenTextures(1, &texture); - glActiveTexture(GL_TEXTURE0+8); + glActiveTexture(GL_TEXTURE8); glBindTexture(GL_TEXTURE_2D, texture); std::vector texture_data(CHAR_WIDTH * CHAR_COUNT * CHAR_HEIGHT); for (int y = 0; y < CHAR_HEIGHT; y++) diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp index 370475809f..fd55258838 100644 --- a/Source/Core/VideoBackends/OGL/TextureCache.cpp +++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp @@ -58,7 +58,7 @@ bool SaveTexture(const std::string& filename, u32 textarget, u32 tex, int virtua int width = std::max(virtual_width >> level, 1); int height = std::max(virtual_height >> level, 1); std::vector data(width * height * 4); - glActiveTexture(GL_TEXTURE0+9); + glActiveTexture(GL_TEXTURE9); glBindTexture(textarget, tex); glGetTexImage(textarget, level, GL_RGBA, GL_UNSIGNED_BYTE, data.data()); glBindTexture(textarget, 0); @@ -117,7 +117,7 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntryConf { TCacheEntry* entry = new TCacheEntry(config); - glActiveTexture(GL_TEXTURE0+9); + glActiveTexture(GL_TEXTURE9); glBindTexture(GL_TEXTURE_2D_ARRAY, entry->texture); glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, config.levels - 1); @@ -146,7 +146,7 @@ void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height, PanicAlert("size of level %d must be %dx%d, but %dx%d requested", level, std::max(1u, config.width >> level), std::max(1u, config.height >> level), width, height); - glActiveTexture(GL_TEXTURE0+9); + glActiveTexture(GL_TEXTURE9); glBindTexture(GL_TEXTURE_2D_ARRAY, texture); if (expanded_width != width) @@ -176,7 +176,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo OpenGL_BindAttributelessVAO(); - glActiveTexture(GL_TEXTURE0+9); + glActiveTexture(GL_TEXTURE9); glBindTexture(GL_TEXTURE_2D_ARRAY, read_texture); glViewport(0, 0, config.width, config.height); @@ -487,7 +487,7 @@ void TextureCache::ConvertTexture(TCacheEntryBase* _entry, TCacheEntryBase* _unc TCacheEntry* entry = (TCacheEntry*) _entry; TCacheEntry* unconverted = (TCacheEntry*) _unconverted; - glActiveTexture(GL_TEXTURE0 + 9); + glActiveTexture(GL_TEXTURE9); glBindTexture(GL_TEXTURE_2D_ARRAY, unconverted->texture); FramebufferManager::SetFramebuffer(entry->framebuffer); @@ -502,7 +502,7 @@ void TextureCache::ConvertTexture(TCacheEntryBase* _entry, TCacheEntryBase* _unc glUniform1f(s_palette_multiplier_uniform[format], unconverted->format == 0 ? 15.0f : 255.0f); glUniform4f(s_palette_copy_position_uniform[format], 0.0f, 0.0f, (float)unconverted->config.width, (float)unconverted->config.height); - glActiveTexture(GL_TEXTURE0 + 10); + glActiveTexture(GL_TEXTURE10); glBindTexture(GL_TEXTURE_BUFFER, s_palette_resolv_texture); OpenGL_BindAttributelessVAO(); diff --git a/Source/Core/VideoBackends/OGL/TextureConverter.cpp b/Source/Core/VideoBackends/OGL/TextureConverter.cpp index 9e4ac46e68..62c74e7b95 100644 --- a/Source/Core/VideoBackends/OGL/TextureConverter.cpp +++ b/Source/Core/VideoBackends/OGL/TextureConverter.cpp @@ -172,7 +172,7 @@ void Init() { glGenFramebuffers(2, s_texConvFrameBuffer); - glActiveTexture(GL_TEXTURE0 + 9); + glActiveTexture(GL_TEXTURE9); glGenTextures(1, &s_srcTexture); glBindTexture(GL_TEXTURE_2D, s_srcTexture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); @@ -225,7 +225,7 @@ static void EncodeToRamUsingShader(GLuint srcTexture, OpenGL_BindAttributelessVAO(); // set source texture - glActiveTexture(GL_TEXTURE0+9); + glActiveTexture(GL_TEXTURE9); glBindTexture(GL_TEXTURE_2D_ARRAY, srcTexture); if (linearFilter) @@ -374,7 +374,7 @@ void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTextur // activate source texture // set srcAddr as data for source texture - glActiveTexture(GL_TEXTURE0+9); + glActiveTexture(GL_TEXTURE9); glBindTexture(GL_TEXTURE_2D, s_srcTexture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, srcWidth / 2, srcHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, srcAddr);