OGL: use GL_TEXTURE* constants
This commit is contained in:
parent
a26cf63783
commit
285ac34bf3
|
@ -65,7 +65,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||||
// The distinction becomes important for certain operations, i.e. the
|
// The distinction becomes important for certain operations, i.e. the
|
||||||
// alpha channel should be ignored if the EFB does not have one.
|
// alpha channel should be ignored if the EFB does not have one.
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + 9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
|
|
||||||
GLuint glObj[3];
|
GLuint glObj[3];
|
||||||
glGenTextures(3, glObj);
|
glGenTextures(3, glObj);
|
||||||
|
@ -540,7 +540,7 @@ void FramebufferManager::ReinterpretPixelData(unsigned int convtype)
|
||||||
FramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, m_textureType, m_efbColor, 0);
|
FramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, m_textureType, m_efbColor, 0);
|
||||||
|
|
||||||
glViewport(0,0, m_targetWidth, m_targetHeight);
|
glViewport(0,0, m_targetWidth, m_targetHeight);
|
||||||
glActiveTexture(GL_TEXTURE0 + 9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
glBindTexture(m_textureType, src_texture);
|
glBindTexture(m_textureType, src_texture);
|
||||||
|
|
||||||
m_pixel_format_shaders[convtype ? 1 : 0].Bind();
|
m_pixel_format_shaders[convtype ? 1 : 0].Bind();
|
||||||
|
@ -593,7 +593,7 @@ XFBSourceBase* FramebufferManager::CreateXFBSource(unsigned int target_width, un
|
||||||
|
|
||||||
glGenTextures(1, &texture);
|
glGenTextures(1, &texture);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + 9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
glBindTexture(GL_TEXTURE_2D_ARRAY, texture);
|
glBindTexture(GL_TEXTURE_2D_ARRAY, texture);
|
||||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, 0);
|
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);
|
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, target_width, target_height, layers, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
|
||||||
|
|
|
@ -152,7 +152,7 @@ void OpenGLPostProcessing::BlitFromTexture(TargetRectangle src, TargetRectangle
|
||||||
m_config.SetDirty(false);
|
m_config.SetDirty(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0+9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
glBindTexture(GL_TEXTURE_2D_ARRAY, src_texture);
|
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_MAG_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
|
|
@ -142,7 +142,7 @@ RasterFont::RasterFont()
|
||||||
{
|
{
|
||||||
// generate the texture
|
// generate the texture
|
||||||
glGenTextures(1, &texture);
|
glGenTextures(1, &texture);
|
||||||
glActiveTexture(GL_TEXTURE0+8);
|
glActiveTexture(GL_TEXTURE8);
|
||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
std::vector<u32> texture_data(CHAR_WIDTH * CHAR_COUNT * CHAR_HEIGHT);
|
std::vector<u32> texture_data(CHAR_WIDTH * CHAR_COUNT * CHAR_HEIGHT);
|
||||||
for (int y = 0; y < CHAR_HEIGHT; y++)
|
for (int y = 0; y < CHAR_HEIGHT; y++)
|
||||||
|
|
|
@ -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 width = std::max(virtual_width >> level, 1);
|
||||||
int height = std::max(virtual_height >> level, 1);
|
int height = std::max(virtual_height >> level, 1);
|
||||||
std::vector<u8> data(width * height * 4);
|
std::vector<u8> data(width * height * 4);
|
||||||
glActiveTexture(GL_TEXTURE0+9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
glBindTexture(textarget, tex);
|
glBindTexture(textarget, tex);
|
||||||
glGetTexImage(textarget, level, GL_RGBA, GL_UNSIGNED_BYTE, data.data());
|
glGetTexImage(textarget, level, GL_RGBA, GL_UNSIGNED_BYTE, data.data());
|
||||||
glBindTexture(textarget, 0);
|
glBindTexture(textarget, 0);
|
||||||
|
@ -117,7 +117,7 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntryConf
|
||||||
{
|
{
|
||||||
TCacheEntry* entry = new TCacheEntry(config);
|
TCacheEntry* entry = new TCacheEntry(config);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0+9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
glBindTexture(GL_TEXTURE_2D_ARRAY, entry->texture);
|
glBindTexture(GL_TEXTURE_2D_ARRAY, entry->texture);
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, config.levels - 1);
|
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",
|
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);
|
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);
|
glBindTexture(GL_TEXTURE_2D_ARRAY, texture);
|
||||||
|
|
||||||
if (expanded_width != width)
|
if (expanded_width != width)
|
||||||
|
@ -176,7 +176,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
|
||||||
|
|
||||||
OpenGL_BindAttributelessVAO();
|
OpenGL_BindAttributelessVAO();
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0+9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
glBindTexture(GL_TEXTURE_2D_ARRAY, read_texture);
|
glBindTexture(GL_TEXTURE_2D_ARRAY, read_texture);
|
||||||
|
|
||||||
glViewport(0, 0, config.width, config.height);
|
glViewport(0, 0, config.width, config.height);
|
||||||
|
@ -487,7 +487,7 @@ void TextureCache::ConvertTexture(TCacheEntryBase* _entry, TCacheEntryBase* _unc
|
||||||
TCacheEntry* entry = (TCacheEntry*) _entry;
|
TCacheEntry* entry = (TCacheEntry*) _entry;
|
||||||
TCacheEntry* unconverted = (TCacheEntry*) _unconverted;
|
TCacheEntry* unconverted = (TCacheEntry*) _unconverted;
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + 9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
glBindTexture(GL_TEXTURE_2D_ARRAY, unconverted->texture);
|
glBindTexture(GL_TEXTURE_2D_ARRAY, unconverted->texture);
|
||||||
|
|
||||||
FramebufferManager::SetFramebuffer(entry->framebuffer);
|
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);
|
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);
|
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);
|
glBindTexture(GL_TEXTURE_BUFFER, s_palette_resolv_texture);
|
||||||
|
|
||||||
OpenGL_BindAttributelessVAO();
|
OpenGL_BindAttributelessVAO();
|
||||||
|
|
|
@ -172,7 +172,7 @@ void Init()
|
||||||
{
|
{
|
||||||
glGenFramebuffers(2, s_texConvFrameBuffer);
|
glGenFramebuffers(2, s_texConvFrameBuffer);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0 + 9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
glGenTextures(1, &s_srcTexture);
|
glGenTextures(1, &s_srcTexture);
|
||||||
glBindTexture(GL_TEXTURE_2D, s_srcTexture);
|
glBindTexture(GL_TEXTURE_2D, s_srcTexture);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
|
||||||
|
@ -225,7 +225,7 @@ static void EncodeToRamUsingShader(GLuint srcTexture,
|
||||||
OpenGL_BindAttributelessVAO();
|
OpenGL_BindAttributelessVAO();
|
||||||
|
|
||||||
// set source texture
|
// set source texture
|
||||||
glActiveTexture(GL_TEXTURE0+9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
glBindTexture(GL_TEXTURE_2D_ARRAY, srcTexture);
|
glBindTexture(GL_TEXTURE_2D_ARRAY, srcTexture);
|
||||||
|
|
||||||
if (linearFilter)
|
if (linearFilter)
|
||||||
|
@ -374,7 +374,7 @@ void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTextur
|
||||||
|
|
||||||
// activate source texture
|
// activate source texture
|
||||||
// set srcAddr as data for source texture
|
// set srcAddr as data for source texture
|
||||||
glActiveTexture(GL_TEXTURE0+9);
|
glActiveTexture(GL_TEXTURE9);
|
||||||
glBindTexture(GL_TEXTURE_2D, s_srcTexture);
|
glBindTexture(GL_TEXTURE_2D, s_srcTexture);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, srcWidth / 2, srcHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, srcAddr);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, srcWidth / 2, srcHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, srcAddr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue