use glBindFragDataLocation instead of glDrawBuffer

This commit is contained in:
degasus 2013-01-17 11:16:12 +01:00
parent b778b86e26
commit 3054d36534
3 changed files with 3 additions and 8 deletions

View file

@ -108,6 +108,8 @@ void ProgramShaderCache::SetProgramBindings ( ProgramShaderCache::PCacheEntry& e
glBindFragDataLocationIndexed(entry.prog_id, 0, 0, "ocol0");
glBindFragDataLocationIndexed(entry.prog_id, 0, 1, "ocol1");
}
else
glBindFragDataLocation(entry.prog_id, 0, "ocol0");
// Need to set some attribute locations
glBindAttribLocation(entry.prog_id, SHADER_POSITION_ATTRIB, "rawpos");

View file

@ -369,9 +369,6 @@ Renderer::Renderer()
if (GL_REPORT_ERROR() != GL_NO_ERROR)
bSuccess = false;
if (glDrawBuffers == NULL && !GLEW_ARB_draw_buffers)
glDrawBuffers = glDrawBuffersARB;
if (!GLEW_ARB_texture_non_power_of_two)
WARN_LOG(VIDEO, "ARB_texture_non_power_of_two not supported.");
@ -395,8 +392,6 @@ Renderer::Renderer()
g_framebuffer_manager = new FramebufferManager(s_target_width, s_target_height,
s_MSAASamples, s_MSAACoverageSamples);
glDrawBuffer(GL_COLOR_ATTACHMENT0);
if (GL_REPORT_ERROR() != GL_NO_ERROR)
bSuccess = false;
@ -1339,7 +1334,6 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
delete g_framebuffer_manager;
g_framebuffer_manager = new FramebufferManager(s_target_width, s_target_height,
s_MSAASamples, s_MSAACoverageSamples);
glDrawBuffer(GL_COLOR_ATTACHMENT0);
}
}

View file

@ -294,8 +294,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
GL_REPORT_FBO_ERROR();
GL_REPORT_ERRORD();
glDrawBuffer(GL_COLOR_ATTACHMENT0);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, 0);
glBindTexture(GL_TEXTURE_RECTANGLE, read_texture);