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