mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
gl: fixed multiple textures binding
This commit is contained in:
parent
509bbddac1
commit
dbccf5fbad
3 changed files with 7 additions and 5 deletions
|
@ -325,13 +325,15 @@ void GLGSRender::end()
|
|||
for (int i = 0; i < rsx::limits::textures_count; ++i)
|
||||
{
|
||||
if (!textures[i].enabled())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int location;
|
||||
if (m_program->uniforms.has_location("tex" + std::to_string(i), &location))
|
||||
{
|
||||
__glcheck m_gl_textures[i].init(textures[i]);
|
||||
__glcheck m_program->uniforms.texture(location, i, gl::texture_view(gl::texture::target::texture2D, m_gl_textures[i].id()));
|
||||
__glcheck m_gl_textures[i].init(i, textures[i]);
|
||||
glProgramUniform1i(m_program->id(), location, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@ namespace rsx
|
|||
}
|
||||
|
||||
glGenTextures(1, &m_id);
|
||||
bind();
|
||||
}
|
||||
|
||||
int texture::gl_wrap(int wrap)
|
||||
|
@ -90,13 +89,14 @@ namespace rsx
|
|||
return 1.0f;
|
||||
}
|
||||
|
||||
void texture::init(rsx::texture& tex)
|
||||
void texture::init(int index, rsx::texture& tex)
|
||||
{
|
||||
if (!m_id)
|
||||
{
|
||||
create();
|
||||
}
|
||||
|
||||
glActiveTexture(GL_TEXTURE0 + index);
|
||||
bind();
|
||||
|
||||
const u32 texaddr = rsx::get_address(tex.offset(), tex.location());
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace rsx
|
|||
return (v << 2) | (v >> 4);
|
||||
}
|
||||
|
||||
void init(rsx::texture& tex);
|
||||
void init(int index, rsx::texture& tex);
|
||||
void bind();
|
||||
void unbind();
|
||||
void remove();
|
||||
|
|
Loading…
Add table
Reference in a new issue