gpu: add PipelineLayout.Descriptor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
3ec84f516a
commit
d19c868fb6
3 changed files with 24 additions and 14 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
const Texture = @import("Texture.zig");
|
||||||
|
const PredefinedColorSpace = @import("enums.zig").PredefinedColorSpace;
|
||||||
|
|
||||||
const ExternalTexture = @This();
|
const ExternalTexture = @This();
|
||||||
|
|
||||||
/// The type erased pointer to the ExternalTexture implementation
|
/// The type erased pointer to the ExternalTexture implementation
|
||||||
|
|
@ -28,9 +31,17 @@ pub inline fn destroy(texture: ExternalTexture) void {
|
||||||
texture.vtable.destroy(texture.ptr);
|
texture.vtable.destroy(texture.ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const Descriptor = struct {
|
||||||
|
label: ?[*:0]const u8 = null,
|
||||||
|
plane0: Texture.View,
|
||||||
|
plane1: Texture.View,
|
||||||
|
color_space: PredefinedColorSpace,
|
||||||
|
};
|
||||||
|
|
||||||
test "syntax" {
|
test "syntax" {
|
||||||
_ = VTable;
|
_ = VTable;
|
||||||
_ = reference;
|
_ = reference;
|
||||||
_ = release;
|
_ = release;
|
||||||
_ = destroy;
|
_ = destroy;
|
||||||
|
_ = Descriptor;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
const BindGroup = @import("BindGroup.zig");
|
||||||
|
|
||||||
const PipelineLayout = @This();
|
const PipelineLayout = @This();
|
||||||
|
|
||||||
/// The type erased pointer to the PipelineLayout implementation
|
/// The type erased pointer to the PipelineLayout implementation
|
||||||
|
|
@ -23,8 +25,14 @@ pub inline fn setLabel(qset: PipelineLayout, label: [:0]const u8) void {
|
||||||
qset.vtable.setLabel(qset.ptr, label);
|
qset.vtable.setLabel(qset.ptr, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const Descriptor = struct {
|
||||||
|
label: ?[*:0]const u8 = null,
|
||||||
|
bind_group_layouts: []const BindGroup.Layout,
|
||||||
|
};
|
||||||
|
|
||||||
test "syntax" {
|
test "syntax" {
|
||||||
_ = VTable;
|
_ = VTable;
|
||||||
_ = reference;
|
_ = reference;
|
||||||
_ = release;
|
_ = release;
|
||||||
|
_ = Descriptor;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19
gpu/src/TODO
19
gpu/src/TODO
|
|
@ -21,28 +21,32 @@ typedef struct WGPUChainedStructOut {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: Dawn specific
|
||||||
typedef struct WGPUDawnCacheDeviceDescriptor {
|
typedef struct WGPUDawnCacheDeviceDescriptor {
|
||||||
WGPUChainedStruct chain;
|
WGPUChainedStruct chain;
|
||||||
char const * isolationKey;
|
char const * isolationKey;
|
||||||
} WGPUDawnCacheDeviceDescriptor;
|
} WGPUDawnCacheDeviceDescriptor;
|
||||||
|
|
||||||
|
// TODO: Dawn specific
|
||||||
typedef struct WGPUDawnEncoderInternalUsageDescriptor {
|
typedef struct WGPUDawnEncoderInternalUsageDescriptor {
|
||||||
WGPUChainedStruct chain;
|
WGPUChainedStruct chain;
|
||||||
bool useInternalUsages;
|
bool useInternalUsages;
|
||||||
} WGPUDawnEncoderInternalUsageDescriptor;
|
} WGPUDawnEncoderInternalUsageDescriptor;
|
||||||
|
|
||||||
|
// TODO: Dawn specific
|
||||||
typedef struct WGPUDawnInstanceDescriptor {
|
typedef struct WGPUDawnInstanceDescriptor {
|
||||||
WGPUChainedStruct chain;
|
WGPUChainedStruct chain;
|
||||||
uint32_t additionalRuntimeSearchPathsCount;
|
uint32_t additionalRuntimeSearchPathsCount;
|
||||||
const char* const * additionalRuntimeSearchPaths;
|
const char* const * additionalRuntimeSearchPaths;
|
||||||
} WGPUDawnInstanceDescriptor;
|
} WGPUDawnInstanceDescriptor;
|
||||||
|
|
||||||
|
// TODO: Dawn specific
|
||||||
typedef struct WGPUDawnTextureInternalUsageDescriptor {
|
typedef struct WGPUDawnTextureInternalUsageDescriptor {
|
||||||
WGPUChainedStruct chain;
|
WGPUChainedStruct chain;
|
||||||
WGPUTextureUsageFlags internalUsage;
|
WGPUTextureUsageFlags internalUsage;
|
||||||
} WGPUDawnTextureInternalUsageDescriptor;
|
} WGPUDawnTextureInternalUsageDescriptor;
|
||||||
|
|
||||||
|
// TODO: Dawn specific
|
||||||
typedef struct WGPUDawnTogglesDeviceDescriptor {
|
typedef struct WGPUDawnTogglesDeviceDescriptor {
|
||||||
WGPUChainedStruct chain;
|
WGPUChainedStruct chain;
|
||||||
uint32_t forceEnabledTogglesCount;
|
uint32_t forceEnabledTogglesCount;
|
||||||
|
|
@ -51,20 +55,7 @@ typedef struct WGPUDawnTogglesDeviceDescriptor {
|
||||||
const char* const * forceDisabledToggles;
|
const char* const * forceDisabledToggles;
|
||||||
} WGPUDawnTogglesDeviceDescriptor;
|
} WGPUDawnTogglesDeviceDescriptor;
|
||||||
|
|
||||||
typedef struct WGPUExternalTextureDescriptor {
|
|
||||||
WGPUChainedStruct const * nextInChain;
|
|
||||||
char const * label;
|
|
||||||
WGPUTextureView plane0;
|
|
||||||
WGPUTextureView plane1;
|
|
||||||
WGPUPredefinedColorSpace colorSpace;
|
|
||||||
} WGPUExternalTextureDescriptor;
|
|
||||||
|
|
||||||
typedef struct WGPUPipelineLayoutDescriptor {
|
|
||||||
WGPUChainedStruct const * nextInChain;
|
|
||||||
char const * label;
|
|
||||||
uint32_t bindGroupLayoutCount;
|
|
||||||
WGPUBindGroupLayout const * bindGroupLayouts;
|
|
||||||
} WGPUPipelineLayoutDescriptor;
|
|
||||||
|
|
||||||
typedef struct WGPUQuerySetDescriptor {
|
typedef struct WGPUQuerySetDescriptor {
|
||||||
WGPUChainedStruct const * nextInChain;
|
WGPUChainedStruct const * nextInChain;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue