gpu: begin plotting how to wrap a WGPUInstance
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
5f7fe4d7e2
commit
5656d3252a
3 changed files with 9 additions and 14 deletions
|
|
@ -7,12 +7,17 @@ pub fn build(b: *std.build.Builder) void {
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
|
|
||||||
const lib = b.addStaticLibrary("gpu", "src/main.zig");
|
const lib = b.addStaticLibrary("gpu", "src/main.zig");
|
||||||
|
lib.setTarget(target);
|
||||||
lib.setBuildMode(mode);
|
lib.setBuildMode(mode);
|
||||||
lib.install();
|
lib.install();
|
||||||
|
glfw.link(b, lib, .{});
|
||||||
gpu_dawn.link(b, lib, .{});
|
gpu_dawn.link(b, lib, .{});
|
||||||
|
|
||||||
const main_tests = b.addTest("src/main.zig");
|
const main_tests = b.addTest("src/main.zig");
|
||||||
|
main_tests.setTarget(target);
|
||||||
main_tests.setBuildMode(mode);
|
main_tests.setBuildMode(mode);
|
||||||
|
glfw.link(b, main_tests, .{});
|
||||||
|
gpu_dawn.link(b, main_tests, .{});
|
||||||
|
|
||||||
const test_step = b.step("test", "Run library tests");
|
const test_step = b.step("test", "Run library tests");
|
||||||
test_step.dependOn(&main_tests.step);
|
test_step.dependOn(&main_tests.step);
|
||||||
|
|
|
||||||
12
gpu/src/TODO
12
gpu/src/TODO
|
|
@ -17,7 +17,6 @@ typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder;
|
||||||
typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder;
|
typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder;
|
||||||
typedef struct WGPUComputePipelineImpl* WGPUComputePipeline;
|
typedef struct WGPUComputePipelineImpl* WGPUComputePipeline;
|
||||||
typedef struct WGPUExternalTextureImpl* WGPUExternalTexture;
|
typedef struct WGPUExternalTextureImpl* WGPUExternalTexture;
|
||||||
typedef struct WGPUInstanceImpl* WGPUInstance;
|
|
||||||
typedef struct WGPUPipelineLayoutImpl* WGPUPipelineLayout;
|
typedef struct WGPUPipelineLayoutImpl* WGPUPipelineLayout;
|
||||||
typedef struct WGPUQuerySetImpl* WGPUQuerySet;
|
typedef struct WGPUQuerySetImpl* WGPUQuerySet;
|
||||||
typedef struct WGPUQueueImpl* WGPUQueue;
|
typedef struct WGPUQueueImpl* WGPUQueue;
|
||||||
|
|
@ -738,10 +737,6 @@ typedef struct WGPUExternalTextureDescriptor {
|
||||||
WGPUPredefinedColorSpace colorSpace;
|
WGPUPredefinedColorSpace colorSpace;
|
||||||
} WGPUExternalTextureDescriptor;
|
} WGPUExternalTextureDescriptor;
|
||||||
|
|
||||||
typedef struct WGPUInstanceDescriptor {
|
|
||||||
WGPUChainedStruct const * nextInChain;
|
|
||||||
} WGPUInstanceDescriptor;
|
|
||||||
|
|
||||||
typedef struct WGPUMultisampleState {
|
typedef struct WGPUMultisampleState {
|
||||||
WGPUChainedStruct const * nextInChain;
|
WGPUChainedStruct const * nextInChain;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
|
|
@ -1164,7 +1159,6 @@ typedef void (*WGPUQueueWorkDoneCallback)(WGPUQueueWorkDoneStatus status, void *
|
||||||
typedef void (*WGPURequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, void * userdata);
|
typedef void (*WGPURequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, void * userdata);
|
||||||
typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, void * userdata);
|
typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, void * userdata);
|
||||||
|
|
||||||
WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPUInstanceDescriptor const * descriptor);
|
|
||||||
WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUDevice device, char const * procName);
|
WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUDevice device, char const * procName);
|
||||||
|
|
||||||
// Methods of BindGroup
|
// Methods of BindGroup
|
||||||
|
|
@ -1240,12 +1234,6 @@ WGPU_EXPORT void wgpuExternalTextureSetLabel(WGPUExternalTexture externalTexture
|
||||||
WGPU_EXPORT void wgpuExternalTextureReference(WGPUExternalTexture externalTexture);
|
WGPU_EXPORT void wgpuExternalTextureReference(WGPUExternalTexture externalTexture);
|
||||||
WGPU_EXPORT void wgpuExternalTextureRelease(WGPUExternalTexture externalTexture);
|
WGPU_EXPORT void wgpuExternalTextureRelease(WGPUExternalTexture externalTexture);
|
||||||
|
|
||||||
// Methods of Instance
|
|
||||||
WGPU_EXPORT WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor);
|
|
||||||
WGPU_EXPORT void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata);
|
|
||||||
WGPU_EXPORT void wgpuInstanceReference(WGPUInstance instance);
|
|
||||||
WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance);
|
|
||||||
|
|
||||||
// Methods of PipelineLayout
|
// Methods of PipelineLayout
|
||||||
WGPU_EXPORT void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, char const * label);
|
WGPU_EXPORT void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, char const * label);
|
||||||
WGPU_EXPORT void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout);
|
WGPU_EXPORT void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
//! A native webgpu.h implementation of the gpu.Interface
|
//! A native webgpu.h implementation of the gpu.Interface
|
||||||
|
const c = @import("c.zig").c;
|
||||||
const Interface = @import("Interface.zig");
|
const Interface = @import("Interface.zig");
|
||||||
|
|
||||||
/// Returns a native webgpu.h implementation of the gpu.Interface
|
/// Returns a native webgpu.h implementation of the gpu.Interface, wrapping the given WGPUInstance.
|
||||||
pub fn native() Interface {
|
pub fn native(instance: c.WGPUInstance) Interface {
|
||||||
// TODO: implement Interface
|
// TODO: implement Interface
|
||||||
|
_ = instance;
|
||||||
@panic("not implemented");
|
@panic("not implemented");
|
||||||
|
|
||||||
// TODO: implement Device interface
|
// TODO: implement Device interface
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue