From 3d0051e7202375ca2c0d36c2d1ad6d9bc033e540 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 24 Jul 2022 14:53:29 -0700 Subject: [PATCH] gpu: convert QuerySet from enum(usize) to *opaque Signed-off-by: Stephen Gutekanst --- gpu/src/main.zig | 2 +- gpu/src/query_set.zig | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/gpu/src/main.zig b/gpu/src/main.zig index e7515e78..76755ab0 100644 --- a/gpu/src/main.zig +++ b/gpu/src/main.zig @@ -90,7 +90,7 @@ pub const RenderPassDescriptor = extern struct { color_attachment_count: u32, color_attachments: [*]const types.RenderPassColorAttachment, depth_stencil_attachment: ?[*]const RenderPassDepthStencilAttachment = null, // nullable - occlusion_query_set: query_set.QuerySet = query_set.QuerySet.none, // nullable + occlusion_query_set: ?query_set.QuerySet, timestamp_write_count: u32, timestamp_writes: [*]const RenderPassTimestampWrite, }; diff --git a/gpu/src/query_set.zig b/gpu/src/query_set.zig index 023192d8..f354f77f 100644 --- a/gpu/src/query_set.zig +++ b/gpu/src/query_set.zig @@ -2,18 +2,13 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const PipelineStatisticName = @import("types.zig").PipelineStatisticName; const QueryType = @import("types.zig").QueryType; -pub const QuerySet = enum(usize) { - _, +pub const QuerySet = *opaque {}; - // TODO: verify there is a use case for nullable value of this type. - pub const none: QuerySet = @intToEnum(QuerySet, 0); - - pub const Descriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, - type: QueryType, - count: u32, - pipeline_statistics: [*]const PipelineStatisticName, - pipeline_statistics_count: u32, - }; +pub const QuerySetDescriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + type: QueryType, + count: u32, + pipeline_statistics: [*]const PipelineStatisticName, + pipeline_statistics_count: u32, };