Use texture for empty textures

This commit is contained in:
korenkonder
2024-06-26 13:39:29 +03:00
parent 7d04180b06
commit f635b81c4e
9 changed files with 48 additions and 51 deletions
+5 -5
View File
@@ -611,13 +611,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);
@@ -1360,9 +1360,9 @@ namespace spr {
static void draw_sprite_begin() {
gl_state_disable_blend(true);
gl_state_active_bind_texture_2d(0, rctx->empty_texture_2d, true);
gl_state_active_bind_texture_2d(0, rctx->empty_texture_2d->glid, true);
gl_state_bind_sampler(0, 0, true);
gl_state_active_bind_texture_2d(1, rctx->empty_texture_2d, true);
gl_state_active_bind_texture_2d(1, rctx->empty_texture_2d->glid, true);
gl_state_bind_sampler(1, 0, true);
gl_state_bind_sampler(7, 0, true);
gl_state_set_blend_func_separate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO, true);