Skip to content

Commit

Permalink
Fix the Shader, Texture and Bindless sample
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Nov 2, 2024
1 parent f98fdbc commit 783ac34
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Bindless/Sources/texture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &parameters);

kong_set_render_pipeline(&list, &pipeline);
Expand Down
2 changes: 1 addition & 1 deletion Kinc
Submodule Kinc updated 26 files
+3 −3 .github/workflows/linux-arm-opengl.yml
+1 −1 Backends/Graphics4/G4onG5/Sources/kinc/backend/graphics4/compute.c.h
+6 −2 Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/buffer.cpp
+65 −12 Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/commandlist.cpp
+5 −2 Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/commandlist_functions.h
+12 −0 Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/commandlist_structs.h
+4 −5 Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/descriptorset.cpp
+2 −3 Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/descriptorset_functions.h
+7 −0 Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/descriptorset_structs.h
+44 −1 Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/device.cpp
+2 −1 Backends/Graphics5/Direct3D12/Sources/kope/direct3d12/device_functions.h
+1 −1 Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/compute.m.h
+27 −21 Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/raytrace.m.h
+6 −1 Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/sampler.m.h
+0 −36 Backends/System/POSIX/Sources/kinc/backend/atomic.h
+18 −3 Backends/System/iOS/Sources/kinc/backend/GLView.m.h
+2 −52 Backends/System/iOS/Sources/kinc/backend/KoreAppDelegate.m.h
+11 −11 Backends/System/macOS/Sources/kinc/backend/BasicOpenGLView.m.h
+1 −1 Backends/System/macOS/Sources/kinc/backend/system.m.h
+2 −2 Sources/kinc/graphics1/graphics.c
+2 −2 Sources/kope/graphics5/commandlist.h
+1 −1 Tools/linux_arm
+1 −1 Tools/linux_arm64
+1 −1 Tools/linux_x64
+1 −1 Tools/macos
+1 −1 Tools/windows_x64
8 changes: 6 additions & 2 deletions Shader/Sources/shader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &parameters);

kong_set_render_pipeline(&list, &pipeline);
Expand Down Expand Up @@ -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, &params, &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;
Expand Down
6 changes: 5 additions & 1 deletion Texture/Sources/texture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &parameters);

kong_set_render_pipeline(&list, &pipeline);
Expand Down

0 comments on commit 783ac34

Please sign in to comment.