gpu: convert TextureView from enum(usize) to *opaque
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
5c5990a84f
commit
7f952545b9
5 changed files with 29 additions and 31 deletions
|
|
@ -13,7 +13,7 @@ pub const BindGroupEntry = extern struct {
|
|||
offset: u64,
|
||||
size: u64,
|
||||
sampler: ?Sampler,
|
||||
texture_view: TextureView = TextureView.none, // nullable
|
||||
texture_view: ?TextureView,
|
||||
};
|
||||
|
||||
pub const BindGroupDescriptor = extern struct {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ pub const ExternalTextureDescriptor = extern struct {
|
|||
next_in_chain: *const ChainedStruct,
|
||||
label: ?[*:0]const u8 = null,
|
||||
plane0: TextureView,
|
||||
plane1: TextureView = TextureView.none, // nullable
|
||||
plane1: ?TextureView,
|
||||
do_yuv_to_rgb_conversion_only: bool,
|
||||
yuv_to_rgb_conversion_matrix: ?[*]const f32 = null, // nullable
|
||||
src_transform_function_parameters: [*]const f32,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
const std = @import("std");
|
||||
const ChainedStruct = @import("types.zig").ChainedStruct;
|
||||
const TextureView = @import("texture_view.zig").TextureView;
|
||||
const TextureViewDimension = @import("texture_view.zig").TextureViewDimension;
|
||||
const Extent3D = @import("types.zig").Extent3D;
|
||||
|
||||
pub const Texture = enum(usize) {
|
||||
|
|
@ -165,7 +166,7 @@ pub const Texture = enum(usize) {
|
|||
pub const BindingLayout = extern struct {
|
||||
next_in_chain: *const ChainedStruct,
|
||||
sample_type: SampleType,
|
||||
view_dimension: TextureView.Dimension,
|
||||
view_dimension: TextureViewDimension,
|
||||
multisampled: bool,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,30 +1,26 @@
|
|||
const ChainedStruct = @import("types.zig").ChainedStruct;
|
||||
const Texture = @import("texture.zig").Texture;
|
||||
|
||||
pub const TextureView = enum(usize) {
|
||||
_,
|
||||
pub const TextureView = *opaque {};
|
||||
|
||||
pub const none: TextureView = @intToEnum(TextureView, 0);
|
||||
|
||||
pub const Dimension = enum(u32) {
|
||||
dimension_undef = 0x00000000,
|
||||
dimension_1d = 0x00000001,
|
||||
dimension_2d = 0x00000002,
|
||||
dimension_2d_array = 0x00000003,
|
||||
dimension_cube = 0x00000004,
|
||||
dimension_cube_array = 0x00000005,
|
||||
dimension_3d = 0x00000006,
|
||||
};
|
||||
|
||||
pub const Descriptor = extern struct {
|
||||
next_in_chain: *const ChainedStruct,
|
||||
label: ?[*:0]const u8 = null,
|
||||
format: Texture.Format,
|
||||
dimension: Dimension,
|
||||
base_mip_level: u32,
|
||||
mip_level_count: u32,
|
||||
base_array_layer: u32,
|
||||
array_layer_count: u32,
|
||||
aspect: Texture.Aspect,
|
||||
};
|
||||
pub const TextureViewDimension = enum(u32) {
|
||||
dimension_undef = 0x00000000,
|
||||
dimension_1d = 0x00000001,
|
||||
dimension_2d = 0x00000002,
|
||||
dimension_2d_array = 0x00000003,
|
||||
dimension_cube = 0x00000004,
|
||||
dimension_cube_array = 0x00000005,
|
||||
dimension_3d = 0x00000006,
|
||||
};
|
||||
|
||||
pub const TextureViewDescriptor = extern struct {
|
||||
next_in_chain: *const ChainedStruct,
|
||||
label: ?[*:0]const u8 = null,
|
||||
format: Texture.Format,
|
||||
dimension: TextureViewDimension,
|
||||
base_mip_level: u32,
|
||||
mip_level_count: u32,
|
||||
base_array_layer: u32,
|
||||
array_layer_count: u32,
|
||||
aspect: Texture.Aspect,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ const std = @import("std");
|
|||
const testing = std.testing;
|
||||
const Texture = @import("texture.zig").Texture;
|
||||
const TextureView = @import("texture_view.zig").TextureView;
|
||||
const TextureViewDimension = @import("texture_view.zig").TextureViewDimension;
|
||||
const Buffer = @import("buffer.zig").Buffer;
|
||||
const ShaderModule = @import("shader_module.zig").ShaderModule;
|
||||
|
||||
|
|
@ -502,7 +503,7 @@ pub const StorageTextureBindingLayout = extern struct {
|
|||
next_in_chain: *const ChainedStruct,
|
||||
access: StorageTextureAccess,
|
||||
format: Texture.Format,
|
||||
view_dimension: TextureView.Dimension,
|
||||
view_dimension: TextureViewDimension,
|
||||
};
|
||||
|
||||
pub const VertexAttribute = extern struct {
|
||||
|
|
@ -559,8 +560,8 @@ pub const ProgrammableStageDescriptor = extern struct {
|
|||
};
|
||||
|
||||
pub const RenderPassColorAttachment = extern struct {
|
||||
view: TextureView = TextureView.none, // nullable
|
||||
resolve_target: TextureView = TextureView.none, // nullable
|
||||
view: ?TextureView,
|
||||
resolve_target: ?TextureView,
|
||||
load_op: LoadOp,
|
||||
store_op: StoreOp,
|
||||
clear_color: Color,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue