Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "externals/dawn"]
path = externals/dawn
url = https://dawn.googlesource.com/dawn
branch = chromium/7403
branch = chromium/7472
4 changes: 2 additions & 2 deletions apps/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ PODS:
- ReactCommon/turbomodule/core
- SocketRocket
- Yoga
- react-native-wgpu (0.2.8):
- react-native-wgpu (0.2.9):
- boost
- DoubleConversion
- fast_float
Expand Down Expand Up @@ -2903,7 +2903,7 @@ SPEC CHECKSUMS:
React-microtasksnativemodule: 75b6604b667d297292345302cc5bfb6b6aeccc1b
react-native-safe-area-context: c6e2edd1c1da07bdce287fa9d9e60c5f7b514616
react-native-skia: 5bf2b2107cd7f2d806fd364f5e16b1c7554ed3cd
react-native-wgpu: fa319a78b8773740fd2247cff8054f4bb3cd341e
react-native-wgpu: 6b98abaead58c53560720db8074bb82b29edd9a8
React-NativeModulesApple: 879fbdc5dcff7136abceb7880fe8a2022a1bd7c3
React-oscompat: 93b5535ea7f7dff46aaee4f78309a70979bdde9d
React-perflogger: 5536d2df3d18fe0920263466f7b46a56351c0510
Expand Down
3 changes: 2 additions & 1 deletion apps/example/src/ComputeToys/ComputeToys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { ComputeToy, useComputeToy } from "./ComputeToy";

