mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 22:11:26 +12: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)
|
for (int i = 0; i < rsx::limits::textures_count; ++i)
|
||||||
{
|
{
|
||||||
if (!textures[i].enabled())
|
if (!textures[i].enabled())
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
int location;
|
int location;
|
||||||
if (m_program->uniforms.has_location("tex" + std::to_string(i), &location))
|
if (m_program->uniforms.has_location("tex" + std::to_string(i), &location))
|
||||||
{
|
{
|
||||||
__glcheck m_gl_textures[i].init(textures[i]);
|
__glcheck m_gl_textures[i].init(i, textures[i]);
|
||||||
__glcheck m_program->uniforms.texture(location, i, gl::texture_view(gl::texture::target::texture2D, m_gl_textures[i].id()));
|
glProgramUniform1i(m_program->id(), location, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,6 @@ namespace rsx
|
||||||
}
|
}
|
||||||
|
|
||||||
glGenTextures(1, &m_id);
|
glGenTextures(1, &m_id);
|
||||||
bind();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int texture::gl_wrap(int wrap)
|
int texture::gl_wrap(int wrap)
|
||||||
|
@ -90,13 +89,14 @@ namespace rsx
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void texture::init(rsx::texture& tex)
|
void texture::init(int index, rsx::texture& tex)
|
||||||
{
|
{
|
||||||
if (!m_id)
|
if (!m_id)
|
||||||
{
|
{
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glActiveTexture(GL_TEXTURE0 + index);
|
||||||
bind();
|
bind();
|
||||||
|
|
||||||
const u32 texaddr = rsx::get_address(tex.offset(), tex.location());
|
const u32 texaddr = rsx::get_address(tex.offset(), tex.location());
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace rsx
|
||||||
return (v << 2) | (v >> 4);
|
return (v << 2) | (v >> 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(rsx::texture& tex);
|
void init(int index, rsx::texture& tex);
|
||||||
void bind();
|
void bind();
|
||||||
void unbind();
|
void unbind();
|
||||||
void remove();
|
void remove();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue