Move canvas layer merge GL mappings to renderer gl
This commit is contained in:
@@ -1433,7 +1433,7 @@ void Canvas::layer_merge(int source_idx, int dest_idx) // m_layer index
|
||||
{
|
||||
// prepare common states
|
||||
glViewport(0, 0, m_width, m_height);
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(blend_state());
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
@@ -1450,9 +1450,9 @@ void Canvas::layer_merge(int source_idx, int dest_idx) // m_layer index
|
||||
m_layers[dest_idx]->face(i) = true;
|
||||
|
||||
// copy to tmp2 for layer blending
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
set_active_texture_unit(0);
|
||||
m_tex2[i].bind();
|
||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, m_width, m_height);
|
||||
glCopyTexSubImage2D(texture_2d_target(), 0, 0, 0, 0, 0, m_width, m_height);
|
||||
m_tex2[i].unbind();
|
||||
|
||||
m_sampler.bind(0);
|
||||
@@ -1470,13 +1470,13 @@ void Canvas::layer_merge(int source_idx, int dest_idx) // m_layer index
|
||||
ShaderManager::u_int(kShaderUniform::UseDual, false);
|
||||
ShaderManager::u_int(kShaderUniform::UsePattern, false);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
set_active_texture_unit(0);
|
||||
m_tex2[i].bind();
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
set_active_texture_unit(1);
|
||||
m_layers[source_idx]->rtt(i).bindTexture();
|
||||
m_plane.draw_fill();
|
||||
m_layers[source_idx]->rtt(i).unbindTexture();
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
set_active_texture_unit(0);
|
||||
m_tex2[i].unbind();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user