Skip to content

Commit f30f5bb

Browse files
committed
wip
1 parent 768d5f4 commit f30f5bb

8 files changed

Lines changed: 1013 additions & 0 deletions

File tree

wgpu-hal/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ mod dynamic;
278278
#[cfg(feature = "validation_canary")]
279279
mod validation_canary;
280280

281+
mod validation_layer;
282+
281283
#[cfg(feature = "validation_canary")]
282284
pub use validation_canary::{ValidationCanary, VALIDATION_CANARY};
283285

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*! Implementation of [`validation_layer::Adapter`]. */
2+
#![allow(unused_variables)]
3+
4+
impl crate::Adapter for super::Adapter {
5+
type A = super::Api;
6+
7+
unsafe fn open(
8+
&self,
9+
features: wgt::Features,
10+
limits: &wgt::Limits,
11+
memory_hints: &wgt::MemoryHints,
12+
) -> Result<crate::OpenDevice<super::Api>, crate::DeviceError> {
13+
let inner = unsafe {
14+
self.inner.open(features, limits, memory_hints)?
15+
};
16+
Ok(crate::OpenDevice {
17+
device: super::Device { inner: inner.device },
18+
queue: super::Queue { inner: inner.queue },
19+
})
20+
}
21+
22+
unsafe fn texture_format_capabilities(
23+
&self,
24+
format: wgt::TextureFormat,
25+
) -> crate::TextureFormatCapabilities {
26+
todo!()
27+
}
28+
29+
unsafe fn surface_capabilities(
30+
&self,
31+
surface: &<super::Api as crate::Api>::Surface,
32+
) -> Option<crate::SurfaceCapabilities> {
33+
todo!()
34+
}
35+
36+
unsafe fn get_presentation_timestamp(&self) -> wgt::PresentationTimestamp {
37+
todo!()
38+
}
39+
}
Lines changed: 346 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,346 @@
1+
/*! Implementation of [`validation_layer::Device`]. */
2+
#![allow(unused_variables)]
3+
4+
impl crate::CommandEncoder for super::CommandEncoder {
5+
type A = super::Api;
6+
7+
unsafe fn begin_encoding(&mut self, label: crate::Label) -> Result<(), crate::DeviceError> {
8+
todo!()
9+
}
10+
11+
unsafe fn discard_encoding(&mut self) {
12+
todo!()
13+
}
14+
15+
unsafe fn end_encoding(&mut self) -> Result<super::CommandBuffer, crate::DeviceError> {
16+
todo!()
17+
}
18+
19+
unsafe fn reset_all<I>(&mut self, command_buffers: I)
20+
where
21+
I: Iterator<Item = super::CommandBuffer> {
22+
todo!()
23+
}
24+
25+
unsafe fn transition_buffers<'a, T>(&mut self, barriers: T)
26+
where
27+
T: Iterator<Item = crate::BufferBarrier<'a, super::Buffer>> {
28+
todo!()
29+
}
30+
31+
unsafe fn transition_textures<'a, T>(&mut self, barriers: T)
32+
where
33+
T: Iterator<Item = crate::TextureBarrier<'a, super::Texture>> {
34+
todo!()
35+
}
36+
37+
unsafe fn clear_buffer(&mut self, buffer: &super::Buffer, range: crate::MemoryRange) {
38+
todo!()
39+
}
40+
41+
unsafe fn copy_buffer_to_buffer<T>(
42+
&mut self,
43+
src: &super::Buffer,
44+
dst: &super::Buffer,
45+
regions: T,
46+
) where
47+
T: Iterator<Item = crate::BufferCopy> {
48+
todo!()
49+
}
50+
51+
unsafe fn copy_texture_to_texture<T>(
52+
&mut self,
53+
src: &super::Texture,
54+
src_usage: wgt::TextureUses,
55+
dst: &super::Texture,
56+
regions: T,
57+
) where
58+
T: Iterator<Item = crate::TextureCopy> {
59+
todo!()
60+
}
61+
62+
unsafe fn copy_buffer_to_texture<T>(
63+
&mut self,
64+
src: &super::Buffer,
65+
dst: &super::Texture,
66+
regions: T,
67+
) where
68+
T: Iterator<Item = crate::BufferTextureCopy> {
69+
todo!()
70+
}
71+
72+
unsafe fn copy_texture_to_buffer<T>(
73+
&mut self,
74+
src: &super::Texture,
75+
src_usage: wgt::TextureUses,
76+
dst: &super::Buffer,
77+
regions: T,
78+
) where
79+
T: Iterator<Item = crate::BufferTextureCopy> {
80+
todo!()
81+
}
82+
83+
unsafe fn copy_acceleration_structure_to_acceleration_structure(
84+
&mut self,
85+
src: &super::AccelerationStructure,
86+
dst: &super::AccelerationStructure,
87+
copy: wgt::AccelerationStructureCopy,
88+
) {
89+
todo!()
90+
}
91+
92+
unsafe fn set_bind_group(
93+
&mut self,
94+
layout: &super::PipelineLayout,
95+
index: u32,
96+
group: &super::BindGroup,
97+
dynamic_offsets: &[wgt::DynamicOffset],
98+
) {
99+
todo!()
100+
}
101+
102+
unsafe fn set_push_constants(
103+
&mut self,
104+
layout: &super::PipelineLayout,
105+
stages: wgt::ShaderStages,
106+
offset_bytes: u32,
107+
data: &[u32],
108+
) {
109+
todo!()
110+
}
111+
112+
unsafe fn insert_debug_marker(&mut self, label: &str) {
113+
todo!()
114+
}
115+
116+
unsafe fn begin_debug_marker(&mut self, group_label: &str) {
117+
todo!()
118+
}
119+
120+
unsafe fn end_debug_marker(&mut self) {
121+
todo!()
122+
}
123+
124+
unsafe fn begin_query(&mut self, set: &super::QuerySet, index: u32) {
125+
todo!()
126+
}
127+
128+
unsafe fn end_query(&mut self, set: &super::QuerySet, index: u32) {
129+
todo!()
130+
}
131+
132+
unsafe fn write_timestamp(&mut self, set: &super::QuerySet, index: u32) {
133+
todo!()
134+
}
135+
136+
unsafe fn reset_queries(&mut self, set: &super::QuerySet, range: core::ops::Range<u32>) {
137+
todo!()
138+
}
139+
140+
unsafe fn copy_query_results(
141+
&mut self,
142+
set: &super::QuerySet,
143+
range: core::ops::Range<u32>,
144+
buffer: &super::Buffer,
145+
offset: wgt::BufferAddress,
146+
stride: wgt::BufferSize,
147+
) {
148+
todo!()
149+
}
150+
151+
unsafe fn begin_render_pass(
152+
&mut self,
153+
desc: &crate::RenderPassDescriptor<super::QuerySet, super::TextureView>,
154+
) -> Result<(), crate::DeviceError> {
155+
todo!()
156+
}
157+
158+
unsafe fn end_render_pass(&mut self) {
159+
todo!()
160+
}
161+
162+
unsafe fn set_render_pipeline(&mut self, pipeline: &super::RenderPipeline) {
163+
todo!()
164+
}
165+
166+
unsafe fn set_index_buffer<'a>(
167+
&mut self,
168+
binding: crate::BufferBinding<'a, super::Buffer>,
169+
format: wgt::IndexFormat,
170+
) {
171+
todo!()
172+
}
173+
174+
unsafe fn set_vertex_buffer<'a>(
175+
&mut self,
176+
index: u32,
177+
binding: crate::BufferBinding<'a, super::Buffer>,
178+
) {
179+
todo!()
180+
}
181+
182+
unsafe fn set_viewport(&mut self, rect: &crate::Rect<f32>, depth_range: core::ops::Range<f32>) {
183+
todo!()
184+
}
185+
186+
unsafe fn set_scissor_rect(&mut self, rect: &crate::Rect<u32>) {
187+
todo!()
188+
}
189+
190+
unsafe fn set_stencil_reference(&mut self, value: u32) {
191+
todo!()
192+
}
193+
194+
unsafe fn set_blend_constants(&mut self, color: &[f32; 4]) {
195+
todo!()
196+
}
197+
198+
unsafe fn draw(
199+
&mut self,
200+
first_vertex: u32,
201+
vertex_count: u32,
202+
first_instance: u32,
203+
instance_count: u32,
204+
) {
205+
todo!()
206+
}
207+
208+
unsafe fn draw_indexed(
209+
&mut self,
210+
first_index: u32,
211+
index_count: u32,
212+
base_vertex: i32,
213+
first_instance: u32,
214+
instance_count: u32,
215+
) {
216+
todo!()
217+
}
218+
219+
unsafe fn draw_indirect(
220+
&mut self,
221+
buffer: &super::Buffer,
222+
offset: wgt::BufferAddress,
223+
draw_count: u32,
224+
) {
225+
todo!()
226+
}
227+
228+
unsafe fn draw_indexed_indirect(
229+
&mut self,
230+
buffer: &super::Buffer,
231+
offset: wgt::BufferAddress,
232+
draw_count: u32,
233+
) {
234+
todo!()
235+
}
236+
237+
unsafe fn draw_indirect_count(
238+
&mut self,
239+
buffer: &super::Buffer,
240+
offset: wgt::BufferAddress,
241+
count_buffer: &super::Buffer,
242+
count_offset: wgt::BufferAddress,
243+
max_count: u32,
244+
) {
245+
todo!()
246+
}
247+
248+
unsafe fn draw_indexed_indirect_count(
249+
&mut self,
250+
buffer: &super::Buffer,
251+
offset: wgt::BufferAddress,
252+
count_buffer: &super::Buffer,
253+
count_offset: wgt::BufferAddress,
254+
max_count: u32,
255+
) {
256+
todo!()
257+
}
258+
259+
unsafe fn draw_mesh_tasks(
260+
&mut self,
261+
group_count_x: u32,
262+
group_count_y: u32,
263+
group_count_z: u32,
264+
) {
265+
todo!()
266+
}
267+
268+
unsafe fn draw_mesh_tasks_indirect(
269+
&mut self,
270+
buffer: &super::Buffer,
271+
offset: wgt::BufferAddress,
272+
draw_count: u32,
273+
) {
274+
todo!()
275+
}
276+
277+
unsafe fn draw_mesh_tasks_indirect_count(
278+
&mut self,
279+
buffer: &super::Buffer,
280+
offset: wgt::BufferAddress,
281+
count_buffer: &super::Buffer,
282+
count_offset: wgt::BufferAddress,
283+
max_count: u32,
284+
) {
285+
todo!()
286+
}
287+
288+
unsafe fn begin_compute_pass(
289+
&mut self,
290+
desc: &crate::ComputePassDescriptor<super::QuerySet>,
291+
) {
292+
todo!()
293+
}
294+
295+
unsafe fn end_compute_pass(&mut self) {
296+
todo!()
297+
}
298+
299+
unsafe fn set_compute_pipeline(&mut self, pipeline: &super::ComputePipeline) {
300+
todo!()
301+
}
302+
303+
unsafe fn dispatch(&mut self, count: [u32; 3]) {
304+
todo!()
305+
}
306+
307+
unsafe fn dispatch_indirect(
308+
&mut self,
309+
buffer: &super::Buffer,
310+
offset: wgt::BufferAddress,
311+
) {
312+
todo!()
313+
}
314+
315+
unsafe fn build_acceleration_structures<'a, T>(
316+
&mut self,
317+
descriptor_count: u32,
318+
descriptors: T,
319+
) where
320+
Self::A: 'a,
321+
T: IntoIterator<
322+
Item = crate::BuildAccelerationStructureDescriptor<
323+
'a,
324+
super::Buffer,
325+
super::AccelerationStructure,
326+
>,
327+
> {
328+
todo!()
329+
}
330+
331+
unsafe fn place_acceleration_structure_barrier(
332+
&mut self,
333+
barrier: crate::AccelerationStructureBarrier,
334+
) {
335+
todo!()
336+
}
337+
338+
unsafe fn read_acceleration_structure_compact_size(
339+
&mut self,
340+
acceleration_structure: &super::AccelerationStructure,
341+
buf: &super::Buffer,
342+
) {
343+
todo!()
344+
}
345+
346+
}

0 commit comments

Comments
 (0)