gpu: update dawn C shims to reflect library name

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2021-11-16 23:37:37 -07:00 committed by Stephen Gutekanst
parent 882e82f601
commit efb7fe9c62
4 changed files with 15 additions and 15 deletions

View file

@ -61,7 +61,7 @@ fn buildLibMachDawnNative(b: *Builder, step: *std.build.LibExeObjStep) *std.buil
lib.linkLibCpp(); lib.linkLibCpp();
glfw.link(b, lib, .{ .system_sdk = .{ .set_sysroot = false } }); glfw.link(b, lib, .{ .system_sdk = .{ .set_sysroot = false } });
lib.addCSourceFile("src/dawn/dawn_native_c.cpp", &.{ lib.addCSourceFile("src/dawn/dawn_native_mach.cpp", &.{
include("libs/mach-glfw/upstream/glfw/include"), include("libs/mach-glfw/upstream/glfw/include"),
include("libs/dawn/out/Debug/gen/src/include"), include("libs/dawn/out/Debug/gen/src/include"),
include("libs/dawn/out/Debug/gen/src"), include("libs/dawn/out/Debug/gen/src"),

View file

@ -1,5 +1,5 @@
pub const c = @cImport({ pub const c = @cImport({
@cInclude("dawn/webgpu.h"); @cInclude("dawn/webgpu.h");
@cInclude("dawn/dawn_proc.h"); @cInclude("dawn/dawn_proc.h");
@cInclude("dawn_native_c.h"); @cInclude("dawn_native_mach.h");
}); });

View file

@ -2,7 +2,7 @@
#include <dawn_native/wgpu_structs_autogen.h> #include <dawn_native/wgpu_structs_autogen.h>
#include "utils/BackendBinding.h" #include "utils/BackendBinding.h"
#include "dawn_native_c.h" #include "dawn_native_mach.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -59,7 +59,7 @@ MACH_EXPORT MachDawnNativeAdapterProperties machDawnNativeAdapter_getProperties(
self->GetProperties(cppProperties); self->GetProperties(cppProperties);
return reinterpret_cast<MachDawnNativeAdapterProperties>(cppProperties); return reinterpret_cast<MachDawnNativeAdapterProperties>(cppProperties);
} }
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// std::vector<const char*> GetSupportedExtensions() const; // std::vector<const char*> GetSupportedExtensions() const;
// WGPUDeviceProperties GetAdapterProperties() const; // WGPUDeviceProperties GetAdapterProperties() const;
// bool GetLimits(WGPUSupportedLimits* limits) const; // bool GetLimits(WGPUSupportedLimits* limits) const;
@ -96,7 +96,7 @@ MACH_EXPORT WGPUDevice machDawnNativeAdapter_createDevice(MachDawnNativeAdapter
return self->CreateDevice(&cppDeviceDescriptor); return self->CreateDevice(&cppDeviceDescriptor);
} }
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// // An optional parameter of Adapter::CreateDevice() to send additional information when creating // // An optional parameter of Adapter::CreateDevice() to send additional information when creating
// // a Device. For example, we can use it to enable a workaround, optimization or feature. // // a Device. For example, we can use it to enable a workaround, optimization or feature.
// struct DAWN_NATIVE_EXPORT DeviceDescriptor { // struct DAWN_NATIVE_EXPORT DeviceDescriptor {
@ -108,18 +108,18 @@ MACH_EXPORT WGPUDevice machDawnNativeAdapter_createDevice(MachDawnNativeAdapter
// }; // };
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// // Create a device on this adapter, note that the interface will change to include at least // // Create a device on this adapter, note that the interface will change to include at least
// // a device descriptor and a pointer to backend specific options. // // a device descriptor and a pointer to backend specific options.
// // On an error, nullptr is returned. // // On an error, nullptr is returned.
// WGPUDevice CreateDevice(const DeviceDescriptor* deviceDescriptor = nullptr); // WGPUDevice CreateDevice(const DeviceDescriptor* deviceDescriptor = nullptr);
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// void RequestDevice(const DeviceDescriptor* descriptor, // void RequestDevice(const DeviceDescriptor* descriptor,
// WGPURequestDeviceCallback callback, // WGPURequestDeviceCallback callback,
// void* userdata); // void* userdata);
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// // Reset the backend device object for testing purposes. // // Reset the backend device object for testing purposes.
// void ResetInternalDeviceForTesting(); // void ResetInternalDeviceForTesting();
@ -145,7 +145,7 @@ MACH_EXPORT void machDawnNativeInstance_discoverDefaultAdapters(MachDawnNativeIn
dawn_native::Instance* self = reinterpret_cast<dawn_native::Instance*>(instance); dawn_native::Instance* self = reinterpret_cast<dawn_native::Instance*>(instance);
self->DiscoverDefaultAdapters(); self->DiscoverDefaultAdapters();
} }
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// // Adds adapters that can be discovered with the options provided (like a getProcAddress). // // Adds adapters that can be discovered with the options provided (like a getProcAddress).
// // The backend is chosen based on the type of the options used. Returns true on success. // // The backend is chosen based on the type of the options used. Returns true on success.
// bool DiscoverAdapters(const AdapterDiscoveryOptionsBase* options); // bool DiscoverAdapters(const AdapterDiscoveryOptionsBase* options);
@ -161,22 +161,22 @@ MACH_EXPORT const DawnProcTable* machDawnNativeGetProcs() {
return &dawn_native::GetProcs(); return &dawn_native::GetProcs();
} }
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// const ToggleInfo* GetToggleInfo(const char* toggleName); // const ToggleInfo* GetToggleInfo(const char* toggleName);
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// // Enables backend validation layers // // Enables backend validation layers
// void EnableBackendValidation(bool enableBackendValidation); // void EnableBackendValidation(bool enableBackendValidation);
// void SetBackendValidationLevel(BackendValidationLevel validationLevel); // void SetBackendValidationLevel(BackendValidationLevel validationLevel);
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// // Enable debug capture on Dawn startup // // Enable debug capture on Dawn startup
// void EnableBeginCaptureOnStartup(bool beginCaptureOnStartup); // void EnableBeginCaptureOnStartup(bool beginCaptureOnStartup);
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// void SetPlatform(dawn_platform::Platform* platform); // void SetPlatform(dawn_platform::Platform* platform);
// TODO(mach-dawn-shims): // TODO(dawn-native-mach):
// // Returns the underlying WGPUInstance object. // // Returns the underlying WGPUInstance object.
// WGPUInstance Get() const; // WGPUInstance Get() const;
@ -231,7 +231,7 @@ MACH_EXPORT WGPUTextureFormat machUtilsBackendBinding_getPreferredSwapChainTextu
} // extern "C" } // extern "C"
#endif #endif
// TODO(mach-dawn-shims): everything below here is not wrapped // TODO(dawn-native-mach): everything below here is not wrapped
// #ifndef DAWNNATIVE_DAWNNATIVE_H_ // #ifndef DAWNNATIVE_DAWNNATIVE_H_
// #define DAWNNATIVE_DAWNNATIVE_H_ // #define DAWNNATIVE_DAWNNATIVE_H_