Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ltw/src/main/tinywrapper/egl.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ void build_extension_string(context_t* context) {
// Required by Iris. Indexed variants are available since ES3.2 or with OES/EXT_draw_buffers_indexed extensions
if(context->blending.available)
add_extra_extension(context, &length, "GL_ARB_draw_buffers_blend");
add_extra_extension(context, &length, "GL_ARB_clear_texture");
// Used by Minecraft for the GPU usage counter (see Blaze3D TimerQuery)
add_extra_extension(context, &length, "GL_ARB_timer_query");
// More extensions are possible, but will need way more wraps and tracking.
Expand Down
14 changes: 14 additions & 0 deletions ltw/src/main/tinywrapper/of_buffer_copier.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,19 @@ void glCopyTexSubImage2D(GLenum target,
texture_blit_framebuffer(target, level, xoffset, yoffset, x, y, width, height, true);
}
}
}

void glClearTexImage(GLuint texture,
GLint level,
GLenum format,
GLenum type,
const void * data) {
if(!current_context) return;
framebuffer_copier_t* copier = &current_context->framebuffer_copier;
if(!copier->ready) return;

es3_functions.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, copier->tempfb);
es3_functions.glFramebufferTexture2D(copier->tempfb, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, level);
es3_functions.glClearBufferiv(GL_COLOR, GL_COLOR_ATTACHMENT0, data);
es3_functions.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}