Skip to content

Commit

Permalink
add a todo for occlusion_query_set
Browse files Browse the repository at this point in the history
  • Loading branch information
rajveermalviya committed Sep 30, 2023
1 parent 6020389 commit c7c7174
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use conv::{
map_device_descriptor, map_instance_backend_flags, map_instance_descriptor,
map_pipeline_layout_descriptor, map_primitive_state, map_shader_module, map_surface,
map_query_set_index,
CreateSurfaceParams,
map_pipeline_layout_descriptor, map_primitive_state, map_query_set_index, map_shader_module,
map_surface, CreateSurfaceParams,
};
use parking_lot::{Mutex, RwLock};
use smallvec::SmallVec;
Expand Down Expand Up @@ -997,19 +996,25 @@ pub unsafe extern "C" fn wgpuCommandEncoderBeginComputePass(
)
};

let timestamp_writes = descriptor.map(|descriptor| {
descriptor.timestampWrites.as_ref().map(|timestamp_write| {
wgc::command::ComputePassTimestampWrites {
query_set:
timestamp_write.querySet
.as_ref()
.expect("invalid query set in timestamp writes")
.id,
beginning_of_pass_write_index: map_query_set_index(timestamp_write.beginningOfPassWriteIndex),
end_of_pass_write_index: map_query_set_index(timestamp_write.endOfPassWriteIndex),
}
let timestamp_writes = descriptor
.map(|descriptor| {
descriptor.timestampWrites.as_ref().map(|timestamp_write| {
wgc::command::ComputePassTimestampWrites {
query_set: timestamp_write
.querySet
.as_ref()
.expect("invalid query set in timestamp writes")
.id,
beginning_of_pass_write_index: map_query_set_index(
timestamp_write.beginningOfPassWriteIndex,
),
end_of_pass_write_index: map_query_set_index(
timestamp_write.endOfPassWriteIndex,
),
}
})
})
}).flatten();
.flatten();

let desc = match descriptor {
Some(descriptor) => wgc::command::ComputePassDescriptor {
Expand Down Expand Up @@ -1065,12 +1070,14 @@ pub unsafe extern "C" fn wgpuCommandEncoderBeginRenderPass(

let timestamp_writes = descriptor.timestampWrites.as_ref().map(|timestamp_write| {
wgc::command::RenderPassTimestampWrites {
query_set:
timestamp_write.querySet
query_set: timestamp_write
.querySet
.as_ref()
.expect("invalid query set in timestamp writes")
.id,
beginning_of_pass_write_index: map_query_set_index(timestamp_write.beginningOfPassWriteIndex),
beginning_of_pass_write_index: map_query_set_index(
timestamp_write.beginningOfPassWriteIndex,
),
end_of_pass_write_index: map_query_set_index(timestamp_write.endOfPassWriteIndex),
}
});
Expand Down Expand Up @@ -1098,7 +1105,7 @@ pub unsafe extern "C" fn wgpuCommandEncoderBeginRenderPass(
),
depth_stencil_attachment: depth_stencil_attachment.as_ref(),
timestamp_writes: timestamp_writes.as_ref(),
occlusion_query_set: None,
occlusion_query_set: None, // TODO: populate via ext
};

Arc::into_raw(Arc::new(WGPURenderPassEncoderImpl {
Expand Down

0 comments on commit c7c7174

Please sign in to comment.