From 783ac3422187a09de310bacb6e69609c0d460b24 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Sat, 2 Nov 2024 21:08:33 +0100 Subject: [PATCH] Fix the Shader, Texture and Bindless sample --- Bindless/Sources/texture.c | 6 +++++- Kinc | 2 +- Shader/Sources/shader.c | 8 ++++++-- Texture/Sources/texture.c | 6 +++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Bindless/Sources/texture.c b/Bindless/Sources/texture.c index 2ef1a89..3149aeb 100644 --- a/Bindless/Sources/texture.c +++ b/Bindless/Sources/texture.c @@ -75,7 +75,11 @@ static void update(void *data) { clear_color.b = 0.0f; clear_color.a = 1.0f; parameters.color_attachments[0].clear_value = clear_color; - parameters.color_attachments[0].texture = framebuffer; + parameters.color_attachments[0].texture.texture = framebuffer; + parameters.color_attachments[0].texture.array_layer_count = 1; + parameters.color_attachments[0].texture.mip_level_count = 1; + parameters.color_attachments[0].texture.format = KOPE_G5_TEXTURE_FORMAT_BGRA8_UNORM; + parameters.color_attachments[0].texture.dimension = KOPE_G5_TEXTURE_VIEW_DIMENSION_2D; kope_g5_command_list_begin_render_pass(&list, ¶meters); kong_set_render_pipeline(&list, &pipeline); diff --git a/Kinc b/Kinc index 3a7eea9..68ab8ff 160000 --- a/Kinc +++ b/Kinc @@ -1 +1 @@ -Subproject commit 3a7eea980d1205953d2131e2ea8e251a27821d9c +Subproject commit 68ab8ff0127326ca9bc4293da62ac70a1d7e3436 diff --git a/Shader/Sources/shader.c b/Shader/Sources/shader.c index 640c5c3..def3eda 100644 --- a/Shader/Sources/shader.c +++ b/Shader/Sources/shader.c @@ -31,7 +31,11 @@ static void update(void *data) { clear_color.b = 0.0f; clear_color.a = 1.0f; parameters.color_attachments[0].clear_value = clear_color; - parameters.color_attachments[0].texture = framebuffer; + parameters.color_attachments[0].texture.texture = framebuffer; + parameters.color_attachments[0].texture.array_layer_count = 1; + parameters.color_attachments[0].texture.mip_level_count = 1; + parameters.color_attachments[0].texture.format = KOPE_G5_TEXTURE_FORMAT_BGRA8_UNORM; + parameters.color_attachments[0].texture.dimension = KOPE_G5_TEXTURE_VIEW_DIMENSION_2D; kope_g5_command_list_begin_render_pass(&list, ¶meters); kong_set_render_pipeline(&list, &pipeline); @@ -86,7 +90,7 @@ int kickstart(int argc, char **argv) { params.usage_flags = KOPE_G5_BUFFER_USAGE_INDEX | KOPE_G5_BUFFER_USAGE_CPU_WRITE; kope_g5_device_create_buffer(&device, ¶ms, &indices); { - uint16_t *i = (uint16_t *)kope_g5_buffer_lock(&indices); + uint16_t *i = (uint16_t *)kope_g5_buffer_lock_all(&indices); i[0] = 0; i[1] = 1; i[2] = 2; diff --git a/Texture/Sources/texture.c b/Texture/Sources/texture.c index dcc4d43..9b963a7 100644 --- a/Texture/Sources/texture.c +++ b/Texture/Sources/texture.c @@ -68,7 +68,11 @@ static void update(void *data) { clear_color.b = 0.0f; clear_color.a = 1.0f; parameters.color_attachments[0].clear_value = clear_color; - parameters.color_attachments[0].texture = framebuffer; + parameters.color_attachments[0].texture.texture = framebuffer; + parameters.color_attachments[0].texture.array_layer_count = 1; + parameters.color_attachments[0].texture.mip_level_count = 1; + parameters.color_attachments[0].texture.format = KOPE_G5_TEXTURE_FORMAT_BGRA8_UNORM; + parameters.color_attachments[0].texture.dimension = KOPE_G5_TEXTURE_VIEW_DIMENSION_2D; kope_g5_command_list_begin_render_pass(&list, ¶meters); kong_set_render_pipeline(&list, &pipeline);