Use texture for empty textures

This commit is contained in:
korenkonder
2024-06-26 13:39:33 +03:00
parent 2bbefe7e8d
commit 4e81ce6fa8
8 changed files with 46 additions and 48 deletions
+5 -5
View File
@@ -894,13 +894,13 @@ namespace spr {
gl_state_bind_sampler(1, j.sampler);
}
else if (!gl_state.texture_binding_2d[1])
gl_state_active_bind_texture_2d(1, rctx->empty_texture_2d);
gl_state_active_bind_texture_2d(1, rctx->empty_texture_2d->glid);
}
else {
if (!gl_state.texture_binding_2d[0])
gl_state_active_bind_texture_2d(0, rctx->empty_texture_2d);
gl_state_active_bind_texture_2d(0, rctx->empty_texture_2d->glid);
if (!gl_state.texture_binding_2d[1])
gl_state_active_bind_texture_2d(1, rctx->empty_texture_2d);
gl_state_active_bind_texture_2d(1, rctx->empty_texture_2d->glid);
}
shaders_ft.set(j.shader);
@@ -1843,9 +1843,9 @@ namespace spr {
static void draw_sprite_begin(render_context* rctx) {
gl_state_disable_blend();
gl_state_active_bind_texture_2d(0, rctx->empty_texture_2d);
gl_state_active_bind_texture_2d(0, rctx->empty_texture_2d->glid);
gl_state_bind_sampler(0, 0);
gl_state_active_bind_texture_2d(1, rctx->empty_texture_2d);
gl_state_active_bind_texture_2d(1, rctx->empty_texture_2d->glid);
gl_state_bind_sampler(1, 0);
gl_state_bind_sampler(7, 0);
gl_state_set_blend_func_separate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO);