From a2476a39a6a647c2d963de8fa442ba29d9d80985 Mon Sep 17 00:00:00 2001 From: Katajisto Date: Sun, 28 Sep 2025 22:50:03 +0300 Subject: [PATCH] work on fix to weird issues --- src/editor/textureDebugger.jai | 4 ---- src/main.jai | 7 ++++++- src/pipelines.jai | 10 ++++++++-- src/ui/ui.jai | 1 - 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/editor/textureDebugger.jai b/src/editor/textureDebugger.jai index e394b9f..c7d9110 100644 --- a/src/editor/textureDebugger.jai +++ b/src/editor/textureDebugger.jai @@ -26,10 +26,6 @@ draw_subwindow_texture_debug :: (state: *GR.Subwindow_State, r: GR.Rect, data: * #scope_export draw_texture_debug :: () { - uiTex := Ui_Texture.{gPipelines.plane.bind.images[0]}; - set_shader_for_images(*uiTex); - immediate_quad(.{0, 0}, .{0 + 500, 0}, .{0 + 500, 0 + 500}, .{0, 0 + 500}); - set_shader_for_color(); } toggle_texdebug :: () { diff --git a/src/main.jai b/src/main.jai index 7cc8789..f78ed9f 100644 --- a/src/main.jai +++ b/src/main.jai @@ -158,7 +158,12 @@ frame :: () { draw_editor(); if !in_editor_view then game_draw(); - draw_texture_debug(); + + uiTex := Ui_Texture.{gPipelines.plane.bind.images[0]}; + set_shader_for_images(*uiTex); + r := GR.Rect.{0,0,500,500}; + immediate_quad(.{r.x, r.y}, .{r.x + r.w, r.y}, .{r.x + r.w, r.y + r.h}, .{r.x, r.y + r.h}); + set_shader_for_color(); ui_pass(); sg_end_pass(); diff --git a/src/pipelines.jai b/src/pipelines.jai index fcaa30e..78d3f66 100644 --- a/src/pipelines.jai +++ b/src/pipelines.jai @@ -292,10 +292,15 @@ create_plane_pipeline_reflection_image :: (binding: *sg_bindings) { height = h, pixel_format = .RGBA8, render_target = true, - sample_count = 1, + }; + depth_desc := sg_image_desc.{ + width = w, + height = h, + pixel_format = .DEPTH, + render_target = true, }; binding.images[0] = sg_make_image(*img_desc); - binding.images[1] = sg_make_image(*img_desc); + binding.images[1] = sg_make_image(*depth_desc); } create_plane_pipeline :: () { @@ -310,6 +315,7 @@ create_plane_pipeline :: () { pipeline.depth = .{ write_enabled = true, compare = .LESS_EQUAL, + pixel_format = .DEPTH, }; color_state := sg_color_target_state.{ diff --git a/src/ui/ui.jai b/src/ui/ui.jai index 9f10fc8..4a31e61 100644 --- a/src/ui/ui.jai +++ b/src/ui/ui.jai @@ -141,7 +141,6 @@ set_shader_for_color :: (enable_blend := false) { set_shader_for_images :: (texture: *Ui_Texture) { - print("Setting shader for images!!!\n"); arb_tri_command_add(.{ type = .SET_TEXTURE, texture = texture