From 3535a185dff92dc37fb2d3279cbbfe17d58e2239 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Mon, 14 Oct 2024 12:16:23 +0300 Subject: [PATCH] don't use depth range hack in rect case --- src/rendering/twn_draw.c | 2 -- src/rendering/twn_gl_any_rendering.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rendering/twn_draw.c b/src/rendering/twn_draw.c index 57c9fff..1732760 100644 --- a/src/rendering/twn_draw.c +++ b/src/rendering/twn_draw.c @@ -202,8 +202,6 @@ static void render_2d(void) { const struct QuadBatch batch = collect_rect_batch(current, render_queue_len - i); - /* TODO: what's even the point? just use OR_EQUAL comparison */ - set_depth_range((double)batch_count / UINT16_MAX, 1.0); render_rect_batch(current, batch); i += batch.size - 1; ++batch_count; diff --git a/src/rendering/twn_gl_any_rendering.c b/src/rendering/twn_gl_any_rendering.c index 8790ef3..77a7138 100644 --- a/src/rendering/twn_gl_any_rendering.c +++ b/src/rendering/twn_gl_any_rendering.c @@ -74,6 +74,9 @@ void clear_draw_buffer(void) { /* TODO: don't clear color when skybox is applied? */ /* for that window should match framebuffer */ /* also it is driver dependent, from what i can gather */ + /* INFO: also, based on below, driver might prefer it staying this way */ + /* https://gamedev.stackexchange.com/questions/90344/render-with-const-depth-value */ + /* we could optionally load ARB_invalidate_subdata extension if it's available instead */ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);