export const ComputeToys = () => {
//1806
const toy = useComputeToy(537);
const toy = useComputeToy(2349);
if (!toy) {
return null;
}
console.log({ toy });
return <ComputeToy toy={toy} />;
};
2 changes: 1 addition & 1 deletion apps/example/src/ComputeToys/engine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ struct DispatchInfo { id: uint }
`;

// Add custom uniforms struct
prelude += "struct Custom {\n";
const [customNames] = this.bindings!.custom.host;
prelude += "struct Custom {\n";
for (const name of customNames) {
prelude += ` ${name}: float,\n`;
}
Expand Down
2 changes: 1 addition & 1 deletion externals/dawn
Submodule dawn updated from c84d44 to ffb605
6 changes: 0 additions & 6 deletions packages/webgpu/cpp/rnwgpu/api/GPUAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,4 @@ std::shared_ptr<GPUAdapterInfo> GPUAdapter::getInfo() {
return std::make_shared<GPUAdapterInfo>(info);
}

bool GPUAdapter::getIsFallbackAdapter() {
wgpu::AdapterInfo adapterInfo = {};
_instance.GetInfo(&adapterInfo);
return adapterInfo.adapterType == wgpu::AdapterType::CPU;
}

} // namespace rnwgpu
3 changes: 0 additions & 3 deletions packages/webgpu/cpp/rnwgpu/api/GPUAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,13 @@ class GPUAdapter : public m::HybridObject {
std::unordered_set<std::string> getFeatures();
std::shared_ptr<GPUSupportedLimits> getLimits();
std::shared_ptr<GPUAdapterInfo> getInfo();
bool getIsFallbackAdapter();

void loadHybridMethods() override {
registerHybridGetter("__brand", &GPUAdapter::getBrand, this);
registerHybridMethod("requestDevice", &GPUAdapter::requestDevice, this);
registerHybridGetter("features", &GPUAdapter::getFeatures, this);
registerHybridGetter("limits", &GPUAdapter::getLimits, this);
registerHybridGetter("info", &GPUAdapter::getInfo, this);
registerHybridGetter("isFallbackAdapter", &GPUAdapter::getIsFallbackAdapter,
this);
}

inline const wgpu::Adapter get() { return _instance; }
Expand Down
7 changes: 6 additions & 1 deletion packages/webgpu/cpp/rnwgpu/api/GPUAdapterInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class GPUAdapterInfo : public m::HybridObject {
explicit GPUAdapterInfo(wgpu::AdapterInfo &info)
: HybridObject("GPUAdapterInfo"), _vendor(info.vendor),
_architecture(info.architecture), _device(info.device),
_description(info.description) {}
_description(info.description),
_isFallbackAdapter(info.adapterType == wgpu::AdapterType::CPU) {}

public:
std::string getBrand() { return _name; }
Expand All @@ -30,6 +31,7 @@ class GPUAdapterInfo : public m::HybridObject {
std::string getArchitecture() { return _architecture; }
std::string getDevice() { return _device; }
std::string getDescription() { return _description; }
bool getIsFallbackAdapter() { return _isFallbackAdapter; }

void loadHybridMethods() override {
registerHybridGetter("__brand", &GPUAdapterInfo::getBrand, this);
Expand All @@ -39,13 +41,16 @@ class GPUAdapterInfo : public m::HybridObject {
this);
registerHybridGetter("device", &GPUAdapterInfo::getDevice, this);
registerHybridGetter("description", &GPUAdapterInfo::getDescription, this);
registerHybridGetter("isFallbackAdapter",
&GPUAdapterInfo::getIsFallbackAdapter, this);
}

private:
std::string _vendor;
std::string _architecture;
std::string _device;
std::string _description;
bool _isFallbackAdapter;
};

} // namespace rnwgpu
2 changes: 1 addition & 1 deletion packages/webgpu/cpp/rnwgpu/api/GPUCommandEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ std::shared_ptr<GPURenderPassEncoder> GPUCommandEncoder::beginRenderPass(
std::shared_ptr<GPURenderPassDescriptor> descriptor) {

wgpu::RenderPassDescriptor desc{};
wgpu::RenderPassDescriptorMaxDrawCount maxDrawCountDesc{};
wgpu::RenderPassMaxDrawCount maxDrawCountDesc{};
desc.nextInChain = &maxDrawCountDesc;
Convertor conv;

Expand Down
2 changes: 1 addition & 1 deletion packages/webgpu/cpp/rnwgpu/api/GPUDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ GPUDevice::createTexture(std::shared_ptr<GPUTextureDescriptor> descriptor) {

std::shared_ptr<GPUShaderModule> GPUDevice::createShaderModule(
std::shared_ptr<GPUShaderModuleDescriptor> descriptor) {
wgpu::ShaderModuleWGSLDescriptor wgsl_desc{};
wgpu::ShaderSourceWGSL wgsl_desc{};
wgpu::ShaderModuleDescriptor sm_desc{};
Convertor conv;
if (!conv(wgsl_desc.code, descriptor->code) ||
Expand Down
8 changes: 4 additions & 4 deletions packages/webgpu/cpp/rnwgpu/api/descriptors/Unions.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ inline void convertJSUnionToEnum(const std::string &inUnion,
*outEnum = wgpu::FeatureName::AdapterPropertiesVk;
} else if (inUnion == "r8unorm-storage") {
*outEnum = wgpu::FeatureName::R8UnormStorage;
} else if (inUnion == "dawn-format-capabilities") {
} else if (inUnion == "format-capabilities") {
*outEnum = wgpu::FeatureName::DawnFormatCapabilities;
} else if (inUnion == "norm16-texture-formats") {
*outEnum = wgpu::FeatureName::Norm16TextureFormats;
Expand Down Expand Up @@ -590,6 +590,9 @@ inline void convertEnumToJSUnion(wgpu::FeatureName inEnum,
case wgpu::FeatureName::DawnNative:
*outUnion = "dawn-native";
break;
case wgpu::FeatureName::DawnFormatCapabilities:
*outUnion = "format-capabilities";
break;
case wgpu::FeatureName::ChromiumExperimentalTimestampQueryInsidePasses:
*outUnion = "chromium-experimental-timestamp-query-inside-passes";
break;
Expand Down Expand Up @@ -662,9 +665,6 @@ inline void convertEnumToJSUnion(wgpu::FeatureName inEnum,
case wgpu::FeatureName::R8UnormStorage:
*outUnion = "r8unorm-storage";
break;
case wgpu::FeatureName::DawnFormatCapabilities:
*outUnion = "dawn-format-capabilities";
break;
case wgpu::FeatureName::Norm16TextureFormats:
*outUnion = "norm16-texture-formats";
break;
Expand Down
2 changes: 1 addition & 1 deletion packages/webgpu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-wgpu",
"version": "0.2.8",
"version": "0.2.9",
"description": "React Native WebGPU",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
2 changes: 1 addition & 1 deletion packages/webgpu/scripts/build/apple.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ else()
set(CMAKE_OBJCXX_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_OBJCXX_LINK_FLAGS}" CACHE INTERNAL
"Flags used by the compiler for all OBJCXX link types.")
endif()
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp -arch ${CMAKE_OSX_ARCHITECTURES} ${APPLE_TARGET_TRIPLE_FLAG}" CACHE INTERNAL
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp" CACHE INTERNAL
"Flags used by the compiler for all ASM build types.")
endif()

Expand Down