Skip to content

Commit

Permalink
fix metal
Browse files Browse the repository at this point in the history
  • Loading branch information
Vecvec committed Aug 27, 2024
1 parent fbd9546 commit a2709d2
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wgpu-hal/examples/ray-traced-sphere/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// based off ray-traced triangle, but demonsrates ray-shpere intersections
/// based off ray-traced triangle, but demonstrates ray-sphere intersections
extern crate wgpu_hal as hal;

use hal::{
Expand Down
20 changes: 20 additions & 0 deletions wgpu-hal/src/metal/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,26 @@ impl crate::CommandEncoder for super::CommandEncoder {
) {
unimplemented!()
}
unsafe fn begin_ray_tracing_pass(&mut self, _desc: &crate::RayTracingPassDescriptor<super::QuerySet>) {
unimplemented!()
}
unsafe fn end_ray_tracing_pass(&mut self) {
unimplemented!()
}
unsafe fn set_ray_tracing_pipeline(&mut self, _pipeline: &super::RayTracingPipeline) {
unimplemented!()
}

unsafe fn trace_rays(&mut self, _count: [u32; 3]) {
unimplemented!()
}
unsafe fn trace_rays_indirect(
&mut self,
_buffer: &super::Buffer,
_offset: wgt::BufferAddress,
) {
unimplemented!()
}
}

impl Drop for super::CommandEncoder {
Expand Down
6 changes: 6 additions & 0 deletions wgpu-hal/src/metal/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1423,4 +1423,10 @@ impl crate::Device for super::Device {
fn get_internal_counters(&self) -> wgt::HalCounters {
self.counters.clone()
}
unsafe fn create_ray_tracing_pipeline(&self, _desc: &crate::RayTracingPipelineDescriptor<super::PipelineLayout, super::ShaderModule, super::PipelineCache>) -> Result<super::RayTracingPipeline, crate::PipelineError> {
unimplemented!()
}
unsafe fn destroy_ray_tracing_pipeline(&self, _pipeline: super::RayTracingPipeline) {
unimplemented!()
}
}
10 changes: 10 additions & 0 deletions wgpu-hal/src/metal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl crate::Api for Api {
type ShaderModule = ShaderModule;
type RenderPipeline = RenderPipeline;
type ComputePipeline = ComputePipeline;
type RayTracingPipeline = RayTracingPipeline;
type PipelineCache = PipelineCache;

type AccelerationStructure = AccelerationStructure;
Expand All @@ -88,6 +89,7 @@ crate::impl_dyn_resource!(
QuerySet,
Queue,
RenderPipeline,
RayTracingPipeline,
Sampler,
ShaderModule,
Surface,
Expand Down Expand Up @@ -844,6 +846,14 @@ unsafe impl Sync for ComputePipeline {}

impl crate::DynComputePipeline for ComputePipeline {}

#[derive(Debug)]
pub struct RayTracingPipeline {}

unsafe impl Send for RayTracingPipeline {}
unsafe impl Sync for RayTracingPipeline {}

impl crate::DynRayTracingPipeline for RayTracingPipeline {}

#[derive(Debug, Clone)]
pub struct QuerySet {
raw_buffer: metal::Buffer,
Expand Down
2 changes: 1 addition & 1 deletion wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ bitflags::bitflags! {
///
/// This is a native only feature.
const SHADER_INT64_ATOMIC_ALL_OPS = 1 << 61;
/// Allows the use of the ray-tracing pipline
/// Allows the use of the ray-tracing pipeline
///
/// Supported platforms:
/// Vulkan
Expand Down

0 comments on commit a2709d2

Please sign in to comment.