From 1d07d1784e622d22ec317bddb469c11e6624e23c Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 24 Jul 2022 14:51:35 -0700 Subject: [PATCH] gpu: convert ExternalTexture from enum(usize) to *opaque Signed-off-by: Stephen Gutekanst --- gpu/src/external_texture.zig | 45 ++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/gpu/src/external_texture.zig b/gpu/src/external_texture.zig index 3a3f4237..f2ccd25c 100644 --- a/gpu/src/external_texture.zig +++ b/gpu/src/external_texture.zig @@ -1,30 +1,25 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const TextureView = @import("texture_view.zig").TextureView; -pub const ExternalTexture = enum(usize) { - _, +pub const ExternalTexture = *opaque {}; - // TODO: verify there is a use case for nullable value of this type. - pub const none: ExternalTexture = @intToEnum(ExternalTexture, 0); - - pub const BindingEntry = extern struct { - chain: ChainedStruct, - external_texture: ExternalTexture, - }; - - pub const BindingLayout = extern struct { - chain: ChainedStruct, - }; - - pub const Descriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, - plane0: TextureView, - plane1: TextureView = TextureView.none, // nullable - do_yuv_to_rgb_conversion_only: bool, - yuv_to_rgb_conversion_matrix: ?[*]const f32 = null, // nullable - src_transform_function_parameters: [*]const f32, - dst_transform_function_parameters: [*]const f32, - gamut_conversion_matrix: [*]const f32, - }; +pub const ExternalTextureBindingEntry = extern struct { + chain: ChainedStruct, + external_texture: ExternalTexture, +}; + +pub const ExternalTextureBindingLayout = extern struct { + chain: ChainedStruct, +}; + +pub const ExternalTextureDescriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + plane0: TextureView, + plane1: TextureView = TextureView.none, // nullable + do_yuv_to_rgb_conversion_only: bool, + yuv_to_rgb_conversion_matrix: ?[*]const f32 = null, // nullable + src_transform_function_parameters: [*]const f32, + dst_transform_function_parameters: [*]const f32, + gamut_conversion_matrix: [*]const f32, };