mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 16:24:24 +00:00
64 lines
1.4 KiB
C
64 lines
1.4 KiB
C
#ifdef WGPU_REMOTE
|
|
typedef uint32_t WGPUId;
|
|
#else
|
|
typedef void *WGPUId;
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
#include <stdbool.h>
|
|
|
|
typedef enum {
|
|
WGPUPowerPreference_Default = 0,
|
|
WGPUPowerPreference_LowPower = 1,
|
|
WGPUPowerPreference_HighPerformance = 2,
|
|
} WGPUPowerPreference;
|
|
|
|
typedef WGPUId WGPUDeviceId;
|
|
|
|
typedef WGPUId WGPUAdapterId;
|
|
|
|
typedef struct {
|
|
bool anisotropic_filtering;
|
|
} WGPUExtensions;
|
|
|
|
typedef struct {
|
|
WGPUExtensions extensions;
|
|
} WGPUDeviceDescriptor;
|
|
|
|
typedef WGPUId WGPUComputePassId;
|
|
|
|
typedef WGPUId WGPURenderPassId;
|
|
|
|
typedef WGPUId WGPUCommandBufferId;
|
|
|
|
typedef WGPUId WGPUInstanceId;
|
|
|
|
typedef WGPUId WGPUShaderModuleId;
|
|
|
|
typedef struct {
|
|
const uint8_t *bytes;
|
|
uintptr_t length;
|
|
} WGPUByteArray;
|
|
|
|
typedef struct {
|
|
WGPUByteArray code;
|
|
} WGPUShaderModuleDescriptor;
|
|
|
|
typedef struct {
|
|
WGPUPowerPreference power_preference;
|
|
} WGPUAdapterDescriptor;
|
|
|
|
WGPUDeviceId wgpu_adapter_create_device(WGPUAdapterId adapter_id, WGPUDeviceDescriptor desc);
|
|
|
|
WGPUComputePassId wgpu_command_buffer_begin_compute_pass(void);
|
|
|
|
WGPURenderPassId wgpu_command_buffer_begin_render_pass(WGPUCommandBufferId command_buffer);
|
|
|
|
WGPUInstanceId wgpu_create_instance(void);
|
|
|
|
WGPUShaderModuleId wgpu_device_create_shader_module(WGPUDeviceId device_id,
|
|
WGPUShaderModuleDescriptor desc);
|
|
|
|
WGPUAdapterId wgpu_instance_get_adapter(WGPUInstanceId instance_id, WGPUAdapterDescriptor desc);
|