From 36eb49b497a3c5f652d3c00e234bd883965538b6 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Thu, 5 Oct 2023 17:40:21 +0200 Subject: [PATCH 01/27] Update Kong and kmake --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index 2aca0409f..67a8860e2 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit 2aca0409f7529bdbcf375d3915a161419cd48696 +Subproject commit 67a8860e28f9dacf19a1b1942cfb3d3c6f41771c diff --git a/Tools/linux_arm b/Tools/linux_arm index 12ca7aba5..2e9fad92d 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 12ca7aba5d076a2a163b6f62fcf2148cfa8c32fc +Subproject commit 2e9fad92d5800ff73f3826eda68eecd92c3cd5c4 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index a9c98df07..95aa02c36 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit a9c98df07f6cd5f17c256a1cd00af1a05072d032 +Subproject commit 95aa02c363793e820a37f494565974303d86890c diff --git a/Tools/linux_x64 b/Tools/linux_x64 index 2a0d561ed..86cd1c06e 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit 2a0d561ed29fc4ae1cb1d9df6ed4db07f53fbb59 +Subproject commit 86cd1c06eeb484f6172a5431d3b208661e96d70d diff --git a/Tools/macos b/Tools/macos index 5f643768a..d8815e941 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit 5f643768ad1bf0626d9c876228b9bff21d4dc951 +Subproject commit d8815e9411dc4ad7e50c0be47efdfedf5f542d44 diff --git a/Tools/windows_x64 b/Tools/windows_x64 index d992e41db..e51fe0cc9 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit d992e41db7ee62db7e1976fa4de4d1fe352d0603 +Subproject commit e51fe0cc9b38e524c94bb514a1df8e6ca8dac9fe From 708b5b46c2d11c9e5fed260a408d18c8d80cc169 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Thu, 5 Oct 2023 17:41:38 +0200 Subject: [PATCH 02/27] Set the USE parameters for emscripten --- kfile.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kfile.js b/kfile.js index b7e113970..8a79a0793 100644 --- a/kfile.js +++ b/kfile.js @@ -299,6 +299,7 @@ else if (platform === Platform.Emscripten) { project.addDefine('KORE_EMSCRIPTEN'); //project.addLib('websocket.js -sPROXY_POSIX_SOCKETS -sUSE_PTHREADS -sPROXY_TO_PTHREAD'); addBackend('System/Emscripten'); + project.addLib('USE_GLFW=2'); if (graphics === GraphicsApi.WebGPU) { g4 = true; g5 = true; @@ -311,6 +312,9 @@ else if (platform === Platform.Emscripten) { project.addExclude('Backends/Graphics4/OpenGL/Sources/GL/**'); project.addDefine('KORE_OPENGL'); project.addDefine('KORE_OPENGL_ES'); + if (Options.kong) { + project.addLib('USE_WEBGL2=1'); + } } else { throw new Error('Graphics API ' + graphics + ' is not available for Emscripten.'); From 3cdf439145c46e271150872c83c983f981f3ed9c Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Thu, 5 Oct 2023 17:41:53 +0200 Subject: [PATCH 03/27] Fix Kong compilation for D3D9 --- .../kinc/backend/graphics4/Direct3D9.cpp | 10 ++++++ .../kinc/backend/graphics4/constantbuffer.cpp | 34 +++++++++++++++++++ .../kinc/backend/graphics4/constantbuffer.h | 11 ++++++ .../kinc/backend/graphics4/rendertarget.cpp | 12 +++++++ .../kinc/backend/graphics4/texture.cpp | 8 +++++ 5 files changed, 75 insertions(+) create mode 100644 Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/constantbuffer.cpp create mode 100644 Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/constantbuffer.h diff --git a/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/Direct3D9.cpp b/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/Direct3D9.cpp index 05e0694c0..d8083637b 100644 --- a/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/Direct3D9.cpp +++ b/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/Direct3D9.cpp @@ -719,11 +719,19 @@ void kinc_g4_set_index_buffer(kinc_g4_index_buffer_t *buffer) { kinc_internal_g4_index_buffer_set(buffer); } +#ifdef KINC_KONG +void kinc_internal_texture_set(kinc_g4_texture_t *texture, uint32_t unit); + +void kinc_g4_set_texture(uint32_t unit, struct kinc_g4_texture *texture) { + kinc_internal_texture_set(texture, unit); +} +#else void kinc_internal_texture_set(kinc_g4_texture_t *texture, kinc_g4_texture_unit_t unit); void kinc_g4_set_texture(kinc_g4_texture_unit_t unit, struct kinc_g4_texture *texture) { kinc_internal_texture_set(texture, unit); } +#endif void kinc_g4_set_image_texture(kinc_g4_texture_unit_t unit, struct kinc_g4_texture *texture) {} @@ -829,3 +837,5 @@ bool kinc_g4_supports_non_pow2_textures() { bool kinc_g4_render_targets_inverted_y(void) { return false; } + +void kinc_g4_set_constant_buffer(uint32_t id, struct kinc_g4_constant_buffer *buffer) {} diff --git a/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/constantbuffer.cpp b/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/constantbuffer.cpp new file mode 100644 index 000000000..b5e8a1dc3 --- /dev/null +++ b/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/constantbuffer.cpp @@ -0,0 +1,34 @@ +#ifdef KINC_KONG + +#include + +#include "Direct3D9.h" + +void kinc_g4_constant_buffer_init(kinc_g4_constant_buffer *buffer, size_t size) { + buffer->impl.size = size; + buffer->impl.last_start = 0; + buffer->impl.last_size = size; +} + +void kinc_g4_constant_buffer_destroy(kinc_g4_constant_buffer *buffer) {} + +uint8_t *kinc_g4_constant_buffer_lock_all(kinc_g4_constant_buffer *buffer) { + return NULL; +} + +uint8_t *kinc_g4_constant_buffer_lock(kinc_g4_constant_buffer *buffer, size_t start, size_t size) { + buffer->impl.last_start = start; + buffer->impl.last_size = size; + + return NULL; +} + +void kinc_g4_constant_buffer_unlock_all(kinc_g4_constant_buffer *buffer) {} + +void kinc_g4_constant_buffer_unlock(kinc_g4_constant_buffer *buffer, size_t count) {} + +size_t kinc_g4_constant_buffer_size(kinc_g4_constant_buffer *buffer) { + return buffer->impl.size; +} + +#endif diff --git a/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/constantbuffer.h b/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/constantbuffer.h new file mode 100644 index 000000000..ac7b3ace3 --- /dev/null +++ b/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/constantbuffer.h @@ -0,0 +1,11 @@ +#pragma once + +#ifdef KINC_KONG + +typedef struct kinc_g4_constant_buffer_impl { + size_t size; + size_t last_start; + size_t last_size; +} kinc_g4_constant_buffer_impl; + +#endif diff --git a/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/rendertarget.cpp b/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/rendertarget.cpp index 391f15235..9f7ed569a 100644 --- a/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/rendertarget.cpp +++ b/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/rendertarget.cpp @@ -90,6 +90,17 @@ void kinc_g4_render_target_destroy(kinc_g4_render_target_t *renderTarget) { } } +#ifdef KINC_KONG +void kinc_g4_render_target_use_color_as_texture(kinc_g4_render_target_t *renderTarget, uint32_t unit) { + if (renderTarget->impl.antialiasing) { + IDirect3DSurface9 *surface; + renderTarget->impl.colorTexture->GetSurfaceLevel(0, &surface); + kinc_microsoft_affirm(device->StretchRect(renderTarget->impl.colorSurface, nullptr, surface, nullptr, D3DTEXF_NONE)); + surface->Release(); + } + device->SetTexture(unit, renderTarget->isDepthAttachment ? renderTarget->impl.depthTexture : renderTarget->impl.colorTexture); +} +#else void kinc_g4_render_target_use_color_as_texture(kinc_g4_render_target_t *renderTarget, kinc_g4_texture_unit_t unit) { if (renderTarget->impl.antialiasing) { IDirect3DSurface9 *surface; @@ -100,6 +111,7 @@ void kinc_g4_render_target_use_color_as_texture(kinc_g4_render_target_t *renderT device->SetTexture(unit.stages[KINC_G4_SHADER_TYPE_FRAGMENT], renderTarget->isDepthAttachment ? renderTarget->impl.depthTexture : renderTarget->impl.colorTexture); } +#endif void kinc_g4_render_target_set_depth_stencil_from(kinc_g4_render_target_t *renderTarget, kinc_g4_render_target_t *source) { renderTarget->impl.depthTexture = source->impl.depthTexture; diff --git a/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/texture.cpp b/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/texture.cpp index 02a514560..c827aa0ed 100644 --- a/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/texture.cpp +++ b/Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/texture.cpp @@ -67,11 +67,19 @@ void kinc_g4_texture_destroy(kinc_g4_texture_t *texture) { texture->impl.texture->Release(); } +#ifdef KINC_KONG +void kinc_internal_texture_set(kinc_g4_texture_t *texture, uint32_t unit) { + kinc_microsoft_affirm(device->SetTexture(unit, texture->impl.texture)); + texture->impl.stage = unit; + setTextures[texture->impl.stage] = texture; +} +#else void kinc_internal_texture_set(kinc_g4_texture_t *texture, kinc_g4_texture_unit_t unit) { kinc_microsoft_affirm(device->SetTexture(unit.stages[KINC_G4_SHADER_TYPE_FRAGMENT], texture->impl.texture)); texture->impl.stage = unit.stages[KINC_G4_SHADER_TYPE_FRAGMENT]; setTextures[texture->impl.stage] = texture; } +#endif void kinc_internal_texture_unset(struct kinc_g4_texture *texture) { if (setTextures[texture->impl.stage] == texture) { From f5b9f654246e8f7c8303f74f8fdf6b13b889a9ba Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Thu, 5 Oct 2023 18:42:46 +0200 Subject: [PATCH 04/27] [WebGPU] Create one big shader module for Kong --- .../Sources/kinc/backend/graphics5/shader.c | 19 +++++++++++++++++++ .../Sources/kinc/backend/graphics5/shader.h | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.c b/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.c index 4b769e518..ad86f6cf9 100644 --- a/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.c +++ b/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.c @@ -4,6 +4,24 @@ extern WGPUDevice device; +#ifdef KINC_KONG +static WGPUShaderModule shader_module; + +void kinc_g5_internal_webgpu_create_shader_module(const void *source, size_t length) { + WGPUShaderModuleWGSLDescriptor wgsl_desc = {0}; + wgsl_desc.code = (const char *)source; + wgsl_desc.chain.sType = WGPUSType_ShaderModuleWGSLDescriptor; + + WGPUShaderModuleDescriptor desc = {0}; + desc.nextInChain = (WGPUChainedStruct *)(&wgsl_desc); + + shader_module = wgpuDeviceCreateShaderModule(device, &desc); +} + +void kinc_g5_shader_init(kinc_g5_shader_t *shader, const void *source, size_t length, kinc_g5_shader_type_t type) { + strcpy(&shader->impl.entry_name[0], source); +} +#else void kinc_g5_shader_init(kinc_g5_shader_t *shader, const void *source, size_t length, kinc_g5_shader_type_t type) { WGPUShaderModuleSPIRVDescriptor smSpirvDesc; memset(&smSpirvDesc, 0, sizeof(smSpirvDesc)); @@ -15,5 +33,6 @@ void kinc_g5_shader_init(kinc_g5_shader_t *shader, const void *source, size_t le smDesc.nextInChain = &smSpirvDesc; shader->impl.module = wgpuDeviceCreateShaderModule(device, &smDesc); } +#endif void kinc_g5_shader_destroy(kinc_g5_shader_t *shader) {} diff --git a/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.h b/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.h index 8a7036e59..125e8ebe9 100644 --- a/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.h +++ b/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.h @@ -9,7 +9,11 @@ extern "C" { struct WGPUShaderModuleImpl; typedef struct { +#ifdef KINC_KONG + char entry_name[256]; +#else WGPUShaderModule module; +#endif } Shader5Impl; #ifdef __cplusplus From 69241e868957687e4eb09453829fd003325c530d Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Thu, 5 Oct 2023 19:21:41 +0200 Subject: [PATCH 05/27] [WebGPU] Fix Kong pipeline creation --- .../Sources/kinc/backend/graphics5/pipeline.c | 14 ++++++++++++++ .../WebGPU/Sources/kinc/backend/graphics5/shader.c | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/pipeline.c b/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/pipeline.c index cfe3cc960..28098eb3e 100644 --- a/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/pipeline.c +++ b/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/pipeline.c @@ -6,6 +6,10 @@ extern WGPUDevice device; +#ifdef KINC_KONG +extern WGPUShaderModule kinc_g5_internal_webgpu_shader_module; +#endif + void kinc_g5_pipeline_init(kinc_g5_pipeline_t *pipe) { kinc_g5_internal_pipeline_init(pipe); } @@ -183,15 +187,25 @@ void kinc_g5_pipeline_compile(kinc_g5_pipeline_t *pipe) { WGPUVertexState vsDest; memset(&vsDest, 0, sizeof(vsDest)); +#ifdef KINC_KONG + vsDest.module = kinc_g5_internal_webgpu_shader_module; + vsDest.entryPoint = pipe->vertexShader->impl.entry_name; +#else vsDest.module = pipe->vertexShader->impl.module; vsDest.entryPoint = "main"; +#endif vsDest.bufferCount = 1; vsDest.buffers = &vbDesc; WGPUFragmentState fragmentDest; memset(&fragmentDest, 0, sizeof(fragmentDest)); +#ifdef KINC_KONG + fragmentDest.module = kinc_g5_internal_webgpu_shader_module; + fragmentDest.entryPoint = pipe->fragmentShader->impl.entry_name; +#else fragmentDest.module = pipe->fragmentShader->impl.module; fragmentDest.entryPoint = "main"; +#endif fragmentDest.targetCount = 1; fragmentDest.targets = &csDesc; diff --git a/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.c b/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.c index ad86f6cf9..daf79a73f 100644 --- a/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.c +++ b/Backends/Graphics5/WebGPU/Sources/kinc/backend/graphics5/shader.c @@ -5,7 +5,7 @@ extern WGPUDevice device; #ifdef KINC_KONG -static WGPUShaderModule shader_module; +WGPUShaderModule kinc_g5_internal_webgpu_shader_module; void kinc_g5_internal_webgpu_create_shader_module(const void *source, size_t length) { WGPUShaderModuleWGSLDescriptor wgsl_desc = {0}; @@ -15,7 +15,7 @@ void kinc_g5_internal_webgpu_create_shader_module(const void *source, size_t len WGPUShaderModuleDescriptor desc = {0}; desc.nextInChain = (WGPUChainedStruct *)(&wgsl_desc); - shader_module = wgpuDeviceCreateShaderModule(device, &desc); + kinc_g5_internal_webgpu_shader_module = wgpuDeviceCreateShaderModule(device, &desc); } void kinc_g5_shader_init(kinc_g5_shader_t *shader, const void *source, size_t length, kinc_g5_shader_type_t type) { From 780025be474a588042ad5505132633acf55877e5 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Thu, 5 Oct 2023 20:24:04 +0200 Subject: [PATCH 06/27] Update Kong and kmake --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index 67a8860e2..85d1e6227 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit 67a8860e28f9dacf19a1b1942cfb3d3c6f41771c +Subproject commit 85d1e6227b57e65427f7689c2285618f60b5eb2e diff --git a/Tools/linux_arm b/Tools/linux_arm index 2e9fad92d..451bbaf74 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 2e9fad92d5800ff73f3826eda68eecd92c3cd5c4 +Subproject commit 451bbaf7417a72f06fcd0e7ac691cecfa341ec53 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index 95aa02c36..88b577192 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit 95aa02c363793e820a37f494565974303d86890c +Subproject commit 88b577192a243d0489db752602402fb8ce515ad8 diff --git a/Tools/linux_x64 b/Tools/linux_x64 index 86cd1c06e..b95facddc 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit 86cd1c06eeb484f6172a5431d3b208661e96d70d +Subproject commit b95facddcda54dcc42cbf5a9b7a83ef35d1e5c72 diff --git a/Tools/macos b/Tools/macos index d8815e941..f680c8669 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit d8815e9411dc4ad7e50c0be47efdfedf5f542d44 +Subproject commit f680c86691ddf3d86a50a1a5815b3fd49e85cbf3 diff --git a/Tools/windows_x64 b/Tools/windows_x64 index e51fe0cc9..63b95d784 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit e51fe0cc9b38e524c94bb514a1df8e6ca8dac9fe +Subproject commit 63b95d784e0326d4f19b67e1858f78db6cf54c4e From f3443459adc25ec4d46a00ba6a582a24fea9c9a3 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 12:14:28 +0200 Subject: [PATCH 07/27] Make Kong work on macOS --- .../Metal/Sources/kinc/backend/graphics5/shader.m.h | 6 ++++++ Backends/System/macOS/Sources/kinc/backend/system.m.h | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/shader.m.h b/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/shader.m.h index 97106f8a2..a495855b0 100644 --- a/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/shader.m.h +++ b/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/shader.m.h @@ -15,6 +15,11 @@ void kinc_g5_shader_destroy(kinc_g5_shader_t *shader) { } void kinc_g5_shader_init(kinc_g5_shader_t *shader, const void *source, size_t length, kinc_g5_shader_type_t type) { +#ifdef KINC_KONG + strcpy(shader->impl.name, (const char *)source); + shader->impl.mtlFunction = (__bridge_retained void *)[getMetalLibrary() newFunctionWithName:[NSString stringWithCString:shader->impl.name + encoding:NSUTF8StringEncoding]]; +#else shader->impl.name[0] = 0; { @@ -51,5 +56,6 @@ void kinc_g5_shader_init(kinc_g5_shader_t *shader, const void *source, size_t le } shader->impl.mtlFunction = (__bridge_retained void *)[library newFunctionWithName:[NSString stringWithCString:shader->impl.name encoding:NSUTF8StringEncoding]]; +#endif assert(shader->impl.mtlFunction); } diff --git a/Backends/System/macOS/Sources/kinc/backend/system.m.h b/Backends/System/macOS/Sources/kinc/backend/system.m.h index 5dd6dce14..783169ed2 100644 --- a/Backends/System/macOS/Sources/kinc/backend/system.m.h +++ b/Backends/System/macOS/Sources/kinc/backend/system.m.h @@ -174,6 +174,10 @@ static void addMenubar(void) { [NSApp setMainMenu:menubar]; } +#ifdef KINC_KONG +void kong_init(void); +#endif + int kinc_init(const char *name, int width, int height, kinc_window_options_t *win, kinc_framebuffer_options_t *frame) { @autoreleasepool { myapp = [KincApplication sharedApplication]; @@ -208,6 +212,11 @@ int kinc_init(const char *name, int width, int height, kinc_window_options_t *wi int windowId = createWindow(win); kinc_g4_internal_init(); kinc_g4_internal_init_window(windowId, frame->depth_bits, frame->stencil_bits, true); + +#ifdef KINC_KONG + kong_init(); +#endif + return 0; } From 0205eae03848a031385bd4aee08e844d9253219b Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 12:22:39 +0200 Subject: [PATCH 08/27] Fix some warnings in Xcode --- .../Sources/kinc/backend/graphics4/G4.c.h | 32 +++++++++---------- .../Sources/kinc/backend/graphics5/Metal.m.h | 20 ++++++------ .../kinc/backend/graphics5/pipeline.m.h | 2 +- Sources/kinc/audio1/audio.c.h | 2 +- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Backends/Graphics4/G4onG5/Sources/kinc/backend/graphics4/G4.c.h b/Backends/Graphics4/G4onG5/Sources/kinc/backend/graphics4/G4.c.h index 875c4f3b9..b26bfcad6 100644 --- a/Backends/Graphics4/G4onG5/Sources/kinc/backend/graphics4/G4.c.h +++ b/Backends/Graphics4/G4onG5/Sources/kinc/backend/graphics4/G4.c.h @@ -38,11 +38,11 @@ static kinc_g5_constant_buffer_t fragmentConstantBuffer; #define constantBufferMultiply 100 static int constantBufferIndex = 0; -void kinc_g4_internal_init() { +void kinc_g4_internal_init(void) { kinc_g5_internal_init(); } -void kinc_g4_internal_destroy() { +void kinc_g4_internal_destroy(void) { kinc_g5_internal_destroy(); } @@ -117,7 +117,7 @@ void kinc_g4_on_g5_internal_resize(int window, int width, int height) { windows[window].resized = true; } -void kinc_g4_on_g5_internal_restore_render_target() { +void kinc_g4_on_g5_internal_restore_render_target(void) { windows[current_window].current_render_targets[0] = NULL; kinc_g5_render_target_t *render_target = &windows[current_window].framebuffers[windows[current_window].currentBuffer]; kinc_g5_command_list_set_render_targets(&commandList, &render_target, 1); @@ -156,7 +156,7 @@ void kinc_g4_on_g5_internal_set_samplers(int count, kinc_g5_texture_unit_t *text } } -static void startDraw() { +static void startDraw(void) { if ((constantBufferIndex + 1) >= constantBufferMultiply || waitAfterNextDraw) { memcpy(current_state.vertex_constant_data, vertexConstantBuffer.data, constantBufferSize); memcpy(current_state.fragment_constant_data, fragmentConstantBuffer.data, constantBufferSize); @@ -172,7 +172,7 @@ static void startDraw() { kinc_g5_command_list_set_fragment_constant_buffer(&commandList, &fragmentConstantBuffer, constantBufferIndex * constantBufferSize, constantBufferSize); } -static void endDraw() { +static void endDraw(void) { ++constantBufferIndex; if (constantBufferIndex >= constantBufferMultiply || waitAfterNextDraw) { kinc_g5_command_list_end(&commandList); @@ -238,7 +238,7 @@ static void endDraw() { } } -void kinc_g4_draw_indexed_vertices() { +void kinc_g4_draw_indexed_vertices(void) { startDraw(); kinc_g5_command_list_draw_indexed_vertices(&commandList); endDraw(); @@ -365,7 +365,7 @@ void kinc_g4_scissor(int x, int y, int width, int height) { kinc_g5_command_list_scissor(&commandList, x, y, width, height); } -void kinc_g4_disable_scissor() { +void kinc_g4_disable_scissor(void) { current_state.scissor_set = false; kinc_g5_command_list_disable_scissor(&commandList); } @@ -390,11 +390,11 @@ void kinc_g4_end(int window) { }*/ -bool kinc_g4_swap_buffers() { +bool kinc_g4_swap_buffers(void) { return kinc_g5_swap_buffers(); } -void kinc_g4_flush() { +void kinc_g4_flush(void) { kinc_g5_flush(); } @@ -567,7 +567,7 @@ void kinc_g4_set_texture_lod(kinc_g4_texture_unit_t unit, float lod_min_clamp, f void kinc_g4_set_cubemap_lod(kinc_g4_texture_unit_t unit, float lod_min_clamp, float lod_max_clamp) {} -void kinc_g4_restore_render_target() { +void kinc_g4_restore_render_target(void) { kinc_g4_on_g5_internal_restore_render_target(); current_state.viewport_set = false; current_state.scissor_set = false; @@ -630,7 +630,7 @@ void kinc_g4_set_texture(uint32_t unit, kinc_g4_texture_t *texture) { } assert(KINC_G4_SHADER_TYPE_COUNT == KINC_G5_SHADER_TYPE_COUNT); - kinc_g5_texture_unit_t g5_unit; + kinc_g5_texture_unit_t g5_unit = {0}; for (int i = 0; i < KINC_G5_SHADER_TYPE_COUNT; ++i) { g5_unit.stages[i] = unit; } @@ -723,19 +723,19 @@ void kinc_g4_set_blend_constant(float r, float g, float b, float a) { void kinc_g4_set_texture_array(kinc_g4_texture_unit_t unit, struct kinc_g4_texture_array *array) {} -bool kinc_g4_supports_instanced_rendering() { +bool kinc_g4_supports_instanced_rendering(void) { return kinc_g5_supports_instanced_rendering(); } -bool kinc_g4_supports_compute_shaders() { +bool kinc_g4_supports_compute_shaders(void) { return kinc_g5_supports_compute_shaders(); } -bool kinc_g4_supports_blend_constants() { +bool kinc_g4_supports_blend_constants(void) { return kinc_g5_supports_blend_constants(); } -bool kinc_g4_supports_non_pow2_textures() { +bool kinc_g4_supports_non_pow2_textures(void) { return kinc_g5_supports_non_pow2_textures(); } @@ -751,7 +751,7 @@ void kinc_g4_render_target_use_color_as_texture(kinc_g4_render_target_t *render_ } assert(KINC_G4_SHADER_TYPE_COUNT == KINC_G5_SHADER_TYPE_COUNT); - kinc_g5_texture_unit_t g5_unit; + kinc_g5_texture_unit_t g5_unit = {0}; for (int i = 0; i < KINC_G5_SHADER_TYPE_COUNT; ++i) { g5_unit.stages[i] = unit; } diff --git a/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/Metal.m.h b/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/Metal.m.h index d80f5d6de..f7b96d709 100644 --- a/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/Metal.m.h +++ b/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/Metal.m.h @@ -34,7 +34,7 @@ id getMetalEncoder(void) { void kinc_g5_internal_destroy_window(int window) {} -void kinc_g5_internal_destroy() {} +void kinc_g5_internal_destroy(void) {} extern void kinc_g4_on_g5_internal_resize(int, int, int); @@ -42,7 +42,7 @@ void kinc_internal_resize(int window, int width, int height) { kinc_g4_on_g5_internal_resize(window, width, height); } -void kinc_g5_internal_init() {} +void kinc_g5_internal_init(void) {} void kinc_g5_internal_init_window(int window, int depthBufferBits, int stencilBufferBits, bool vsync) { depthBits = depthBufferBits; @@ -50,7 +50,7 @@ void kinc_g5_internal_init_window(int window, int depthBufferBits, int stencilBu kinc_g5_render_target_init(&fallback_render_target, 32, 32, KINC_G5_RENDER_TARGET_FORMAT_32BIT, 0, 0); } -void kinc_g5_flush() {} +void kinc_g5_flush(void) {} void kinc_g5_draw_indexed_vertices_instanced(int instanceCount) {} @@ -112,7 +112,7 @@ void kinc_g5_begin(kinc_g5_render_target_t *renderTarget, int window) { void kinc_g5_end(int window) {} -bool kinc_g5_swap_buffers() { +bool kinc_g5_swap_buffers(void) { if (commandBuffer != nil && commandEncoder != nil) { [commandEncoder endEncoding]; [commandBuffer presentDrawable:drawable]; @@ -202,27 +202,27 @@ void kinc_g5_internal_new_render_pass(kinc_g5_render_target_t **renderTargets, i commandEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor]; } -bool kinc_g5_supports_raytracing() { +bool kinc_g5_supports_raytracing(void) { return false; } -bool kinc_g5_supports_instanced_rendering() { +bool kinc_g5_supports_instanced_rendering(void) { return true; } -bool kinc_g5_supports_compute_shaders() { +bool kinc_g5_supports_compute_shaders(void) { return true; } -bool kinc_g5_supports_blend_constants() { +bool kinc_g5_supports_blend_constants(void) { return true; } -bool kinc_g5_supports_non_pow2_textures() { +bool kinc_g5_supports_non_pow2_textures(void) { return true; } -bool kinc_g5_render_targets_inverted_y() { +bool kinc_g5_render_targets_inverted_y(void) { return false; } diff --git a/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/pipeline.m.h b/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/pipeline.m.h index 863e3d16c..537012b22 100644 --- a/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/pipeline.m.h +++ b/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/pipeline.m.h @@ -404,7 +404,7 @@ kinc_g5_constant_location_t kinc_g5_pipeline_get_constant_location(kinc_g5_pipel } kinc_g5_texture_unit_t kinc_g5_pipeline_get_texture_unit(kinc_g5_pipeline_t *pipeline, const char *name) { - kinc_g5_texture_unit_t unit; + kinc_g5_texture_unit_t unit = {0}; for (int i = 0; i < KINC_G5_SHADER_TYPE_COUNT; ++i) { unit.stages[i] = -1; } diff --git a/Sources/kinc/audio1/audio.c.h b/Sources/kinc/audio1/audio.c.h index c28225c03..28e424c37 100644 --- a/Sources/kinc/audio1/audio.c.h +++ b/Sources/kinc/audio1/audio.c.h @@ -118,7 +118,7 @@ void kinc_a1_mix(kinc_a2_buffer_t *buffer, int samples) { } } -void kinc_a1_init() { +void kinc_a1_init(void) { for (int i = 0; i < CHANNEL_COUNT; ++i) { channels[i].sound = NULL; channels[i].position = 0; From d79403ada7f544a1fa85e9391cb199bdd5f413d7 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 12:30:23 +0200 Subject: [PATCH 09/27] Make Kong work on iOS and fix some warnings --- .../iOS/Sources/kinc/backend/GLView.m.h | 2 +- .../Sources/kinc/backend/GLViewController.m.h | 16 +++++----- .../System/iOS/Sources/kinc/backend/audio.m.h | 6 ++-- .../iOS/Sources/kinc/backend/display.m.h | 6 ++-- .../System/iOS/Sources/kinc/backend/mouse.c.h | 4 +-- .../iOS/Sources/kinc/backend/system.m.h | 32 ++++++++++++------- .../iOS/Sources/kinc/backend/window.c.h | 2 +- 7 files changed, 38 insertions(+), 30 deletions(-) diff --git a/Backends/System/iOS/Sources/kinc/backend/GLView.m.h b/Backends/System/iOS/Sources/kinc/backend/GLView.m.h index bdf70950c..ffd13c81c 100644 --- a/Backends/System/iOS/Sources/kinc/backend/GLView.m.h +++ b/Backends/System/iOS/Sources/kinc/backend/GLView.m.h @@ -17,7 +17,7 @@ static const int touchmaxcount = 20; static void *touches[touchmaxcount]; -static void initTouches() { +static void initTouches(void) { for (int i = 0; i < touchmaxcount; ++i) { touches[i] = NULL; } diff --git a/Backends/System/iOS/Sources/kinc/backend/GLViewController.m.h b/Backends/System/iOS/Sources/kinc/backend/GLViewController.m.h index 0f6f0e383..8bdee73c9 100644 --- a/Backends/System/iOS/Sources/kinc/backend/GLViewController.m.h +++ b/Backends/System/iOS/Sources/kinc/backend/GLViewController.m.h @@ -12,7 +12,7 @@ static GLView *glView; static bool visible; -void beginGL() { +void beginGL(void) { #ifdef KORE_METAL if (!visible) { return; @@ -21,7 +21,7 @@ void beginGL() { [glView begin]; } -void endGL() { +void endGL(void) { #ifdef KORE_METAL if (!visible) { return; @@ -30,29 +30,29 @@ void endGL() { [glView end]; } -void showKeyboard() { +void showKeyboard(void) { [glView showKeyboard]; } -void hideKeyboard() { +void hideKeyboard(void) { [glView hideKeyboard]; } #ifdef KORE_METAL -CAMetalLayer *getMetalLayer() { +CAMetalLayer *getMetalLayer(void) { return [glView metalLayer]; } -id getMetalDevice() { +id getMetalDevice(void) { return [glView metalDevice]; } -id getMetalLibrary() { +id getMetalLibrary(void) { return [glView metalLibrary]; } -id getMetalQueue() { +id getMetalQueue(void) { return [glView metalQueue]; } diff --git a/Backends/System/iOS/Sources/kinc/backend/audio.m.h b/Backends/System/iOS/Sources/kinc/backend/audio.m.h index fc19a5246..40a4392df 100644 --- a/Backends/System/iOS/Sources/kinc/backend/audio.m.h +++ b/Backends/System/iOS/Sources/kinc/backend/audio.m.h @@ -109,7 +109,7 @@ static void sampleRateListener(void *inRefCon, AudioUnit inUnit, AudioUnitProper static bool initialized = false; -void kinc_a2_init() { +void kinc_a2_init(void) { if (initialized) { return; } @@ -183,9 +183,9 @@ void kinc_a2_init() { soundPlaying = true; } -void kinc_a2_update() {} +void kinc_a2_update(void) {} -void kinc_a2_shutdown() { +void kinc_a2_shutdown(void) { if (!initialized) return; if (!soundPlaying) diff --git a/Backends/System/iOS/Sources/kinc/backend/display.m.h b/Backends/System/iOS/Sources/kinc/backend/display.m.h index 384aa57a3..bf798bdf1 100644 --- a/Backends/System/iOS/Sources/kinc/backend/display.m.h +++ b/Backends/System/iOS/Sources/kinc/backend/display.m.h @@ -3,7 +3,7 @@ #include #include -void kinc_display_init() {} +void kinc_display_init(void) {} kinc_display_mode_t kinc_display_available_mode(int display, int mode) { kinc_display_mode_t dm; @@ -35,10 +35,10 @@ kinc_display_mode_t kinc_display_current_mode(int display) { return dm; } -int kinc_count_displays() { +int kinc_count_displays(void) { return 1; } -int kinc_primary_display() { +int kinc_primary_display(void) { return 0; } diff --git a/Backends/System/iOS/Sources/kinc/backend/mouse.c.h b/Backends/System/iOS/Sources/kinc/backend/mouse.c.h index 9347296c1..7b75836d4 100644 --- a/Backends/System/iOS/Sources/kinc/backend/mouse.c.h +++ b/Backends/System/iOS/Sources/kinc/backend/mouse.c.h @@ -8,9 +8,9 @@ bool kinc_mouse_can_lock(void) { return false; } -void kinc_mouse_show() {} +void kinc_mouse_show(void) {} -void kinc_mouse_hide() {} +void kinc_mouse_hide(void) {} void kinc_mouse_set_position(int window, int x, int y) {} diff --git a/Backends/System/iOS/Sources/kinc/backend/system.m.h b/Backends/System/iOS/Sources/kinc/backend/system.m.h index 85f861326..4da9571ab 100644 --- a/Backends/System/iOS/Sources/kinc/backend/system.m.h +++ b/Backends/System/iOS/Sources/kinc/backend/system.m.h @@ -35,17 +35,17 @@ void kinc_set_keep_screen_on(bool on) {} void showKeyboard(void); void hideKeyboard(void); -void kinc_keyboard_show() { +void kinc_keyboard_show(void) { keyboardshown = true; showKeyboard(); } -void kinc_keyboard_hide() { +void kinc_keyboard_hide(void) { keyboardshown = false; hideKeyboard(); } -bool kinc_keyboard_active() { +bool kinc_keyboard_active(void) { return keyboardshown; } @@ -62,7 +62,7 @@ void kinc_vibrate(int ms) { static char language[3]; -const char *kinc_language() { +const char *kinc_language(void) { NSString *nsstr = [[NSLocale preferredLanguages] objectAtIndex:0]; const char *lang = [nsstr UTF8String]; language[0] = lang[0]; @@ -72,7 +72,7 @@ const char *kinc_language() { } // called on rotation event -void KoreUpdateKeyboard() { +void KoreUpdateKeyboard(void) { if (keyboardshown) { hideKeyboard(); showKeyboard(); @@ -82,7 +82,11 @@ void KoreUpdateKeyboard() { } } -void kinc_internal_shutdown() {} +#ifdef KINC_KONG +void kong_init(void); +#endif + +void kinc_internal_shutdown(void) {} int kinc_init(const char *name, int width, int height, struct kinc_window_options *win, struct kinc_framebuffer_options *frame) { kinc_window_options_t defaultWin; @@ -97,6 +101,10 @@ int kinc_init(const char *name, int width, int height, struct kinc_window_option } kinc_g4_internal_init(); kinc_g4_internal_init_window(0, frame->depth_bits, frame->stencil_bits, true); + +#ifdef KINC_KONG + kong_init(); +#endif return 0; } @@ -108,7 +116,7 @@ void swapBuffersiOS(void) { static char sysid[512]; -const char *kinc_system_id() { +const char *kinc_system_id(void) { const char *name = [[[UIDevice currentDevice] name] UTF8String]; const char *vendorId = [[[[UIDevice currentDevice] identifierForVendor] UUIDString] UTF8String]; strcpy(sysid, name); @@ -132,30 +140,30 @@ static const char *getSavePath(void) { return [resolvedPath cStringUsingEncoding:1]; } -const char *kinc_internal_save_path() { +const char *kinc_internal_save_path(void) { return getSavePath(); } static const char *videoFormats[] = {"mp4", NULL}; -const char **kinc_video_formats() { +const char **kinc_video_formats(void) { return videoFormats; } #include -double kinc_frequency() { +double kinc_frequency(void) { mach_timebase_info_data_t info; mach_timebase_info(&info); return (double)info.denom / (double)info.numer / 1e-9; } -kinc_ticks_t kinc_timestamp() { +kinc_ticks_t kinc_timestamp(void) { kinc_ticks_t time = mach_absolute_time(); return time; } -void kinc_login() {} +void kinc_login(void) {} void kinc_unlock_achievement(int id) {} diff --git a/Backends/System/iOS/Sources/kinc/backend/window.c.h b/Backends/System/iOS/Sources/kinc/backend/window.c.h index 96159ff03..e42a899d3 100644 --- a/Backends/System/iOS/Sources/kinc/backend/window.c.h +++ b/Backends/System/iOS/Sources/kinc/backend/window.c.h @@ -13,7 +13,7 @@ int kinc_window_y(int window) { return 0; } -int kinc_count_windows() { +int kinc_count_windows(void) { return 1; } From 58a2ce2cc8a33904f3db58b52e405f9234837c88 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 15:43:52 +0200 Subject: [PATCH 10/27] Update Kong and kmake --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index 85d1e6227..072fd56fb 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit 85d1e6227b57e65427f7689c2285618f60b5eb2e +Subproject commit 072fd56fbe33aa7676d2bbb7c1608eff1ba2304e diff --git a/Tools/linux_arm b/Tools/linux_arm index 451bbaf74..866a7ea45 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 451bbaf7417a72f06fcd0e7ac691cecfa341ec53 +Subproject commit 866a7ea459cd0dcb3d66ec8f8dde6d08c316cca9 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index 88b577192..67a2e944a 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit 88b577192a243d0489db752602402fb8ce515ad8 +Subproject commit 67a2e944a3a8fef72525620ed42e60499ed254f0 diff --git a/Tools/linux_x64 b/Tools/linux_x64 index b95facddc..0cfc4bf60 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit b95facddcda54dcc42cbf5a9b7a83ef35d1e5c72 +Subproject commit 0cfc4bf60ad8c59f41c7e38ceecfbc0d0cc357e9 diff --git a/Tools/macos b/Tools/macos index f680c8669..68ff335bb 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit f680c86691ddf3d86a50a1a5815b3fd49e85cbf3 +Subproject commit 68ff335bb5e1bb0dee8f10a00ee7512a39b3ac45 diff --git a/Tools/windows_x64 b/Tools/windows_x64 index 63b95d784..e37389b4e 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit 63b95d784e0326d4f19b67e1858f78db6cf54c4e +Subproject commit e37389b4e52a167b3a8f4a7813707b577cdeb18d From ad64560aea3cb9d70a1f26ad9035307b4bab93c3 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 16:07:45 +0200 Subject: [PATCH 11/27] Update Kong --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index 072fd56fb..7cc927fc6 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit 072fd56fbe33aa7676d2bbb7c1608eff1ba2304e +Subproject commit 7cc927fc61011337c1db7924da1305f79e1bd764 diff --git a/Tools/linux_arm b/Tools/linux_arm index 866a7ea45..622e69f12 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 866a7ea459cd0dcb3d66ec8f8dde6d08c316cca9 +Subproject commit 622e69f12baa483614c214d84f3ed8820125496e diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index 67a2e944a..c93c6b8e4 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit 67a2e944a3a8fef72525620ed42e60499ed254f0 +Subproject commit c93c6b8e4deacf45210464a92ff3bbada0ebd068 diff --git a/Tools/linux_x64 b/Tools/linux_x64 index 0cfc4bf60..673cd9ae1 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit 0cfc4bf60ad8c59f41c7e38ceecfbc0d0cc357e9 +Subproject commit 673cd9ae14957c43d5bdbb66dadd0d00a7d0b06b diff --git a/Tools/macos b/Tools/macos index 68ff335bb..41534fdf2 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit 68ff335bb5e1bb0dee8f10a00ee7512a39b3ac45 +Subproject commit 41534fdf2301f0968bca498e2c1663158d298106 diff --git a/Tools/windows_x64 b/Tools/windows_x64 index e37389b4e..5000f2b92 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit e37389b4e52a167b3a8f4a7813707b577cdeb18d +Subproject commit 5000f2b9226fec8259dfa6635265835621a85387 From e054429f82728030d6b6de5d0f9509a3ff54f05d Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 16:36:24 +0200 Subject: [PATCH 12/27] Update Kong --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index 7cc927fc6..507101e48 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit 7cc927fc61011337c1db7924da1305f79e1bd764 +Subproject commit 507101e48c26e773163c2d354487b39412b70f53 diff --git a/Tools/linux_arm b/Tools/linux_arm index 622e69f12..9315e80e0 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 622e69f12baa483614c214d84f3ed8820125496e +Subproject commit 9315e80e01ecf00c4221854ad772873e0055a96a diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index c93c6b8e4..376d626cd 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit c93c6b8e4deacf45210464a92ff3bbada0ebd068 +Subproject commit 376d626cdc10a244ead5779828afd1eaee9715ac diff --git a/Tools/linux_x64 b/Tools/linux_x64 index 673cd9ae1..f5c1bfe99 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit 673cd9ae14957c43d5bdbb66dadd0d00a7d0b06b +Subproject commit f5c1bfe99e4546fc7cf148c830f64e6a4f39165c diff --git a/Tools/macos b/Tools/macos index 41534fdf2..aee538686 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit 41534fdf2301f0968bca498e2c1663158d298106 +Subproject commit aee5386864583313d18ad53219005aa695033b5c diff --git a/Tools/windows_x64 b/Tools/windows_x64 index 5000f2b92..c7de00b39 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit 5000f2b9226fec8259dfa6635265835621a85387 +Subproject commit c7de00b39e3972e3d98ad937a44b25447f8eefa9 From 040a679143919fbbdcbf2cedaabe325787ffdc4f Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 16:53:48 +0200 Subject: [PATCH 13/27] Update Kong --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index 507101e48..005394cfa 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit 507101e48c26e773163c2d354487b39412b70f53 +Subproject commit 005394cfa66672dab823d452469e1abe5ec74516 diff --git a/Tools/linux_arm b/Tools/linux_arm index 9315e80e0..604cc2586 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 9315e80e01ecf00c4221854ad772873e0055a96a +Subproject commit 604cc2586c0bc84574f29181a194ae830b5c86bf diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index 376d626cd..ee06897dc 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit 376d626cdc10a244ead5779828afd1eaee9715ac +Subproject commit ee06897dcad134f0048069cfd42bf22860f76946 diff --git a/Tools/linux_x64 b/Tools/linux_x64 index f5c1bfe99..ac3e7c5ba 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit f5c1bfe99e4546fc7cf148c830f64e6a4f39165c +Subproject commit ac3e7c5ba92afaa95d876409df24aebae61aa380 diff --git a/Tools/macos b/Tools/macos index aee538686..0c79a1494 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit aee5386864583313d18ad53219005aa695033b5c +Subproject commit 0c79a14943e9fd4d4b398bb6c769f3a8741bffec diff --git a/Tools/windows_x64 b/Tools/windows_x64 index c7de00b39..c5961ec02 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit c7de00b39e3972e3d98ad937a44b25447f8eefa9 +Subproject commit c5961ec02e71471334a025892f3de25c4d01512c From 05d18153a37eeafb55057f81b062e176f4ff4e30 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 17:00:04 +0200 Subject: [PATCH 14/27] Add the kong_init call to a lot more backends --- .../System/Android/Sources/kinc/backend/system.c.h | 9 +++++++++ .../System/Emscripten/Sources/kinc/backend/system.c.h | 9 +++++++++ Backends/System/Linux/Sources/kinc/backend/system.c.h | 10 +++++++++- Backends/System/Wasm/Sources/kinc/backend/system.c.h | 9 +++++++++ .../WindowsApp/Sources/kinc/backend/system.winrt.cpp | 9 +++++++++ 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/Backends/System/Android/Sources/kinc/backend/system.c.h b/Backends/System/Android/Sources/kinc/backend/system.c.h index 973c62bbf..78ef8ef86 100644 --- a/Backends/System/Android/Sources/kinc/backend/system.c.h +++ b/Backends/System/Android/Sources/kinc/backend/system.c.h @@ -1175,6 +1175,10 @@ void android_main(struct android_app *application) { (*activity->vm)->DetachCurrentThread(activity->vm); } +#ifdef KINC_KONG +void kong_init(void); +#endif + int kinc_init(const char *name, int width, int height, struct kinc_window_options *win, struct kinc_framebuffer_options *frame) { kinc_mutex_init(&unicode_mutex); @@ -1194,6 +1198,11 @@ int kinc_init(const char *name, int width, int height, struct kinc_window_option kinc_g4_internal_init(); kinc_g4_internal_init_window(0, frame->depth_bits, frame->stencil_bits, true); + +#ifdef KINC_KONG + kong_init(); +#endif + return 0; } diff --git a/Backends/System/Emscripten/Sources/kinc/backend/system.c.h b/Backends/System/Emscripten/Sources/kinc/backend/system.c.h index 28c827779..8cb3206c1 100644 --- a/Backends/System/Emscripten/Sources/kinc/backend/system.c.h +++ b/Backends/System/Emscripten/Sources/kinc/backend/system.c.h @@ -250,6 +250,10 @@ static int with, height; extern int kinc_internal_window_width; extern int kinc_internal_window_height; +#ifdef KINC_KONG +void kong_init(void); +#endif + int kinc_init(const char *name, int width, int height, kinc_window_options_t *win, kinc_framebuffer_options_t *frame) { kinc_window_options_t defaultWin; if (win == NULL) { @@ -276,6 +280,11 @@ int kinc_init(const char *name, int width, int height, kinc_window_options_t *wi kinc_internal_window_height = height; kinc_g4_internal_init(); kinc_g4_internal_init_window(0, frame->depth_bits, frame->stencil_bits, true); + +#ifdef KINC_KONG + kong_init(); +#endif + return 0; } diff --git a/Backends/System/Linux/Sources/kinc/backend/system.c.h b/Backends/System/Linux/Sources/kinc/backend/system.c.h index 9aa94ced4..5e2d9a385 100644 --- a/Backends/System/Linux/Sources/kinc/backend/system.c.h +++ b/Backends/System/Linux/Sources/kinc/backend/system.c.h @@ -152,6 +152,10 @@ void kinc_unlock_achievement(int id) {} void kinc_linux_init_procs(); +#ifdef KINC_KONG +void kong_init(void); +#endif + int kinc_init(const char *name, int width, int height, kinc_window_options_t *win, kinc_framebuffer_options_t *frame) { #ifndef __FreeBSD__ kinc_linux_initHIDGamepads(); @@ -181,7 +185,11 @@ int kinc_init(const char *name, int width, int height, kinc_window_options_t *wi win->title = name; } - return kinc_window_create(win, frame); + int window = kinc_window_create(win, frame); +#ifdef KINC_KONG + kong_init(); +#endif + return window; } void kinc_internal_shutdown() { diff --git a/Backends/System/Wasm/Sources/kinc/backend/system.c.h b/Backends/System/Wasm/Sources/kinc/backend/system.c.h index db299b51c..f71d3f0d6 100644 --- a/Backends/System/Wasm/Sources/kinc/backend/system.c.h +++ b/Backends/System/Wasm/Sources/kinc/backend/system.c.h @@ -13,6 +13,10 @@ __attribute__((import_module("imports"), import_name("js_time"))) int js_time(); extern int kinc_internal_window_width; extern int kinc_internal_window_height; +#ifdef KINC_KONG +void kong_init(void); +#endif + int kinc_init(const char *name, int width, int height, kinc_window_options_t *win, kinc_framebuffer_options_t *frame) { kinc_window_options_t defaultWin; if (win == NULL) { @@ -32,6 +36,11 @@ int kinc_init(const char *name, int width, int height, kinc_window_options_t *wi kinc_g4_internal_init(); kinc_g4_internal_init_window(0, frame->depth_bits, frame->stencil_bits, true); + +#ifdef KINC_KONG + kong_init(); +#endif + return 0; } diff --git a/Backends/System/WindowsApp/Sources/kinc/backend/system.winrt.cpp b/Backends/System/WindowsApp/Sources/kinc/backend/system.winrt.cpp index bc31da003..ca9423207 100644 --- a/Backends/System/WindowsApp/Sources/kinc/backend/system.winrt.cpp +++ b/Backends/System/WindowsApp/Sources/kinc/backend/system.winrt.cpp @@ -160,6 +160,10 @@ bool kinc_internal_handle_messages(void) { // return vec2i(mouseX, mouseY); //} +#ifdef KINC_KONG +void kong_init(void); +#endif + #undef CreateWindow int kinc_init(const char *name, int width, int height, struct kinc_window_options *win, struct kinc_framebuffer_options *frame) { @@ -179,6 +183,11 @@ int kinc_init(const char *name, int width, int height, struct kinc_window_option kinc_g4_internal_init(); kinc_g4_internal_init_window(0, frame->depth_bits, frame->stencil_bits, true); + +#ifdef KINC_KONG + kong_init(); +#endif + return 0; } From b464fd6db77eac3ffa49f94afc98232ab53c2bcb Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 17:53:14 +0200 Subject: [PATCH 15/27] Update Kong --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index 005394cfa..af5f9f9e4 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit 005394cfa66672dab823d452469e1abe5ec74516 +Subproject commit af5f9f9e4a3e2b0cf3533c211d195902ef97317a diff --git a/Tools/linux_arm b/Tools/linux_arm index 604cc2586..1dc372046 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 604cc2586c0bc84574f29181a194ae830b5c86bf +Subproject commit 1dc3720464b711185e7c2b85411fe8132458f4b0 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index ee06897dc..5971bf43c 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit ee06897dcad134f0048069cfd42bf22860f76946 +Subproject commit 5971bf43c32aa61302ea53cd9aa5b519a78bc2ee diff --git a/Tools/linux_x64 b/Tools/linux_x64 index ac3e7c5ba..9cbb54c81 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit ac3e7c5ba92afaa95d876409df24aebae61aa380 +Subproject commit 9cbb54c81402e4f47e45832f94bea7a40f18734c diff --git a/Tools/macos b/Tools/macos index 0c79a1494..3ca46a27d 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit 0c79a14943e9fd4d4b398bb6c769f3a8741bffec +Subproject commit 3ca46a27d328840a5df845860f75b3b419cdcb33 diff --git a/Tools/windows_x64 b/Tools/windows_x64 index c5961ec02..469433673 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit c5961ec02e71471334a025892f3de25c4d01512c +Subproject commit 469433673cdc393f6a22ccf5cae4c4ef2b73295f From fb7c850c5c728a07d64011439ee58e72a8d6633a Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 17:53:58 +0200 Subject: [PATCH 16/27] Fix UWP with Kong --- .../System/WindowsApp/Sources/kinc/backend/system.winrt.cpp | 2 +- Backends/System/WindowsApp/Sources/kinc/backend/video.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Backends/System/WindowsApp/Sources/kinc/backend/system.winrt.cpp b/Backends/System/WindowsApp/Sources/kinc/backend/system.winrt.cpp index ca9423207..4012f9681 100644 --- a/Backends/System/WindowsApp/Sources/kinc/backend/system.winrt.cpp +++ b/Backends/System/WindowsApp/Sources/kinc/backend/system.winrt.cpp @@ -161,7 +161,7 @@ bool kinc_internal_handle_messages(void) { //} #ifdef KINC_KONG -void kong_init(void); +extern "C" void kong_init(void); #endif #undef CreateWindow diff --git a/Backends/System/WindowsApp/Sources/kinc/backend/video.c b/Backends/System/WindowsApp/Sources/kinc/backend/video.c index 2b6c4c8e1..e1a511118 100644 --- a/Backends/System/WindowsApp/Sources/kinc/backend/video.c +++ b/Backends/System/WindowsApp/Sources/kinc/backend/video.c @@ -4,7 +4,7 @@ void kinc_video_init(kinc_video_t *video, const char *filename) {} void kinc_video_destroy(kinc_video_t *video) {} -void kinc_video_play(kinc_video_t *video) {} +void kinc_video_play(kinc_video_t *video, bool loop) {} void kinc_video_pause(kinc_video_t *video) {} From 5b7e41addf66e6e70f366c5e54707d892d932917 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 20:40:10 +0200 Subject: [PATCH 17/27] Update Kong --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index af5f9f9e4..fec1f68f0 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit af5f9f9e4a3e2b0cf3533c211d195902ef97317a +Subproject commit fec1f68f01605758df90f57070460719752970cb diff --git a/Tools/linux_arm b/Tools/linux_arm index 1dc372046..142a4e284 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 1dc3720464b711185e7c2b85411fe8132458f4b0 +Subproject commit 142a4e2843dcd0bb3af529578a0fd83de4699df8 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index 5971bf43c..e25295bde 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit 5971bf43c32aa61302ea53cd9aa5b519a78bc2ee +Subproject commit e25295bde29135a7fabed2ae141efafa75be6693 diff --git a/Tools/linux_x64 b/Tools/linux_x64 index 9cbb54c81..5cd9e274d 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit 9cbb54c81402e4f47e45832f94bea7a40f18734c +Subproject commit 5cd9e274d6a5621f5c955a8d53155d51489a9354 diff --git a/Tools/macos b/Tools/macos index 3ca46a27d..6da22294b 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit 3ca46a27d328840a5df845860f75b3b419cdcb33 +Subproject commit 6da22294b7fc46d3e05f6942e606a47526e0ec5c diff --git a/Tools/windows_x64 b/Tools/windows_x64 index 469433673..5b8edc46b 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit 469433673cdc393f6a22ccf5cae4c4ef2b73295f +Subproject commit 5b8edc46bcffbd64ad0618e60e44bd005b6e5f3e From 42d6416a582ccc3e8919383060d11b8b4f19a8ce Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 20:45:20 +0200 Subject: [PATCH 18/27] Add a Kong OpenGL support function --- .../OpenGL/Sources/kinc/backend/graphics4/OpenGL.c.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4/OpenGL.c.h b/Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4/OpenGL.c.h index 66abe9fce..0e7392a5a 100644 --- a/Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4/OpenGL.c.h +++ b/Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4/OpenGL.c.h @@ -1269,4 +1269,9 @@ bool kinc_g4_render_targets_inverted_y(void) { void kinc_g4_set_constant_buffer(uint32_t id, struct kinc_g4_constant_buffer *buffer) { glBindBufferBase(GL_UNIFORM_BUFFER, id, buffer->impl.buffer); } + +void kinc_g4_internal_opengl_setup_uniform_block(unsigned program, const char *name, unsigned binding) { + unsigned index = glGetUniformBlockIndex(program, name); + glUniformBlockBinding(program, index, binding); +} #endif From feaef4ca459f0caea605f863fdbbe0879814d844 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 6 Oct 2023 21:27:02 +0200 Subject: [PATCH 19/27] Update Kong --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index fec1f68f0..f5880ab7c 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit fec1f68f01605758df90f57070460719752970cb +Subproject commit f5880ab7c984cdb432f48f773595c2a63d7ea3a5 diff --git a/Tools/linux_arm b/Tools/linux_arm index 142a4e284..331d9ab36 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 142a4e2843dcd0bb3af529578a0fd83de4699df8 +Subproject commit 331d9ab367558afb3f82a17bcdef26d12f5ee8a1 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index e25295bde..c08574755 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit e25295bde29135a7fabed2ae141efafa75be6693 +Subproject commit c08574755c72d5ed7188ddbbdf91adb1449a6f0f diff --git a/Tools/linux_x64 b/Tools/linux_x64 index 5cd9e274d..ff80bde22 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit 5cd9e274d6a5621f5c955a8d53155d51489a9354 +Subproject commit ff80bde223ddc44bda64d261dbd10ac39d751b6a diff --git a/Tools/macos b/Tools/macos index 6da22294b..19a2cbc41 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit 6da22294b7fc46d3e05f6942e606a47526e0ec5c +Subproject commit 19a2cbc4106926d191ff1f85aa356b168833e009 diff --git a/Tools/windows_x64 b/Tools/windows_x64 index 5b8edc46b..c8aa8a58d 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit 5b8edc46bcffbd64ad0618e60e44bd005b6e5f3e +Subproject commit c8aa8a58daf5d644212e9b23238981ea0c116e45 From 1a74efec27aefed4e03726a1a2e314e6abd6a36a Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Sat, 7 Oct 2023 01:31:32 +0200 Subject: [PATCH 20/27] Update Kong --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index f5880ab7c..c010b66d4 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit f5880ab7c984cdb432f48f773595c2a63d7ea3a5 +Subproject commit c010b66d42f63d81fff4d2159c217f78a2b11bbc diff --git a/Tools/linux_arm b/Tools/linux_arm index 331d9ab36..148696980 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 331d9ab367558afb3f82a17bcdef26d12f5ee8a1 +Subproject commit 148696980f67602e55804ab9318d6a61d5b3e8f4 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index c08574755..3d8ea93cb 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit c08574755c72d5ed7188ddbbdf91adb1449a6f0f +Subproject commit 3d8ea93cb281e3f1eabe2a833b92d027f5c79019 diff --git a/Tools/linux_x64 b/Tools/linux_x64 index ff80bde22..870017109 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit ff80bde223ddc44bda64d261dbd10ac39d751b6a +Subproject commit 870017109343b47ff4f365257bcf7e2a2afdc59e diff --git a/Tools/macos b/Tools/macos index 19a2cbc41..15667990e 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit 19a2cbc4106926d191ff1f85aa356b168833e009 +Subproject commit 15667990e468dc6a5ed367552ecddf0638bcb78d diff --git a/Tools/windows_x64 b/Tools/windows_x64 index c8aa8a58d..a42dd28cc 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit c8aa8a58daf5d644212e9b23238981ea0c116e45 +Subproject commit a42dd28ccf961498d7a578ebb8ef3505cb818117 From 48192337059a2d5a2948fca0b1197808cac79078 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Sat, 7 Oct 2023 02:07:46 +0200 Subject: [PATCH 21/27] Fix 32bit ARM debug builds (thanks again, tizi) --- Sources/kinc/system.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/kinc/system.h b/Sources/kinc/system.h index 893dc87e6..a5672d63e 100644 --- a/Sources/kinc/system.h +++ b/Sources/kinc/system.h @@ -2,6 +2,8 @@ #include +#include + #include #include #include From 2c82343d3bb1f70d0552e42bcf5ac95061560d81 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Sat, 7 Oct 2023 19:26:47 +0200 Subject: [PATCH 22/27] Update Kong and kmake --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index c010b66d4..d923f5856 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit c010b66d42f63d81fff4d2159c217f78a2b11bbc +Subproject commit d923f5856833cac4d6e59e1e0a99524aeb53a97f diff --git a/Tools/linux_arm b/Tools/linux_arm index 148696980..691ba9c22 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 148696980f67602e55804ab9318d6a61d5b3e8f4 +Subproject commit 691ba9c224f1b41c48521ee5813be089f17cb0e1 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index 3d8ea93cb..3906d6659 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit 3d8ea93cb281e3f1eabe2a833b92d027f5c79019 +Subproject commit 3906d66598dce001bb6bfa3b415512df2640e9c9 diff --git a/Tools/linux_x64 b/Tools/linux_x64 index 870017109..c77cd7ab2 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit 870017109343b47ff4f365257bcf7e2a2afdc59e +Subproject commit c77cd7ab2a0914a217f17c63cb3856f4048ea37c diff --git a/Tools/macos b/Tools/macos index 15667990e..c0f00d13c 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit 15667990e468dc6a5ed367552ecddf0638bcb78d +Subproject commit c0f00d13ce95636f4a61e82f826d7dc695341a87 diff --git a/Tools/windows_x64 b/Tools/windows_x64 index a42dd28cc..33bc08b89 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit a42dd28ccf961498d7a578ebb8ef3505cb818117 +Subproject commit 33bc08b89ae736181dda4c0e723fa8fe7aa5c7e9 From 6ca310fcfbae36f1c63acdfdc748b94cb92776b3 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Sat, 7 Oct 2023 23:41:11 +0200 Subject: [PATCH 23/27] Update Kong --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index d923f5856..19e509306 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit d923f5856833cac4d6e59e1e0a99524aeb53a97f +Subproject commit 19e509306f0678c728e1dd37fce8afff1fb0d042 diff --git a/Tools/linux_arm b/Tools/linux_arm index 691ba9c22..80369f794 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 691ba9c224f1b41c48521ee5813be089f17cb0e1 +Subproject commit 80369f794fb5d7c2333b813de68872f876cf8e91 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index 3906d6659..d7e566d61 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit 3906d66598dce001bb6bfa3b415512df2640e9c9 +Subproject commit d7e566d613ca8fc7d09f204616e930009a8a0936 diff --git a/Tools/linux_x64 b/Tools/linux_x64 index c77cd7ab2..47ebb1851 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit c77cd7ab2a0914a217f17c63cb3856f4048ea37c +Subproject commit 47ebb185104fe2f0de90622ee47e8b525fa8c82c diff --git a/Tools/macos b/Tools/macos index c0f00d13c..09779fc1c 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit c0f00d13ce95636f4a61e82f826d7dc695341a87 +Subproject commit 09779fc1ce788cb94600a55b128ca9961f3aad63 diff --git a/Tools/windows_x64 b/Tools/windows_x64 index 33bc08b89..f1db032ca 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit 33bc08b89ae736181dda4c0e723fa8fe7aa5c7e9 +Subproject commit f1db032ca14e3ba245005bc454599a663781c2de From 2dcc2bc379cefe80e50e062153aee5840eca29ce Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Sat, 7 Oct 2023 23:59:29 +0200 Subject: [PATCH 24/27] Update Kong --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index 19e509306..eaf18ad8d 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit 19e509306f0678c728e1dd37fce8afff1fb0d042 +Subproject commit eaf18ad8d2e9d63349ff3107531dfbf628a44070 diff --git a/Tools/linux_arm b/Tools/linux_arm index 80369f794..282e67c7c 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 80369f794fb5d7c2333b813de68872f876cf8e91 +Subproject commit 282e67c7c2f3ef513426b691061a769826807a86 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index d7e566d61..12be61910 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit d7e566d613ca8fc7d09f204616e930009a8a0936 +Subproject commit 12be619105b87e5ca768e05bc8e1c0aaa436c5da diff --git a/Tools/linux_x64 b/Tools/linux_x64 index 47ebb1851..ff356f243 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit 47ebb185104fe2f0de90622ee47e8b525fa8c82c +Subproject commit ff356f2432b49968f56e1dfc59fb551a4fe43d96 diff --git a/Tools/macos b/Tools/macos index 09779fc1c..c21c31001 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit 09779fc1ce788cb94600a55b128ca9961f3aad63 +Subproject commit c21c31001dfc4cfe38fc44988dadda18a650cfa4 diff --git a/Tools/windows_x64 b/Tools/windows_x64 index f1db032ca..47d42aac2 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit f1db032ca14e3ba245005bc454599a663781c2de +Subproject commit 47d42aac246947bde69ec283cfe6bd0bab2b2f4f From 5d4720642da9a0229b57f6f47dbe3a27a8c04a5a Mon Sep 17 00:00:00 2001 From: SunDaw Date: Mon, 9 Oct 2023 22:00:19 +0200 Subject: [PATCH 25/27] try creating D3D11Device without debug flag if failed --- .../Sources/kinc/backend/graphics4/Direct3D11.c.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Backends/Graphics4/Direct3D11/Sources/kinc/backend/graphics4/Direct3D11.c.h b/Backends/Graphics4/Direct3D11/Sources/kinc/backend/graphics4/Direct3D11.c.h index d4d877281..7ba75b6d6 100644 --- a/Backends/Graphics4/Direct3D11/Sources/kinc/backend/graphics4/Direct3D11.c.h +++ b/Backends/Graphics4/Direct3D11/Sources/kinc/backend/graphics4/Direct3D11.c.h @@ -212,6 +212,16 @@ void kinc_g4_internal_init(void) { #endif HRESULT result = D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_HARDWARE, NULL, flags, featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, &dx_ctx.device, &featureLevel, &dx_ctx.context); + +#ifdef _DEBUG + if (result == E_FAIL || result == DXGI_ERROR_SDK_COMPONENT_MISSING) { + kinc_log(KINC_LOG_LEVEL_WARNING, "%s", "Failed to create device with D3D11_CREATE_DEVICE_DEBUG, trying without"); + flags &= ~D3D11_CREATE_DEVICE_DEBUG; + result = D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_HARDWARE, NULL, flags, featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, + &dx_ctx.device, &featureLevel, &dx_ctx.context); + } +#endif + if (result != S_OK) { kinc_log(KINC_LOG_LEVEL_WARNING, "%s", "Falling back to the WARP driver, things will be slow."); kinc_microsoft_affirm(D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_WARP, NULL, flags, featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, From 57dd28e4fe0adcc58e02ac8d73c7f9fc04d19d56 Mon Sep 17 00:00:00 2001 From: SunDaw Date: Mon, 9 Oct 2023 22:11:02 +0200 Subject: [PATCH 26/27] Prevent D3D12 crash if no debug layer support --- .../Sources/kinc/backend/graphics5/Direct3D12.c.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/Direct3D12.c.h b/Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/Direct3D12.c.h index 1d14022d8..473263785 100644 --- a/Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/Direct3D12.c.h +++ b/Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/Direct3D12.c.h @@ -437,10 +437,11 @@ void kinc_g5_internal_init() { #ifdef KORE_WINDOWS #ifdef _DEBUG ID3D12Debug *debugController = NULL; - D3D12GetDebugInterface(IID_PPV_ARGS(&debugController)); - debugController->EnableDebugLayer(); + if (D3D12GetDebugInterface(IID_PPV_ARGS(&debugController)) == S_OK) { + debugController->EnableDebugLayer(); + } #endif - D3D12CreateDevice(NULL, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&device)); + kinc_microsoft_affirm(D3D12CreateDevice(NULL, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&device))); createRootSignature(); createComputeRootSignature(); From fbc77e44c2da8149dc58642f72a4b438d5231a64 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Wed, 11 Oct 2023 17:47:39 +0200 Subject: [PATCH 27/27] Update Kong --- Tools/freebsd_x64 | 2 +- Tools/linux_arm | 2 +- Tools/linux_arm64 | 2 +- Tools/linux_x64 | 2 +- Tools/macos | 2 +- Tools/windows_x64 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/freebsd_x64 b/Tools/freebsd_x64 index eaf18ad8d..7ce2c0551 160000 --- a/Tools/freebsd_x64 +++ b/Tools/freebsd_x64 @@ -1 +1 @@ -Subproject commit eaf18ad8d2e9d63349ff3107531dfbf628a44070 +Subproject commit 7ce2c0551bc3d8f662abfcc089b4143a68563c47 diff --git a/Tools/linux_arm b/Tools/linux_arm index 282e67c7c..0894e7a12 160000 --- a/Tools/linux_arm +++ b/Tools/linux_arm @@ -1 +1 @@ -Subproject commit 282e67c7c2f3ef513426b691061a769826807a86 +Subproject commit 0894e7a125bfe09d34a6c5fd955aea413de56564 diff --git a/Tools/linux_arm64 b/Tools/linux_arm64 index 12be61910..62bd42055 160000 --- a/Tools/linux_arm64 +++ b/Tools/linux_arm64 @@ -1 +1 @@ -Subproject commit 12be619105b87e5ca768e05bc8e1c0aaa436c5da +Subproject commit 62bd420550775e5f572a6af4d455878feeee46bc diff --git a/Tools/linux_x64 b/Tools/linux_x64 index ff356f243..5877a1ecd 160000 --- a/Tools/linux_x64 +++ b/Tools/linux_x64 @@ -1 +1 @@ -Subproject commit ff356f2432b49968f56e1dfc59fb551a4fe43d96 +Subproject commit 5877a1ecd45f9baf03b6710e463378bd78d2c1fe diff --git a/Tools/macos b/Tools/macos index c21c31001..ce6eb1894 160000 --- a/Tools/macos +++ b/Tools/macos @@ -1 +1 @@ -Subproject commit c21c31001dfc4cfe38fc44988dadda18a650cfa4 +Subproject commit ce6eb18948fab33cffecebe349660e545037314a diff --git a/Tools/windows_x64 b/Tools/windows_x64 index 47d42aac2..2890e0587 160000 --- a/Tools/windows_x64 +++ b/Tools/windows_x64 @@ -1 +1 @@ -Subproject commit 47d42aac246947bde69ec283cfe6bd0bab2b2f4f +Subproject commit 2890e058794d7a198cc71a45e86be4c2bd50ae2d