remove async task from texture and sampler binding, but add render thread assert
This commit is contained in:
@@ -222,6 +222,7 @@ bool RTT::create(int width, int height, int tex/* = -1*/, GLint internal_format,
|
||||
|
||||
void RTT::bindFramebuffer()
|
||||
{
|
||||
assert(App::I->is_render_thread());
|
||||
#ifdef _DEBUG
|
||||
if (bound)
|
||||
{
|
||||
@@ -240,6 +241,7 @@ void RTT::bindFramebuffer()
|
||||
|
||||
void RTT::unbindFramebuffer()
|
||||
{
|
||||
assert(App::I->is_render_thread());
|
||||
if (!bound)
|
||||
return;
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, oldDFboID);
|
||||
@@ -251,12 +253,14 @@ void RTT::unbindFramebuffer()
|
||||
|
||||
void RTT::clear(glm::vec4 color)
|
||||
{
|
||||
assert(App::I->is_render_thread());
|
||||
glClearColor(color.r, color.g, color.b, color.a);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void RTT::clear_mask(glm::bool4 mask, glm::vec4 color)
|
||||
{
|
||||
assert(App::I->is_render_thread());
|
||||
// save old state
|
||||
std::array<GLboolean, 4> old_mask;
|
||||
glGetBooleanv(GL_COLOR_WRITEMASK, old_mask.data());
|
||||
@@ -331,11 +335,13 @@ float * RTT::createBufferFloat()
|
||||
|
||||
void RTT::bindTexture()
|
||||
{
|
||||
assert(App::I->is_render_thread());
|
||||
glBindTexture(GL_TEXTURE_2D, texID);
|
||||
}
|
||||
|
||||
void RTT::unbindTexture()
|
||||
{
|
||||
assert(App::I->is_render_thread());
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user