gpu: convert Surface from enum(usize) to *opaque
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
8719bab867
commit
b95f0cc41a
2 changed files with 48 additions and 53 deletions
|
|
@ -72,7 +72,7 @@ pub const RenderPassTimestampWrite = extern struct {
|
||||||
|
|
||||||
pub const RequestAdapterOptions = extern struct {
|
pub const RequestAdapterOptions = extern struct {
|
||||||
next_in_chain: *const types.ChainedStruct,
|
next_in_chain: *const types.ChainedStruct,
|
||||||
compatible_surface: surface.Surface = surface.Surface.none, // nullable
|
compatible_surface: ?surface.Surface,
|
||||||
power_preference: types.PowerPreference,
|
power_preference: types.PowerPreference,
|
||||||
force_fallback_adapter: bool,
|
force_fallback_adapter: bool,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,56 +1,51 @@
|
||||||
const ChainedStruct = @import("types.zig").ChainedStruct;
|
const ChainedStruct = @import("types.zig").ChainedStruct;
|
||||||
|
|
||||||
pub const Surface = enum(usize) {
|
pub const Surface = *opaque {};
|
||||||
_,
|
|
||||||
|
|
||||||
// TODO: verify there is a use case for nullable value of this type.
|
pub const SurfaceDescriptor = extern struct {
|
||||||
pub const none: Surface = @intToEnum(Surface, 0);
|
next_in_chain: *const ChainedStruct,
|
||||||
|
label: ?[*:0]const u8 = null,
|
||||||
pub const Descriptor = extern struct {
|
};
|
||||||
next_in_chain: *const ChainedStruct,
|
|
||||||
label: ?[*:0]const u8 = null,
|
pub const SurfaceDescriptorFromAndroidNativeWindow = extern struct {
|
||||||
};
|
chain: ChainedStruct,
|
||||||
|
window: *anyopaque,
|
||||||
pub const DescriptorFromAndroidNativeWindow = extern struct {
|
};
|
||||||
chain: ChainedStruct,
|
|
||||||
window: *anyopaque,
|
pub const SurfaceDescriptorFromCanvasHTMLSelector = extern struct {
|
||||||
};
|
chain: ChainedStruct,
|
||||||
|
selector: [*:0]const u8,
|
||||||
pub const DescriptorFromCanvasHTMLSelector = extern struct {
|
};
|
||||||
chain: ChainedStruct,
|
|
||||||
selector: [*:0]const u8,
|
pub const SurfaceDescriptorFromMetalLayer = extern struct {
|
||||||
};
|
chain: ChainedStruct,
|
||||||
|
layer: *anyopaque,
|
||||||
pub const DescriptorFromMetalLayer = extern struct {
|
};
|
||||||
chain: ChainedStruct,
|
|
||||||
layer: *anyopaque,
|
pub const SurfaceDescriptorFromWaylandSurface = extern struct {
|
||||||
};
|
chain: ChainedStruct,
|
||||||
|
display: *anyopaque,
|
||||||
pub const DescriptorFromWaylandSurface = extern struct {
|
surface: *anyopaque,
|
||||||
chain: ChainedStruct,
|
};
|
||||||
display: *anyopaque,
|
|
||||||
surface: *anyopaque,
|
pub const SurfaceDescriptorFromWindowsCoreWindow = extern struct {
|
||||||
};
|
chain: ChainedStruct,
|
||||||
|
core_window: *anyopaque,
|
||||||
pub const DescriptorFromWindowsCoreWindow = extern struct {
|
};
|
||||||
chain: ChainedStruct,
|
|
||||||
core_window: *anyopaque,
|
pub const SurfaceDescriptorFromWindowsHWND = extern struct {
|
||||||
};
|
chain: ChainedStruct,
|
||||||
|
hinstance: *anyopaque,
|
||||||
pub const DescriptorFromWindowsHWND = extern struct {
|
hwnd: *anyopaque,
|
||||||
chain: ChainedStruct,
|
};
|
||||||
hinstance: *anyopaque,
|
|
||||||
hwnd: *anyopaque,
|
pub const SurfaceDescriptorFromWindowsSwapChainPanel = extern struct {
|
||||||
};
|
chain: ChainedStruct,
|
||||||
|
swap_chain_panel: *anyopaque,
|
||||||
pub const DescriptorFromWindowsSwapChainPanel = extern struct {
|
};
|
||||||
chain: ChainedStruct,
|
|
||||||
swap_chain_panel: *anyopaque,
|
pub const SurfaceDescriptorFromXlibWindow = extern struct {
|
||||||
};
|
chain: ChainedStruct,
|
||||||
|
display: *anyopaque,
|
||||||
pub const DescriptorFromXlibWindow = extern struct {
|
window: u32,
|
||||||
chain: ChainedStruct,
|
|
||||||
display: *anyopaque,
|
|
||||||
window: u32,
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue