Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3532c9c
update
yorkie Oct 29, 2025
c1f4c14
fix
yorkie Oct 29, 2025
77ba6dd
update
yorkie Oct 30, 2025
d5f215c
update
yorkie Oct 31, 2025
4e36458
Merge branch 'main' of github.com:M-CreativeLab/jsar-runtime into add…
yorkie Nov 3, 2025
00ac3ac
update common errors
yorkie Nov 3, 2025
648a38e
update
yorkie Nov 4, 2025
75f3ff4
fix
yorkie Nov 4, 2025
8997825
fix
yorkie Nov 5, 2025
d620fdb
fix nits
yorkie Nov 5, 2025
de581c5
build working
yorkie Nov 6, 2025
d18d206
update
yorkie Nov 6, 2025
39c7742
update
yorkie Nov 7, 2025
ea89d9b
update
yorkie Nov 7, 2025
be49a2f
continue adding impls
yorkie Nov 7, 2025
e2a3d57
fixup
yorkie Nov 12, 2025
fa81598
fix
yorkie Nov 12, 2025
752d9b5
update
yorkie Nov 14, 2025
863ea6a
fix
yorkie Nov 14, 2025
54d1451
fix
yorkie Nov 17, 2025
359703b
fix
yorkie Nov 20, 2025
97ef302
Merge branch 'main' of github.com:M-CreativeLab/jsar-runtime into add…
yorkie Nov 24, 2025
1aeac41
add gpu queue
yorkie Nov 24, 2025
780a6e4
add render bundle
yorkie Nov 24, 2025
659819d
renderer: add context webgl
yorkie Nov 26, 2025
3c2bfd5
update
yorkie Nov 26, 2025
f72567f
fix
yorkie Nov 26, 2025
5c60bd4
fix
yorkie Nov 26, 2025
54e66bc
start working context webgl
yorkie Nov 26, 2025
0903876
fixup
yorkie Nov 26, 2025
a3efd6d
fixup
yorkie Nov 26, 2025
cca7498
fix
yorkie Nov 26, 2025
89f96f7
fix
yorkie Nov 26, 2025
967f312
fixup
yorkie Nov 27, 2025
4484cf4
fix
yorkie Nov 28, 2025
84b7dcc
implement texture
yorkie Nov 28, 2025
746a5ec
fix
yorkie Nov 28, 2025
413efbe
fix
yorkie Nov 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,10 @@
"cmake.buildDirectory": "${workspaceFolder}/build/targets/darwin",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.errorSquiggles": "enabledIfIncludesResolve"
"C_Cpp.errorSquiggles": "enabledIfIncludesResolve",
"clangd.arguments": [
"--compile-commands-dir=${workspaceFolder}/build/targets/darwin",
"--background-index",
"--query-driver=/usr/bin/clang*;${env:ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/bin/*"
]
}
3 changes: 1 addition & 2 deletions cmake/TransmuteCommon.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Set the common source files.
file(GLOB TR_COMMON_SOURCE
file(GLOB_RECURSE TR_COMMON_SOURCE
"src/common/*.cpp"
"src/common/**/*.cpp"
)

# Set the common include directories
Expand Down
2 changes: 1 addition & 1 deletion cmake/TransmuteCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(NOT TR_ENABLE_INSPECTOR)
endif()

if(APPLE)
file(GLOB TR_CORE_SOURCE_MM "src/renderer/*.mm")
file(GLOB TR_CORE_SOURCE_MM "src/renderer/*.mm" "src/renderer/metal/*.mm")
list(APPEND TR_CORE_SOURCE ${TR_CORE_SOURCE_MM})
endif()

Expand Down
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/active_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ namespace endor
}

} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/active_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ namespace endor
};

} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ namespace endor
{
}
} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/framebuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ namespace endor
};

} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ namespace endor
// WebGLObject is a base class, typically not instantiated directly
}
} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ namespace endor
};

} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ namespace endor
}

} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ namespace endor
WebGLProgram(v8::Isolate *isolate, const v8::FunctionCallbackInfo<v8::Value> &args);
};
} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/renderbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ namespace endor
// WebGLRenderbuffer objects are created by WebGL context, not by user code
}
} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/renderbuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ namespace endor
};

} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ namespace endor
{
}
} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/texture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ namespace endor
};

} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/uniform_location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ namespace endor
}

} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/uniform_location.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ namespace endor
};

} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/vertex_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ namespace endor
{
}
} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
2 changes: 1 addition & 1 deletion src/client/script_bindings/webgl/vertex_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ namespace endor
};

} // namespace webgl
} // namespace script_bindings
} // namespace script_bindings
} // namespace endor
57 changes: 57 additions & 0 deletions src/common/assert.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include <iostream>
#include <common/assert.hpp>
#include <common/compiler.hpp>
#include <common/platform.hpp>

namespace transmute::common
{
#if TR_COMPILER_IS(CLANG) || TR_COMPILER_IS(GCC)
void BreakPoint()
{
#if TR_PLATFORM_IS(X86)
__asm__ __volatile__("int $3\n\t");
#elif TR_PLATFORM_IS(ARM32)
__asm__ __volatile__("bkpt 0");
#elif TR_PLATFORM_IS(ARM64)
__asm__ __volatile__("brk 0xf000");
#elif TR_PLATFORM_IS(LOONGARCH)
__asm__ __volatile__("break 0");
#elif TR_PLATFORM_IS(RISCV)
__asm__ __volatile__("ebreak");
#elif TR_PLATFORM_IS(MIPS)
__asm__ __volatile__("break");
#elif TR_PLATFORM_IS(S390) || TR_PLATFORM_IS(S390X)
__asm__ __volatile__(".word 0x0001");
#elif TR_PLATFORM_IS(PPC) || TR_PLATFORM_IS(PPC64)
__asm__ __volatile__("twge 2,2");
#elif TR_PLATFORM_IS(WASM32) || TR_PLATFORM_IS(WASM64)
EM_ASM(debugger;);
#else
#error "Unsupported platform"
#endif
}

#elif TR_COMPILER_IS(MSVC)
void BreakPoint()
{
__debugbreak();
}

#else
#error "Unsupported compiler"
#endif

void HandleAssertionFailure(const char *file,
const char *function,
int line,
const char *condition)
{
std::cerr << "Assertion failure at " << file << ":" << line << " (" << function
<< "): " << condition;
#if defined(TR_ABORT_ON_ASSERT)
abort();
#else
BreakPoint();
#endif
}
}
10 changes: 10 additions & 0 deletions src/common/assert.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once

namespace transmute::common
{
void BreakPoint();
void HandleAssertionFailure(const char *file,
const char *function,
int line,
const char *condition);
}
13 changes: 13 additions & 0 deletions src/common/command_buffers/gpu/attachment_set.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

namespace commandbuffers
{
class GPUDeviceBase;

namespace gpu
{
class AttachmentState
{
};
}
}
20 changes: 20 additions & 0 deletions src/common/command_buffers/gpu/backend_connection.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <common/command_buffers/gpu/backend_connection.hpp>

namespace commandbuffers::gpu
{
BackendConnection::BackendConnection(GPUInstance *instance, GPUBackendType type)
: instance_(instance)
, type_(type)
{
}

GPUBackendType BackendConnection::type() const
{
return type_;
}

GPUInstance *BackendConnection::getInstance() const
{
return instance_;
}
}
28 changes: 28 additions & 0 deletions src/common/command_buffers/gpu/backend_connection.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

#include <vector>
#include <common/utility.hpp>
#include <common/non_movable.hpp>
#include <common/command_buffers/gpu/gpu_base.hpp>
#include <common/command_buffers/gpu/gpu_instance.hpp>
#include <common/command_buffers/gpu/gpu_adapter.hpp>
#include <common/command_buffers/gpu/physical_device.hpp>

namespace commandbuffers::gpu
{
class BackendConnection : public NonMovable
{
public:
BackendConnection(GPUInstance *instance, GPUBackendType type);
virtual ~BackendConnection() = default;

GPUBackendType type() const;
GPUInstance *getInstance() const;

virtual std::vector<Ref<gpu::PhysicalDeviceBase>> discoverPhysicalDevices(const RequestAdapterOptions &) = 0;

private:
GPUInstance *instance_ = nullptr;
GPUBackendType type_;
};
}
Loading
Loading