remove async task from texture and sampler binding, but add render thread assert
This commit is contained in:
@@ -118,11 +118,13 @@ void Texture2D::destroy()
|
||||
|
||||
void Texture2D::bind() const
|
||||
{
|
||||
assert(App::I->is_render_thread());
|
||||
glBindTexture(GL_TEXTURE_2D, m_tex);
|
||||
}
|
||||
|
||||
void Texture2D::unbind() const
|
||||
{
|
||||
assert(App::I->is_render_thread());
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
@@ -201,21 +203,17 @@ void Sampler::set_border(glm::vec4 rgba)
|
||||
}
|
||||
void Sampler::bind(int unit) const
|
||||
{
|
||||
App::I->render_task([=]
|
||||
{
|
||||
current_unit = unit;
|
||||
assert(App::I->is_render_thread());
|
||||
current_unit = unit;
|
||||
#if USE_SAMPLER
|
||||
glBindSampler(unit, id);
|
||||
glBindSampler(unit, id);
|
||||
#endif // USE_SAMPLER
|
||||
});
|
||||
}
|
||||
void Sampler::unbind()
|
||||
{
|
||||
App::I->render_task([=]
|
||||
{
|
||||
assert(App::I->is_render_thread());
|
||||
#if USE_SAMPLER
|
||||
glBindSampler(current_unit, 0);
|
||||
glBindSampler(current_unit, 0);
|
||||
#endif // USE_SAMPLER
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user