gpu: begin Dawn gpu.Interface implementation

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-30 14:46:02 -07:00 committed by Stephen Gutekanst
parent 75a09c7828
commit e702ee4911
4 changed files with 1285 additions and 0 deletions

View file

@ -1,5 +1,6 @@
const ChainedStruct = @import("types.zig").ChainedStruct;
const Texture = @import("texture.zig").Texture;
pub const Interface = @import("dawn_impl.zig").Interface;
pub const CacheDeviceDescriptor = extern struct {
chain: ChainedStruct,

1235
gpu/src/dawn_impl.zig Normal file

File diff suppressed because it is too large Load diff

14
gpu/src/mach_dawn.cpp Normal file
View file

@ -0,0 +1,14 @@
#include <dawn/native/DawnNative.h>
#include "dawn_native_mach.h"
#ifdef __cplusplus
extern "C" {
#endif
MACH_EXPORT const DawnProcTable machDawnGetProcTable() {
return dawn_native::GetProcs();
}
#ifdef __cplusplus
} // extern "C"
#endif

35
gpu/src/mach_dawn.h Normal file
View file

@ -0,0 +1,35 @@
#ifndef MACH_DAWN_C_H_
#define MACH_DAWN_C_H_
#ifdef __cplusplus
extern "C" {
#endif
#if defined(MACH_DAWN_C_SHARED_LIBRARY)
# if defined(_WIN32)
# if defined(MACH_DAWN_C_IMPLEMENTATION)
# define MACH_EXPORT __declspec(dllexport)
# else
# define MACH_EXPORT __declspec(dllimport)
# endif
# else // defined(_WIN32)
# if defined(MACH_DAWN_C_IMPLEMENTATION)
# define MACH_EXPORT __attribute__((visibility("default")))
# else
# define MACH_EXPORT
# endif
# endif // defined(_WIN32)
#else // defined(MACH_DAWN_C_SHARED_LIBRARY)
# define MACH_EXPORT
#endif // defined(MACH_DAWN_C_SHARED_LIBRARY)
#include <dawn/webgpu.h>
#include <dawn/dawn_proc_table.h>
MACH_EXPORT const DawnProcTable machDawnGetProcTable();
#ifdef __cplusplus
} // extern "C"
#endif
#endif // MACH_DAWN_C_H_