mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
gl: Track image destruction and remove handles from state tracker
- Handles are reused for different resources which can cause problems
This commit is contained in:
parent
d577cebd89
commit
8185bfe893
4 changed files with 39 additions and 11 deletions
|
|
@ -123,6 +123,13 @@ namespace gl
|
|||
m_format_class = format_class;
|
||||
}
|
||||
|
||||
texture::~texture()
|
||||
{
|
||||
gl::get_command_context()->unbind_texture(static_cast<GLenum>(m_target), m_id);
|
||||
glDeleteTextures(1, &m_id);
|
||||
m_id = GL_NONE;
|
||||
}
|
||||
|
||||
void texture::copy_from(const void* src, texture::format format, texture::type type, int level, const coord3u region, const pixel_unpack_settings& pixel_settings)
|
||||
{
|
||||
pixel_settings.apply();
|
||||
|
|
@ -260,6 +267,13 @@ namespace gl
|
|||
}
|
||||
}
|
||||
|
||||
texture_view::~texture_view()
|
||||
{
|
||||
gl::get_command_context()->unbind_texture(static_cast<GLenum>(m_target), m_id);
|
||||
glDeleteTextures(1, &m_id);
|
||||
m_id = GL_NONE;
|
||||
}
|
||||
|
||||
void texture_view::bind(gl::command_context& cmd, GLuint layer) const
|
||||
{
|
||||
cmd->bind_texture(layer, m_target, m_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue