gpu: convert *opaque -> opaque for Device
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
cd62412ec7
commit
862a555697
2 changed files with 36 additions and 36 deletions
|
|
@ -72,7 +72,7 @@ pub const Adapter = opaque {
|
|||
|
||||
pub const RequestDeviceCallback = fn (
|
||||
status: RequestDeviceStatus,
|
||||
device: Device,
|
||||
device: *Device,
|
||||
message: ?[*:0]const u8,
|
||||
userdata: *anyopaque,
|
||||
) callconv(.C) void;
|
||||
|
|
|
|||
|
|
@ -40,140 +40,140 @@ const CreateComputePipelineAsyncCallback = @import("types.zig").CreateComputePip
|
|||
const CreateRenderPipelineAsyncCallback = @import("types.zig").CreateRenderPipelineAsyncCallback;
|
||||
const Impl = @import("interface.zig").Impl;
|
||||
|
||||
pub const Device = *opaque {
|
||||
pub inline fn createBindGroup(device: Device, descriptor: *const BindGroupDescriptor) BindGroup {
|
||||
pub const Device = opaque {
|
||||
pub inline fn createBindGroup(device: *Device, descriptor: *const BindGroupDescriptor) BindGroup {
|
||||
return Impl.deviceCreateBindGroup(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createBindGroupLayout(device: Device, descriptor: *const BindGroupLayout.Descriptor) *BindGroupLayout {
|
||||
pub inline fn createBindGroupLayout(device: *Device, descriptor: *const BindGroupLayout.Descriptor) *BindGroupLayout {
|
||||
return Impl.deviceCreateBindGroupLayout(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createBuffer(device: Device, descriptor: *const BufferDescriptor) *Buffer {
|
||||
pub inline fn createBuffer(device: *Device, descriptor: *const BufferDescriptor) *Buffer {
|
||||
return Impl.deviceCreateBuffer(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createCommandEncoder(device: Device, descriptor: ?*const CommandEncoderDescriptor) *CommandEncoder {
|
||||
pub inline fn createCommandEncoder(device: *Device, descriptor: ?*const CommandEncoderDescriptor) *CommandEncoder {
|
||||
return Impl.deviceCreateCommandEncoder(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createComputePipeline(device: Device, descriptor: *const ComputePipelineDescriptor) *ComputePipeline {
|
||||
pub inline fn createComputePipeline(device: *Device, descriptor: *const ComputePipelineDescriptor) *ComputePipeline {
|
||||
return Impl.deviceCreateComputePipeline(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createComputePipelineAsync(device: Device, descriptor: *const ComputePipelineDescriptor, callback: CreateComputePipelineAsyncCallback, userdata: *anyopaque) void {
|
||||
pub inline fn createComputePipelineAsync(device: *Device, descriptor: *const ComputePipelineDescriptor, callback: CreateComputePipelineAsyncCallback, userdata: *anyopaque) void {
|
||||
Impl.deviceCreateComputePipelineAsync(device, descriptor, callback, userdata);
|
||||
}
|
||||
|
||||
pub inline fn createErrorBuffer(device: Device) *Buffer {
|
||||
pub inline fn createErrorBuffer(device: *Device) *Buffer {
|
||||
return Impl.deviceCreateErrorBuffer(device);
|
||||
}
|
||||
|
||||
pub inline fn createErrorExternalTexture(device: Device) ExternalTexture {
|
||||
pub inline fn createErrorExternalTexture(device: *Device) ExternalTexture {
|
||||
return Impl.deviceCreateErrorExternalTexture(device);
|
||||
}
|
||||
|
||||
pub inline fn createExternalTexture(device: Device, external_texture_descriptor: *const ExternalTextureDescriptor) ExternalTexture {
|
||||
pub inline fn createExternalTexture(device: *Device, external_texture_descriptor: *const ExternalTextureDescriptor) ExternalTexture {
|
||||
return Impl.deviceCreateExternalTexture(device, external_texture_descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createPipelineLayout(device: Device, pipeline_layout_descriptor: *const PipelineLayoutDescriptor) PipelineLayout {
|
||||
pub inline fn createPipelineLayout(device: *Device, pipeline_layout_descriptor: *const PipelineLayoutDescriptor) PipelineLayout {
|
||||
return Impl.deviceCreatePipelineLayout(device, pipeline_layout_descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createQuerySet(device: Device, descriptor: *const QuerySetDescriptor) QuerySet {
|
||||
pub inline fn createQuerySet(device: *Device, descriptor: *const QuerySetDescriptor) QuerySet {
|
||||
return Impl.deviceCreateQuerySet(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createRenderBundleEncoder(device: Device, descriptor: *const RenderBundleEncoderDescriptor) RenderBundleEncoder {
|
||||
pub inline fn createRenderBundleEncoder(device: *Device, descriptor: *const RenderBundleEncoderDescriptor) RenderBundleEncoder {
|
||||
return Impl.deviceCreateRenderBundleEncoder(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createRenderPipeline(device: Device, descriptor: *const RenderPipelineDescriptor) RenderPipeline {
|
||||
pub inline fn createRenderPipeline(device: *Device, descriptor: *const RenderPipelineDescriptor) RenderPipeline {
|
||||
return Impl.deviceCreateRenderPipeline(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createRenderPipelineAsync(device: Device, descriptor: *const RenderPipelineDescriptor, callback: CreateRenderPipelineAsyncCallback, userdata: *anyopaque) void {
|
||||
pub inline fn createRenderPipelineAsync(device: *Device, descriptor: *const RenderPipelineDescriptor, callback: CreateRenderPipelineAsyncCallback, userdata: *anyopaque) void {
|
||||
Impl.deviceCreateRenderPipelineAsync(device, descriptor, callback, userdata);
|
||||
}
|
||||
|
||||
pub inline fn createSampler(device: Device, descriptor: ?*const SamplerDescriptor) Sampler {
|
||||
pub inline fn createSampler(device: *Device, descriptor: ?*const SamplerDescriptor) Sampler {
|
||||
return Impl.deviceCreateSampler(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createShaderModule(device: Device, descriptor: *const ShaderModuleDescriptor) ShaderModule {
|
||||
pub inline fn createShaderModule(device: *Device, descriptor: *const ShaderModuleDescriptor) ShaderModule {
|
||||
return Impl.deviceCreateShaderModule(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createSwapChain(device: Device, surface: ?Surface, descriptor: *const SwapChainDescriptor) SwapChain {
|
||||
pub inline fn createSwapChain(device: *Device, surface: ?Surface, descriptor: *const SwapChainDescriptor) SwapChain {
|
||||
return Impl.deviceCreateSwapChain(device, surface, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn createTexture(device: Device, descriptor: *const TextureDescriptor) Texture {
|
||||
pub inline fn createTexture(device: *Device, descriptor: *const TextureDescriptor) Texture {
|
||||
return Impl.deviceCreateTexture(device, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn destroy(device: Device) void {
|
||||
pub inline fn destroy(device: *Device) void {
|
||||
Impl.deviceDestroy(device);
|
||||
}
|
||||
|
||||
pub inline fn enumerateFeatures(device: Device, features: [*]FeatureName) usize {
|
||||
pub inline fn enumerateFeatures(device: *Device, features: [*]FeatureName) usize {
|
||||
return Impl.deviceEnumerateFeatures(device, features);
|
||||
}
|
||||
|
||||
pub inline fn getLimits(device: Device, limits: *SupportedLimits) bool {
|
||||
pub inline fn getLimits(device: *Device, limits: *SupportedLimits) bool {
|
||||
return Impl.deviceGetLimits(device, limits);
|
||||
}
|
||||
|
||||
pub inline fn getQueue(device: Device) Queue {
|
||||
pub inline fn getQueue(device: *Device) Queue {
|
||||
return Impl.deviceGetQueue(device);
|
||||
}
|
||||
|
||||
pub inline fn hasFeature(device: Device, feature: FeatureName) bool {
|
||||
pub inline fn hasFeature(device: *Device, feature: FeatureName) bool {
|
||||
return Impl.deviceHasFeature(device, feature);
|
||||
}
|
||||
|
||||
pub inline fn injectError(device: Device, typ: ErrorType, message: [*:0]const u8) void {
|
||||
pub inline fn injectError(device: *Device, typ: ErrorType, message: [*:0]const u8) void {
|
||||
Impl.deviceInjectError(device, typ, message);
|
||||
}
|
||||
|
||||
pub inline fn loseForTesting(device: Device) void {
|
||||
pub inline fn loseForTesting(device: *Device) void {
|
||||
Impl.deviceLoseForTesting(device);
|
||||
}
|
||||
|
||||
pub inline fn popErrorScope(device: Device, callback: ErrorCallback, userdata: *anyopaque) bool {
|
||||
pub inline fn popErrorScope(device: *Device, callback: ErrorCallback, userdata: *anyopaque) bool {
|
||||
return Impl.devicePopErrorScope(device, callback, userdata);
|
||||
}
|
||||
|
||||
pub inline fn pushErrorScope(device: Device, filter: ErrorFilter) void {
|
||||
pub inline fn pushErrorScope(device: *Device, filter: ErrorFilter) void {
|
||||
Impl.devicePushErrorScope(device, filter);
|
||||
}
|
||||
|
||||
pub inline fn setDeviceLostCallback(device: Device, callback: DeviceLostCallback, userdata: *anyopaque) void {
|
||||
pub inline fn setDeviceLostCallback(device: *Device, callback: DeviceLostCallback, userdata: *anyopaque) void {
|
||||
Impl.deviceSetDeviceLostCallback(device, callback, userdata);
|
||||
}
|
||||
|
||||
pub inline fn setLabel(device: Device, label: [*:0]const u8) void {
|
||||
pub inline fn setLabel(device: *Device, label: [*:0]const u8) void {
|
||||
Impl.deviceSetLabel(device, label);
|
||||
}
|
||||
|
||||
pub inline fn setLoggingCallback(device: Device, callback: LoggingCallback, userdata: *anyopaque) void {
|
||||
pub inline fn setLoggingCallback(device: *Device, callback: LoggingCallback, userdata: *anyopaque) void {
|
||||
Impl.deviceSetLoggingCallback(device, callback, userdata);
|
||||
}
|
||||
|
||||
pub inline fn setUncapturedErrorCallback(device: Device, callback: ErrorCallback, userdata: *anyopaque) void {
|
||||
pub inline fn setUncapturedErrorCallback(device: *Device, callback: ErrorCallback, userdata: *anyopaque) void {
|
||||
Impl.deviceSetUncapturedErrorCallback(device, callback, userdata);
|
||||
}
|
||||
|
||||
pub inline fn tick(device: Device) void {
|
||||
pub inline fn tick(device: *Device) void {
|
||||
Impl.deviceTick(device);
|
||||
}
|
||||
|
||||
pub inline fn reference(device: Device) void {
|
||||
pub inline fn reference(device: *Device) void {
|
||||
Impl.deviceReference(device);
|
||||
}
|
||||
|
||||
pub inline fn release(device: Device) void {
|
||||
pub inline fn release(device: *Device) void {
|
||||
Impl.deviceRelease(device);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue