1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Reintroduces the accumulation texture.

Disables automatic clearing of the texture target, as the profiler indicates the vector instantiation to be a huge time sink.
This commit is contained in:
Thomas Harte
2018-11-18 21:39:11 -05:00
parent 6496b6313c
commit 75bc0e451d
5 changed files with 67 additions and 11 deletions
+2 -3
View File
@@ -31,9 +31,8 @@ TextureTarget::TextureTarget(GLsizei width, GLsizei height, GLenum texture_unit,
glGenTextures(1, &texture_);
bind_texture();
// Upload a blank initial texture and set the user-supplied magnification filter.
std::vector<uint8_t> blank_buffer(static_cast<size_t>(expanded_width_ * expanded_height_ * 4), 0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, static_cast<GLsizei>(expanded_width_), static_cast<GLsizei>(expanded_height_), 0, GL_RGBA, GL_UNSIGNED_BYTE, blank_buffer.data());
// Set dimensions and set the user-supplied magnification filter.
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, static_cast<GLsizei>(expanded_width_), static_cast<GLsizei>(expanded_height_), 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);