1 //! Dummy backend implementation to test the code for compile errors
2 //! outside of the graphics development environment.
3 
4 extern crate gfx_hal as hal;
5 
6 use hal::{
7     adapter,
8     buffer,
9     command,
10     device,
11     format,
12     image,
13     memory,
14     pass,
15     pool,
16     pso,
17     query,
18     queue,
19     window,
20 };
21 use std::borrow::Borrow;
22 use std::ops::Range;
23 
24 const DO_NOT_USE_MESSAGE: &str = "You need to enable a native API feature (vulkan/metal/dx11/dx12/gl/wgl) in order to use gfx-rs";
25 
26 /// Dummy backend.
27 #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
28 pub enum Backend {}
29 impl hal::Backend for Backend {
30     type Instance = Instance;
31     type PhysicalDevice = PhysicalDevice;
32     type Device = Device;
33 
34     type Surface = Surface;
35     type Swapchain = Swapchain;
36 
37     type QueueFamily = QueueFamily;
38     type CommandQueue = CommandQueue;
39     type CommandBuffer = CommandBuffer;
40 
41     type Memory = ();
42     type CommandPool = CommandPool;
43 
44     type ShaderModule = ();
45     type RenderPass = ();
46     type Framebuffer = ();
47 
48     type Buffer = ();
49     type BufferView = ();
50     type Image = ();
51     type ImageView = ();
52     type Sampler = ();
53 
54     type ComputePipeline = ();
55     type GraphicsPipeline = ();
56     type PipelineCache = ();
57     type PipelineLayout = ();
58     type DescriptorSetLayout = ();
59     type DescriptorPool = DescriptorPool;
60     type DescriptorSet = ();
61 
62     type Fence = ();
63     type Semaphore = ();
64     type Event = ();
65     type QueryPool = ();
66 }
67 
68 /// Dummy physical device.
69 #[derive(Debug)]
70 pub struct PhysicalDevice;
71 impl adapter::PhysicalDevice<Backend> for PhysicalDevice {
open( &self, _: &[(&QueueFamily, &[queue::QueuePriority])], _: hal::Features, ) -> Result<adapter::Gpu<Backend>, device::CreationError>72     unsafe fn open(
73         &self,
74         _: &[(&QueueFamily, &[queue::QueuePriority])],
75         _: hal::Features,
76     ) -> Result<adapter::Gpu<Backend>, device::CreationError> {
77         panic!(DO_NOT_USE_MESSAGE)
78     }
79 
format_properties(&self, _: Option<format::Format>) -> format::Properties80     fn format_properties(&self, _: Option<format::Format>) -> format::Properties {
81         panic!(DO_NOT_USE_MESSAGE)
82     }
83 
image_format_properties( &self, _: format::Format, _dim: u8, _: image::Tiling, _: image::Usage, _: image::ViewCapabilities, ) -> Option<image::FormatProperties>84     fn image_format_properties(
85         &self,
86         _: format::Format,
87         _dim: u8,
88         _: image::Tiling,
89         _: image::Usage,
90         _: image::ViewCapabilities,
91     ) -> Option<image::FormatProperties> {
92         panic!(DO_NOT_USE_MESSAGE)
93     }
94 
memory_properties(&self) -> adapter::MemoryProperties95     fn memory_properties(&self) -> adapter::MemoryProperties {
96         panic!(DO_NOT_USE_MESSAGE)
97     }
98 
features(&self) -> hal::Features99     fn features(&self) -> hal::Features {
100         panic!(DO_NOT_USE_MESSAGE)
101     }
102 
hints(&self) -> hal::Hints103     fn hints(&self) -> hal::Hints {
104         panic!(DO_NOT_USE_MESSAGE)
105     }
106 
limits(&self) -> hal::Limits107     fn limits(&self) -> hal::Limits {
108         panic!(DO_NOT_USE_MESSAGE)
109     }
110 }
111 
112 /// Dummy command queue doing nothing.
113 #[derive(Debug)]
114 pub struct CommandQueue;
115 impl queue::CommandQueue<Backend> for CommandQueue {
submit<'a, T, Ic, S, Iw, Is>( &mut self, _: queue::Submission<Ic, Iw, Is>, _: Option<&()>, ) where T: 'a + Borrow<CommandBuffer>, Ic: IntoIterator<Item = &'a T>, S: 'a + Borrow<()>, Iw: IntoIterator<Item = (&'a S, pso::PipelineStage)>, Is: IntoIterator<Item = &'a S>,116     unsafe fn submit<'a, T, Ic, S, Iw, Is>(
117         &mut self,
118         _: queue::Submission<Ic, Iw, Is>,
119         _: Option<&()>,
120     ) where
121         T: 'a + Borrow<CommandBuffer>,
122         Ic: IntoIterator<Item = &'a T>,
123         S: 'a + Borrow<()>,
124         Iw: IntoIterator<Item = (&'a S, pso::PipelineStage)>,
125         Is: IntoIterator<Item = &'a S>,
126     {
127         panic!(DO_NOT_USE_MESSAGE)
128     }
129 
present<'a, W, Is, S, Iw>( &mut self, _: Is, _: Iw, ) -> Result<Option<window::Suboptimal>, window::PresentError> where W: 'a + Borrow<Swapchain>, Is: IntoIterator<Item = (&'a W, window::SwapImageIndex)>, S: 'a + Borrow<()>, Iw: IntoIterator<Item = &'a S>,130     unsafe fn present<'a, W, Is, S, Iw>(
131         &mut self,
132         _: Is,
133         _: Iw,
134     ) -> Result<Option<window::Suboptimal>, window::PresentError>
135     where
136         W: 'a + Borrow<Swapchain>,
137         Is: IntoIterator<Item = (&'a W, window::SwapImageIndex)>,
138         S: 'a + Borrow<()>,
139         Iw: IntoIterator<Item = &'a S>,
140     {
141         panic!(DO_NOT_USE_MESSAGE)
142     }
143 
present_surface( &mut self, _surface: &mut Surface, _image: (), _wait_semaphore: Option<&()>, ) -> Result<Option<window::Suboptimal>, window::PresentError>144     unsafe fn present_surface(
145         &mut self,
146         _surface: &mut Surface,
147         _image: (),
148         _wait_semaphore: Option<&()>,
149     ) -> Result<Option<window::Suboptimal>, window::PresentError> {
150         panic!(DO_NOT_USE_MESSAGE)
151     }
152 
wait_idle(&self) -> Result<(), device::OutOfMemory>153     fn wait_idle(&self) -> Result<(), device::OutOfMemory> {
154         panic!(DO_NOT_USE_MESSAGE)
155     }
156 }
157 
158 /// Dummy device doing nothing.
159 #[derive(Debug)]
160 pub struct Device;
161 impl device::Device<Backend> for Device {
create_command_pool( &self, _: queue::QueueFamilyId, _: pool::CommandPoolCreateFlags, ) -> Result<CommandPool, device::OutOfMemory>162     unsafe fn create_command_pool(
163         &self,
164         _: queue::QueueFamilyId,
165         _: pool::CommandPoolCreateFlags,
166     ) -> Result<CommandPool, device::OutOfMemory> {
167         panic!(DO_NOT_USE_MESSAGE)
168     }
169 
destroy_command_pool(&self, _: CommandPool)170     unsafe fn destroy_command_pool(&self, _: CommandPool) {
171         panic!(DO_NOT_USE_MESSAGE)
172     }
173 
allocate_memory( &self, _: hal::MemoryTypeId, _: u64, ) -> Result<(), device::AllocationError>174     unsafe fn allocate_memory(
175         &self,
176         _: hal::MemoryTypeId,
177         _: u64,
178     ) -> Result<(), device::AllocationError> {
179         panic!(DO_NOT_USE_MESSAGE)
180     }
181 
create_render_pass<'a, IA, IS, ID>( &self, _: IA, _: IS, _: ID, ) -> Result<(), device::OutOfMemory> where IA: IntoIterator, IA::Item: Borrow<pass::Attachment>, IS: IntoIterator, IS::Item: Borrow<pass::SubpassDesc<'a>>, ID: IntoIterator, ID::Item: Borrow<pass::SubpassDependency>,182     unsafe fn create_render_pass<'a, IA, IS, ID>(
183         &self,
184         _: IA,
185         _: IS,
186         _: ID,
187     ) -> Result<(), device::OutOfMemory>
188     where
189         IA: IntoIterator,
190         IA::Item: Borrow<pass::Attachment>,
191         IS: IntoIterator,
192         IS::Item: Borrow<pass::SubpassDesc<'a>>,
193         ID: IntoIterator,
194         ID::Item: Borrow<pass::SubpassDependency>,
195     {
196         panic!(DO_NOT_USE_MESSAGE)
197     }
198 
create_pipeline_layout<IS, IR>(&self, _: IS, _: IR) -> Result<(), device::OutOfMemory> where IS: IntoIterator, IS::Item: Borrow<()>, IR: IntoIterator, IR::Item: Borrow<(pso::ShaderStageFlags, Range<u32>)>,199     unsafe fn create_pipeline_layout<IS, IR>(&self, _: IS, _: IR) -> Result<(), device::OutOfMemory>
200     where
201         IS: IntoIterator,
202         IS::Item: Borrow<()>,
203         IR: IntoIterator,
204         IR::Item: Borrow<(pso::ShaderStageFlags, Range<u32>)>,
205     {
206         panic!(DO_NOT_USE_MESSAGE)
207     }
208 
create_pipeline_cache( &self, _data: Option<&[u8]>, ) -> Result<(), device::OutOfMemory>209     unsafe fn create_pipeline_cache(
210         &self,
211         _data: Option<&[u8]>,
212     ) -> Result<(), device::OutOfMemory> {
213         panic!(DO_NOT_USE_MESSAGE)
214     }
215 
get_pipeline_cache_data(&self, _cache: &()) -> Result<Vec<u8>, device::OutOfMemory>216     unsafe fn get_pipeline_cache_data(&self, _cache: &()) -> Result<Vec<u8>, device::OutOfMemory> {
217         panic!(DO_NOT_USE_MESSAGE)
218     }
219 
destroy_pipeline_cache(&self, _: ())220     unsafe fn destroy_pipeline_cache(&self, _: ()) {
221         panic!(DO_NOT_USE_MESSAGE)
222     }
223 
create_graphics_pipeline<'a>( &self, _: &pso::GraphicsPipelineDesc<'a, Backend>, _: Option<&()>, ) -> Result<(), pso::CreationError>224     unsafe fn create_graphics_pipeline<'a>(
225         &self,
226         _: &pso::GraphicsPipelineDesc<'a, Backend>,
227         _: Option<&()>,
228     ) -> Result<(), pso::CreationError> {
229         panic!(DO_NOT_USE_MESSAGE)
230     }
231 
create_compute_pipeline<'a>( &self, _: &pso::ComputePipelineDesc<'a, Backend>, _: Option<&()>, ) -> Result<(), pso::CreationError>232     unsafe fn create_compute_pipeline<'a>(
233         &self,
234         _: &pso::ComputePipelineDesc<'a, Backend>,
235         _: Option<&()>,
236     ) -> Result<(), pso::CreationError> {
237         panic!(DO_NOT_USE_MESSAGE)
238     }
239 
merge_pipeline_caches<I>(&self, _: &(), _: I) -> Result<(), device::OutOfMemory> where I: IntoIterator, I::Item: Borrow<()>,240     unsafe fn merge_pipeline_caches<I>(&self, _: &(), _: I) -> Result<(), device::OutOfMemory>
241     where
242         I: IntoIterator,
243         I::Item: Borrow<()>,
244     {
245         panic!(DO_NOT_USE_MESSAGE)
246     }
247 
create_framebuffer<I>( &self, _: &(), _: I, _: image::Extent, ) -> Result<(), device::OutOfMemory> where I: IntoIterator, I::Item: Borrow<()>,248     unsafe fn create_framebuffer<I>(
249         &self,
250         _: &(),
251         _: I,
252         _: image::Extent,
253     ) -> Result<(), device::OutOfMemory>
254     where
255         I: IntoIterator,
256         I::Item: Borrow<()>,
257     {
258         panic!(DO_NOT_USE_MESSAGE)
259     }
260 
create_shader_module(&self, _: &[u32]) -> Result<(), device::ShaderError>261     unsafe fn create_shader_module(&self, _: &[u32]) -> Result<(), device::ShaderError> {
262         panic!(DO_NOT_USE_MESSAGE)
263     }
264 
create_sampler(&self, _: &image::SamplerDesc) -> Result<(), device::AllocationError>265     unsafe fn create_sampler(&self, _: &image::SamplerDesc) -> Result<(), device::AllocationError> {
266         panic!(DO_NOT_USE_MESSAGE)
267     }
create_buffer(&self, _: u64, _: buffer::Usage) -> Result<(), buffer::CreationError>268     unsafe fn create_buffer(&self, _: u64, _: buffer::Usage) -> Result<(), buffer::CreationError> {
269         panic!(DO_NOT_USE_MESSAGE)
270     }
271 
get_buffer_requirements(&self, _: &()) -> memory::Requirements272     unsafe fn get_buffer_requirements(&self, _: &()) -> memory::Requirements {
273         panic!(DO_NOT_USE_MESSAGE)
274     }
275 
bind_buffer_memory( &self, _: &(), _: u64, _: &mut (), ) -> Result<(), device::BindError>276     unsafe fn bind_buffer_memory(
277         &self,
278         _: &(),
279         _: u64,
280         _: &mut (),
281     ) -> Result<(), device::BindError> {
282         panic!(DO_NOT_USE_MESSAGE)
283     }
284 
create_buffer_view( &self, _: &(), _: Option<format::Format>, _: buffer::SubRange, ) -> Result<(), buffer::ViewCreationError>285     unsafe fn create_buffer_view(
286         &self,
287         _: &(),
288         _: Option<format::Format>,
289         _: buffer::SubRange,
290     ) -> Result<(), buffer::ViewCreationError> {
291         panic!(DO_NOT_USE_MESSAGE)
292     }
293 
create_image( &self, _: image::Kind, _: image::Level, _: format::Format, _: image::Tiling, _: image::Usage, _: image::ViewCapabilities, ) -> Result<(), image::CreationError>294     unsafe fn create_image(
295         &self,
296         _: image::Kind,
297         _: image::Level,
298         _: format::Format,
299         _: image::Tiling,
300         _: image::Usage,
301         _: image::ViewCapabilities,
302     ) -> Result<(), image::CreationError> {
303         panic!(DO_NOT_USE_MESSAGE)
304     }
305 
get_image_requirements(&self, _: &()) -> memory::Requirements306     unsafe fn get_image_requirements(&self, _: &()) -> memory::Requirements {
307         panic!(DO_NOT_USE_MESSAGE)
308     }
309 
get_image_subresource_footprint( &self, _: &(), _: image::Subresource, ) -> image::SubresourceFootprint310     unsafe fn get_image_subresource_footprint(
311         &self,
312         _: &(),
313         _: image::Subresource,
314     ) -> image::SubresourceFootprint {
315         panic!(DO_NOT_USE_MESSAGE)
316     }
317 
bind_image_memory( &self, _: &(), _: u64, _: &mut (), ) -> Result<(), device::BindError>318     unsafe fn bind_image_memory(
319         &self,
320         _: &(),
321         _: u64,
322         _: &mut (),
323     ) -> Result<(), device::BindError> {
324         panic!(DO_NOT_USE_MESSAGE)
325     }
326 
create_image_view( &self, _: &(), _: image::ViewKind, _: format::Format, _: format::Swizzle, _: image::SubresourceRange, ) -> Result<(), image::ViewCreationError>327     unsafe fn create_image_view(
328         &self,
329         _: &(),
330         _: image::ViewKind,
331         _: format::Format,
332         _: format::Swizzle,
333         _: image::SubresourceRange,
334     ) -> Result<(), image::ViewCreationError> {
335         panic!(DO_NOT_USE_MESSAGE)
336     }
337 
create_descriptor_pool<I>( &self, _: usize, _: I, _: pso::DescriptorPoolCreateFlags, ) -> Result<DescriptorPool, device::OutOfMemory> where I: IntoIterator, I::Item: Borrow<pso::DescriptorRangeDesc>,338     unsafe fn create_descriptor_pool<I>(
339         &self,
340         _: usize,
341         _: I,
342         _: pso::DescriptorPoolCreateFlags,
343     ) -> Result<DescriptorPool, device::OutOfMemory>
344     where
345         I: IntoIterator,
346         I::Item: Borrow<pso::DescriptorRangeDesc>,
347     {
348         panic!(DO_NOT_USE_MESSAGE)
349     }
350 
create_descriptor_set_layout<I, J>( &self, _: I, _: J, ) -> Result<(), device::OutOfMemory> where I: IntoIterator, I::Item: Borrow<pso::DescriptorSetLayoutBinding>, J: IntoIterator, J::Item: Borrow<()>,351     unsafe fn create_descriptor_set_layout<I, J>(
352         &self,
353         _: I,
354         _: J,
355     ) -> Result<(), device::OutOfMemory>
356     where
357         I: IntoIterator,
358         I::Item: Borrow<pso::DescriptorSetLayoutBinding>,
359         J: IntoIterator,
360         J::Item: Borrow<()>,
361     {
362         panic!(DO_NOT_USE_MESSAGE)
363     }
364 
write_descriptor_sets<'a, I, J>(&self, _: I) where I: IntoIterator<Item = pso::DescriptorSetWrite<'a, Backend, J>>, J: IntoIterator, J::Item: Borrow<pso::Descriptor<'a, Backend>>,365     unsafe fn write_descriptor_sets<'a, I, J>(&self, _: I)
366     where
367         I: IntoIterator<Item = pso::DescriptorSetWrite<'a, Backend, J>>,
368         J: IntoIterator,
369         J::Item: Borrow<pso::Descriptor<'a, Backend>>,
370     {
371         panic!(DO_NOT_USE_MESSAGE)
372     }
373 
copy_descriptor_sets<'a, I>(&self, _: I) where I: IntoIterator, I::Item: Borrow<pso::DescriptorSetCopy<'a, Backend>>,374     unsafe fn copy_descriptor_sets<'a, I>(&self, _: I)
375     where
376         I: IntoIterator,
377         I::Item: Borrow<pso::DescriptorSetCopy<'a, Backend>>,
378     {
379         panic!(DO_NOT_USE_MESSAGE)
380     }
381 
create_semaphore(&self) -> Result<(), device::OutOfMemory>382     fn create_semaphore(&self) -> Result<(), device::OutOfMemory> {
383         panic!(DO_NOT_USE_MESSAGE)
384     }
385 
create_fence(&self, _: bool) -> Result<(), device::OutOfMemory>386     fn create_fence(&self, _: bool) -> Result<(), device::OutOfMemory> {
387         panic!(DO_NOT_USE_MESSAGE)
388     }
389 
get_fence_status(&self, _: &()) -> Result<bool, device::DeviceLost>390     unsafe fn get_fence_status(&self, _: &()) -> Result<bool, device::DeviceLost> {
391         panic!(DO_NOT_USE_MESSAGE)
392     }
393 
create_event(&self) -> Result<(), device::OutOfMemory>394     fn create_event(&self) -> Result<(), device::OutOfMemory> {
395         panic!(DO_NOT_USE_MESSAGE)
396     }
397 
get_event_status(&self, _: &()) -> Result<bool, device::OomOrDeviceLost>398     unsafe fn get_event_status(&self, _: &()) -> Result<bool, device::OomOrDeviceLost> {
399         panic!(DO_NOT_USE_MESSAGE)
400     }
401 
set_event(&self, _: &()) -> Result<(), device::OutOfMemory>402     unsafe fn set_event(&self, _: &()) -> Result<(), device::OutOfMemory> {
403         panic!(DO_NOT_USE_MESSAGE)
404     }
405 
reset_event(&self, _: &()) -> Result<(), device::OutOfMemory>406     unsafe fn reset_event(&self, _: &()) -> Result<(), device::OutOfMemory> {
407         panic!(DO_NOT_USE_MESSAGE)
408     }
409 
create_query_pool(&self, _: query::Type, _: u32) -> Result<(), query::CreationError>410     unsafe fn create_query_pool(&self, _: query::Type, _: u32) -> Result<(), query::CreationError> {
411         panic!(DO_NOT_USE_MESSAGE)
412     }
413 
destroy_query_pool(&self, _: ())414     unsafe fn destroy_query_pool(&self, _: ()) {
415         panic!(DO_NOT_USE_MESSAGE)
416     }
417 
get_query_pool_results( &self, _: &(), _: Range<query::Id>, _: &mut [u8], _: buffer::Offset, _: query::ResultFlags, ) -> Result<bool, device::OomOrDeviceLost>418     unsafe fn get_query_pool_results(
419         &self,
420         _: &(),
421         _: Range<query::Id>,
422         _: &mut [u8],
423         _: buffer::Offset,
424         _: query::ResultFlags,
425     ) -> Result<bool, device::OomOrDeviceLost> {
426         panic!(DO_NOT_USE_MESSAGE)
427     }
428 
map_memory(&self, _: &(), _: memory::Segment) -> Result<*mut u8, device::MapError>429     unsafe fn map_memory(&self, _: &(), _: memory::Segment) -> Result<*mut u8, device::MapError> {
430         panic!(DO_NOT_USE_MESSAGE)
431     }
432 
unmap_memory(&self, _: &())433     unsafe fn unmap_memory(&self, _: &()) {
434         panic!(DO_NOT_USE_MESSAGE)
435     }
436 
flush_mapped_memory_ranges<'a, I>(&self, _: I) -> Result<(), device::OutOfMemory> where I: IntoIterator, I::Item: Borrow<(&'a (), memory::Segment)>,437     unsafe fn flush_mapped_memory_ranges<'a, I>(&self, _: I) -> Result<(), device::OutOfMemory>
438     where
439         I: IntoIterator,
440         I::Item: Borrow<(&'a (), memory::Segment)>,
441     {
442         panic!(DO_NOT_USE_MESSAGE)
443     }
444 
invalidate_mapped_memory_ranges<'a, I>(&self, _: I) -> Result<(), device::OutOfMemory> where I: IntoIterator, I::Item: Borrow<(&'a (), memory::Segment)>,445     unsafe fn invalidate_mapped_memory_ranges<'a, I>(&self, _: I) -> Result<(), device::OutOfMemory>
446     where
447         I: IntoIterator,
448         I::Item: Borrow<(&'a (), memory::Segment)>,
449     {
450         panic!(DO_NOT_USE_MESSAGE)
451     }
452 
free_memory(&self, _: ())453     unsafe fn free_memory(&self, _: ()) {
454         panic!(DO_NOT_USE_MESSAGE)
455     }
456 
destroy_shader_module(&self, _: ())457     unsafe fn destroy_shader_module(&self, _: ()) {
458         panic!(DO_NOT_USE_MESSAGE)
459     }
460 
destroy_render_pass(&self, _: ())461     unsafe fn destroy_render_pass(&self, _: ()) {
462         panic!(DO_NOT_USE_MESSAGE)
463     }
464 
destroy_pipeline_layout(&self, _: ())465     unsafe fn destroy_pipeline_layout(&self, _: ()) {
466         panic!(DO_NOT_USE_MESSAGE)
467     }
destroy_graphics_pipeline(&self, _: ())468     unsafe fn destroy_graphics_pipeline(&self, _: ()) {
469         panic!(DO_NOT_USE_MESSAGE)
470     }
destroy_compute_pipeline(&self, _: ())471     unsafe fn destroy_compute_pipeline(&self, _: ()) {
472         panic!(DO_NOT_USE_MESSAGE)
473     }
destroy_framebuffer(&self, _: ())474     unsafe fn destroy_framebuffer(&self, _: ()) {
475         panic!(DO_NOT_USE_MESSAGE)
476     }
477 
destroy_buffer(&self, _: ())478     unsafe fn destroy_buffer(&self, _: ()) {
479         panic!(DO_NOT_USE_MESSAGE)
480     }
destroy_buffer_view(&self, _: ())481     unsafe fn destroy_buffer_view(&self, _: ()) {
482         panic!(DO_NOT_USE_MESSAGE)
483     }
destroy_image(&self, _: ())484     unsafe fn destroy_image(&self, _: ()) {
485         panic!(DO_NOT_USE_MESSAGE)
486     }
destroy_image_view(&self, _: ())487     unsafe fn destroy_image_view(&self, _: ()) {
488         panic!(DO_NOT_USE_MESSAGE)
489     }
destroy_sampler(&self, _: ())490     unsafe fn destroy_sampler(&self, _: ()) {
491         panic!(DO_NOT_USE_MESSAGE)
492     }
493 
destroy_descriptor_pool(&self, _: DescriptorPool)494     unsafe fn destroy_descriptor_pool(&self, _: DescriptorPool) {
495         panic!(DO_NOT_USE_MESSAGE)
496     }
497 
destroy_descriptor_set_layout(&self, _: ())498     unsafe fn destroy_descriptor_set_layout(&self, _: ()) {
499         panic!(DO_NOT_USE_MESSAGE)
500     }
501 
destroy_fence(&self, _: ())502     unsafe fn destroy_fence(&self, _: ()) {
503         panic!(DO_NOT_USE_MESSAGE)
504     }
505 
destroy_semaphore(&self, _: ())506     unsafe fn destroy_semaphore(&self, _: ()) {
507         panic!(DO_NOT_USE_MESSAGE)
508     }
509 
destroy_event(&self, _: ())510     unsafe fn destroy_event(&self, _: ()) {
511         panic!(DO_NOT_USE_MESSAGE)
512     }
513 
create_swapchain( &self, _: &mut Surface, _: window::SwapchainConfig, _: Option<Swapchain>, ) -> Result<(Swapchain, Vec<()>), hal::window::CreationError>514     unsafe fn create_swapchain(
515         &self,
516         _: &mut Surface,
517         _: window::SwapchainConfig,
518         _: Option<Swapchain>,
519     ) -> Result<(Swapchain, Vec<()>), hal::window::CreationError> {
520         panic!(DO_NOT_USE_MESSAGE)
521     }
522 
destroy_swapchain(&self, _: Swapchain)523     unsafe fn destroy_swapchain(&self, _: Swapchain) {
524         panic!(DO_NOT_USE_MESSAGE)
525     }
526 
wait_idle(&self) -> Result<(), device::OutOfMemory>527     fn wait_idle(&self) -> Result<(), device::OutOfMemory> {
528         panic!(DO_NOT_USE_MESSAGE)
529     }
530 
set_image_name(&self, _: &mut (), _: &str)531     unsafe fn set_image_name(&self, _: &mut (), _: &str) {
532         panic!(DO_NOT_USE_MESSAGE)
533     }
534 
set_buffer_name(&self, _: &mut (), _: &str)535     unsafe fn set_buffer_name(&self, _: &mut (), _: &str) {
536         panic!(DO_NOT_USE_MESSAGE)
537     }
538 
set_command_buffer_name(&self, _: &mut CommandBuffer, _: &str)539     unsafe fn set_command_buffer_name(&self, _: &mut CommandBuffer, _: &str) {
540         panic!(DO_NOT_USE_MESSAGE)
541     }
542 
set_semaphore_name(&self, _: &mut (), _: &str)543     unsafe fn set_semaphore_name(&self, _: &mut (), _: &str) {
544         panic!(DO_NOT_USE_MESSAGE)
545     }
546 
set_fence_name(&self, _: &mut (), _: &str)547     unsafe fn set_fence_name(&self, _: &mut (), _: &str) {
548         panic!(DO_NOT_USE_MESSAGE)
549     }
550 
set_framebuffer_name(&self, _: &mut (), _: &str)551     unsafe fn set_framebuffer_name(&self, _: &mut (), _: &str) {
552         panic!(DO_NOT_USE_MESSAGE)
553     }
554 
set_render_pass_name(&self, _: &mut (), _: &str)555     unsafe fn set_render_pass_name(&self, _: &mut (), _: &str) {
556         panic!(DO_NOT_USE_MESSAGE)
557     }
558 
set_descriptor_set_name(&self, _: &mut (), _: &str)559     unsafe fn set_descriptor_set_name(&self, _: &mut (), _: &str) {
560         panic!(DO_NOT_USE_MESSAGE)
561     }
562 
set_descriptor_set_layout_name(&self, _: &mut (), _: &str)563     unsafe fn set_descriptor_set_layout_name(&self, _: &mut (), _: &str) {
564         panic!(DO_NOT_USE_MESSAGE)
565     }
566 }
567 
568 #[derive(Debug)]
569 pub struct QueueFamily;
570 impl queue::QueueFamily for QueueFamily {
queue_type(&self) -> queue::QueueType571     fn queue_type(&self) -> queue::QueueType {
572         panic!(DO_NOT_USE_MESSAGE)
573     }
max_queues(&self) -> usize574     fn max_queues(&self) -> usize {
575         panic!(DO_NOT_USE_MESSAGE)
576     }
id(&self) -> queue::QueueFamilyId577     fn id(&self) -> queue::QueueFamilyId {
578         panic!(DO_NOT_USE_MESSAGE)
579     }
580 }
581 
582 /// Dummy raw command pool.
583 #[derive(Debug)]
584 pub struct CommandPool;
585 impl pool::CommandPool<Backend> for CommandPool {
reset(&mut self, _: bool)586     unsafe fn reset(&mut self, _: bool) {
587         panic!(DO_NOT_USE_MESSAGE)
588     }
589 
free<I>(&mut self, _: I) where I: IntoIterator<Item = CommandBuffer>,590     unsafe fn free<I>(&mut self, _: I)
591     where
592         I: IntoIterator<Item = CommandBuffer>,
593     {
594         panic!(DO_NOT_USE_MESSAGE)
595     }
596 }
597 
598 /// Dummy command buffer, which ignores all the calls.
599 #[derive(Debug)]
600 pub struct CommandBuffer;
601 impl command::CommandBuffer<Backend> for CommandBuffer {
begin( &mut self, _: command::CommandBufferFlags, _: command::CommandBufferInheritanceInfo<Backend>, )602     unsafe fn begin(
603         &mut self,
604         _: command::CommandBufferFlags,
605         _: command::CommandBufferInheritanceInfo<Backend>,
606     ) {
607         panic!(DO_NOT_USE_MESSAGE)
608     }
609 
finish(&mut self)610     unsafe fn finish(&mut self) {
611         panic!(DO_NOT_USE_MESSAGE)
612     }
613 
reset(&mut self, _: bool)614     unsafe fn reset(&mut self, _: bool) {
615         panic!(DO_NOT_USE_MESSAGE)
616     }
617 
pipeline_barrier<'a, T>( &mut self, _: Range<pso::PipelineStage>, _: memory::Dependencies, _: T, ) where T: IntoIterator, T::Item: Borrow<memory::Barrier<'a, Backend>>,618     unsafe fn pipeline_barrier<'a, T>(
619         &mut self,
620         _: Range<pso::PipelineStage>,
621         _: memory::Dependencies,
622         _: T,
623     ) where
624         T: IntoIterator,
625         T::Item: Borrow<memory::Barrier<'a, Backend>>,
626     {
627         panic!(DO_NOT_USE_MESSAGE)
628     }
629 
fill_buffer(&mut self, _: &(), _: buffer::SubRange, _: u32)630     unsafe fn fill_buffer(&mut self, _: &(), _: buffer::SubRange, _: u32) {
631         panic!(DO_NOT_USE_MESSAGE)
632     }
633 
update_buffer(&mut self, _: &(), _: buffer::Offset, _: &[u8])634     unsafe fn update_buffer(&mut self, _: &(), _: buffer::Offset, _: &[u8]) {
635         panic!(DO_NOT_USE_MESSAGE)
636     }
637 
clear_image<T>(&mut self, _: &(), _: image::Layout, _: command::ClearValue, _: T) where T: IntoIterator, T::Item: Borrow<image::SubresourceRange>,638     unsafe fn clear_image<T>(&mut self, _: &(), _: image::Layout, _: command::ClearValue, _: T)
639     where
640         T: IntoIterator,
641         T::Item: Borrow<image::SubresourceRange>,
642     {
643         panic!(DO_NOT_USE_MESSAGE)
644     }
645 
clear_attachments<T, U>(&mut self, _: T, _: U) where T: IntoIterator, T::Item: Borrow<command::AttachmentClear>, U: IntoIterator, U::Item: Borrow<pso::ClearRect>,646     unsafe fn clear_attachments<T, U>(&mut self, _: T, _: U)
647     where
648         T: IntoIterator,
649         T::Item: Borrow<command::AttachmentClear>,
650         U: IntoIterator,
651         U::Item: Borrow<pso::ClearRect>,
652     {
653         panic!(DO_NOT_USE_MESSAGE)
654     }
655 
resolve_image<T>(&mut self, _: &(), _: image::Layout, _: &(), _: image::Layout, _: T) where T: IntoIterator, T::Item: Borrow<command::ImageResolve>,656     unsafe fn resolve_image<T>(&mut self, _: &(), _: image::Layout, _: &(), _: image::Layout, _: T)
657     where
658         T: IntoIterator,
659         T::Item: Borrow<command::ImageResolve>,
660     {
661         panic!(DO_NOT_USE_MESSAGE)
662     }
663 
blit_image<T>( &mut self, _: &(), _: image::Layout, _: &(), _: image::Layout, _: image::Filter, _: T, ) where T: IntoIterator, T::Item: Borrow<command::ImageBlit>,664     unsafe fn blit_image<T>(
665         &mut self,
666         _: &(),
667         _: image::Layout,
668         _: &(),
669         _: image::Layout,
670         _: image::Filter,
671         _: T,
672     ) where
673         T: IntoIterator,
674         T::Item: Borrow<command::ImageBlit>,
675     {
676         panic!(DO_NOT_USE_MESSAGE)
677     }
678 
bind_index_buffer(&mut self, _: buffer::IndexBufferView<Backend>)679     unsafe fn bind_index_buffer(&mut self, _: buffer::IndexBufferView<Backend>) {
680         panic!(DO_NOT_USE_MESSAGE)
681     }
682 
bind_vertex_buffers<I, T>(&mut self, _: u32, _: I) where I: IntoIterator<Item = (T, buffer::SubRange)>, T: Borrow<()>,683     unsafe fn bind_vertex_buffers<I, T>(&mut self, _: u32, _: I)
684     where
685         I: IntoIterator<Item = (T, buffer::SubRange)>,
686         T: Borrow<()>,
687     {
688         panic!(DO_NOT_USE_MESSAGE)
689     }
690 
set_viewports<T>(&mut self, _: u32, _: T) where T: IntoIterator, T::Item: Borrow<pso::Viewport>,691     unsafe fn set_viewports<T>(&mut self, _: u32, _: T)
692     where
693         T: IntoIterator,
694         T::Item: Borrow<pso::Viewport>,
695     {
696         panic!(DO_NOT_USE_MESSAGE)
697     }
698 
set_scissors<T>(&mut self, _: u32, _: T) where T: IntoIterator, T::Item: Borrow<pso::Rect>,699     unsafe fn set_scissors<T>(&mut self, _: u32, _: T)
700     where
701         T: IntoIterator,
702         T::Item: Borrow<pso::Rect>,
703     {
704         panic!(DO_NOT_USE_MESSAGE)
705     }
706 
set_stencil_reference(&mut self, _: pso::Face, _: pso::StencilValue)707     unsafe fn set_stencil_reference(&mut self, _: pso::Face, _: pso::StencilValue) {
708         panic!(DO_NOT_USE_MESSAGE)
709     }
710 
set_stencil_read_mask(&mut self, _: pso::Face, _: pso::StencilValue)711     unsafe fn set_stencil_read_mask(&mut self, _: pso::Face, _: pso::StencilValue) {
712         panic!(DO_NOT_USE_MESSAGE)
713     }
714 
set_stencil_write_mask(&mut self, _: pso::Face, _: pso::StencilValue)715     unsafe fn set_stencil_write_mask(&mut self, _: pso::Face, _: pso::StencilValue) {
716         panic!(DO_NOT_USE_MESSAGE)
717     }
718 
set_blend_constants(&mut self, _: pso::ColorValue)719     unsafe fn set_blend_constants(&mut self, _: pso::ColorValue) {
720         panic!(DO_NOT_USE_MESSAGE)
721     }
722 
set_depth_bounds(&mut self, _: Range<f32>)723     unsafe fn set_depth_bounds(&mut self, _: Range<f32>) {
724         panic!(DO_NOT_USE_MESSAGE)
725     }
726 
set_line_width(&mut self, _: f32)727     unsafe fn set_line_width(&mut self, _: f32) {
728         panic!(DO_NOT_USE_MESSAGE)
729     }
730 
set_depth_bias(&mut self, _: pso::DepthBias)731     unsafe fn set_depth_bias(&mut self, _: pso::DepthBias) {
732         panic!(DO_NOT_USE_MESSAGE)
733     }
734 
begin_render_pass<T>( &mut self, _: &(), _: &(), _: pso::Rect, _: T, _: command::SubpassContents, ) where T: IntoIterator, T::Item: Borrow<command::ClearValue>,735     unsafe fn begin_render_pass<T>(
736         &mut self,
737         _: &(),
738         _: &(),
739         _: pso::Rect,
740         _: T,
741         _: command::SubpassContents,
742     ) where
743         T: IntoIterator,
744         T::Item: Borrow<command::ClearValue>,
745     {
746         panic!(DO_NOT_USE_MESSAGE)
747     }
748 
next_subpass(&mut self, _: command::SubpassContents)749     unsafe fn next_subpass(&mut self, _: command::SubpassContents) {
750         panic!(DO_NOT_USE_MESSAGE)
751     }
752 
end_render_pass(&mut self)753     unsafe fn end_render_pass(&mut self) {
754         panic!(DO_NOT_USE_MESSAGE)
755     }
756 
bind_graphics_pipeline(&mut self, _: &())757     unsafe fn bind_graphics_pipeline(&mut self, _: &()) {
758         panic!(DO_NOT_USE_MESSAGE)
759     }
760 
bind_graphics_descriptor_sets<I, J>(&mut self, _: &(), _: usize, _: I, _: J) where I: IntoIterator, I::Item: Borrow<()>, J: IntoIterator, J::Item: Borrow<command::DescriptorSetOffset>,761     unsafe fn bind_graphics_descriptor_sets<I, J>(&mut self, _: &(), _: usize, _: I, _: J)
762     where
763         I: IntoIterator,
764         I::Item: Borrow<()>,
765         J: IntoIterator,
766         J::Item: Borrow<command::DescriptorSetOffset>,
767     {
768         panic!(DO_NOT_USE_MESSAGE)
769     }
770 
bind_compute_pipeline(&mut self, _: &())771     unsafe fn bind_compute_pipeline(&mut self, _: &()) {
772         panic!(DO_NOT_USE_MESSAGE)
773     }
774 
bind_compute_descriptor_sets<I, J>(&mut self, _: &(), _: usize, _: I, _: J) where I: IntoIterator, I::Item: Borrow<()>, J: IntoIterator, J::Item: Borrow<command::DescriptorSetOffset>,775     unsafe fn bind_compute_descriptor_sets<I, J>(&mut self, _: &(), _: usize, _: I, _: J)
776     where
777         I: IntoIterator,
778         I::Item: Borrow<()>,
779         J: IntoIterator,
780         J::Item: Borrow<command::DescriptorSetOffset>,
781     {
782         panic!(DO_NOT_USE_MESSAGE)
783     }
784 
dispatch(&mut self, _: hal::WorkGroupCount)785     unsafe fn dispatch(&mut self, _: hal::WorkGroupCount) {
786         panic!(DO_NOT_USE_MESSAGE)
787     }
788 
dispatch_indirect(&mut self, _: &(), _: buffer::Offset)789     unsafe fn dispatch_indirect(&mut self, _: &(), _: buffer::Offset) {
790         panic!(DO_NOT_USE_MESSAGE)
791     }
792 
copy_buffer<T>(&mut self, _: &(), _: &(), _: T) where T: IntoIterator, T::Item: Borrow<command::BufferCopy>,793     unsafe fn copy_buffer<T>(&mut self, _: &(), _: &(), _: T)
794     where
795         T: IntoIterator,
796         T::Item: Borrow<command::BufferCopy>,
797     {
798         panic!(DO_NOT_USE_MESSAGE)
799     }
800 
copy_image<T>(&mut self, _: &(), _: image::Layout, _: &(), _: image::Layout, _: T) where T: IntoIterator, T::Item: Borrow<command::ImageCopy>,801     unsafe fn copy_image<T>(&mut self, _: &(), _: image::Layout, _: &(), _: image::Layout, _: T)
802     where
803         T: IntoIterator,
804         T::Item: Borrow<command::ImageCopy>,
805     {
806         panic!(DO_NOT_USE_MESSAGE)
807     }
808 
copy_buffer_to_image<T>(&mut self, _: &(), _: &(), _: image::Layout, _: T) where T: IntoIterator, T::Item: Borrow<command::BufferImageCopy>,809     unsafe fn copy_buffer_to_image<T>(&mut self, _: &(), _: &(), _: image::Layout, _: T)
810     where
811         T: IntoIterator,
812         T::Item: Borrow<command::BufferImageCopy>,
813     {
814         panic!(DO_NOT_USE_MESSAGE)
815     }
816 
copy_image_to_buffer<T>(&mut self, _: &(), _: image::Layout, _: &(), _: T) where T: IntoIterator, T::Item: Borrow<command::BufferImageCopy>,817     unsafe fn copy_image_to_buffer<T>(&mut self, _: &(), _: image::Layout, _: &(), _: T)
818     where
819         T: IntoIterator,
820         T::Item: Borrow<command::BufferImageCopy>,
821     {
822         panic!(DO_NOT_USE_MESSAGE)
823     }
824 
draw(&mut self, _: Range<hal::VertexCount>, _: Range<hal::InstanceCount>)825     unsafe fn draw(&mut self, _: Range<hal::VertexCount>, _: Range<hal::InstanceCount>) {
826         panic!(DO_NOT_USE_MESSAGE)
827     }
828 
draw_indexed( &mut self, _: Range<hal::IndexCount>, _: hal::VertexOffset, _: Range<hal::InstanceCount>, )829     unsafe fn draw_indexed(
830         &mut self,
831         _: Range<hal::IndexCount>,
832         _: hal::VertexOffset,
833         _: Range<hal::InstanceCount>,
834     ) {
835         panic!(DO_NOT_USE_MESSAGE)
836     }
837 
draw_indirect(&mut self, _: &(), _: buffer::Offset, _: hal::DrawCount, _: u32)838     unsafe fn draw_indirect(&mut self, _: &(), _: buffer::Offset, _: hal::DrawCount, _: u32) {
839         panic!(DO_NOT_USE_MESSAGE)
840     }
841 
draw_indexed_indirect( &mut self, _: &(), _: buffer::Offset, _: hal::DrawCount, _: u32, )842     unsafe fn draw_indexed_indirect(
843         &mut self,
844         _: &(),
845         _: buffer::Offset,
846         _: hal::DrawCount,
847         _: u32,
848     ) {
849         panic!(DO_NOT_USE_MESSAGE)
850     }
851 
set_event(&mut self, _: &(), _: pso::PipelineStage)852     unsafe fn set_event(&mut self, _: &(), _: pso::PipelineStage) {
853         panic!(DO_NOT_USE_MESSAGE)
854     }
855 
reset_event(&mut self, _: &(), _: pso::PipelineStage)856     unsafe fn reset_event(&mut self, _: &(), _: pso::PipelineStage) {
857         panic!(DO_NOT_USE_MESSAGE)
858     }
859 
wait_events<'a, I, J>(&mut self, _: I, _: Range<pso::PipelineStage>, _: J) where I: IntoIterator, I::Item: Borrow<()>, J: IntoIterator, J::Item: Borrow<memory::Barrier<'a, Backend>>,860     unsafe fn wait_events<'a, I, J>(&mut self, _: I, _: Range<pso::PipelineStage>, _: J)
861     where
862         I: IntoIterator,
863         I::Item: Borrow<()>,
864         J: IntoIterator,
865         J::Item: Borrow<memory::Barrier<'a, Backend>>,
866     {
867         panic!(DO_NOT_USE_MESSAGE)
868     }
869 
begin_query(&mut self, _: query::Query<Backend>, _: query::ControlFlags)870     unsafe fn begin_query(&mut self, _: query::Query<Backend>, _: query::ControlFlags) {
871         panic!(DO_NOT_USE_MESSAGE)
872     }
873 
end_query(&mut self, _: query::Query<Backend>)874     unsafe fn end_query(&mut self, _: query::Query<Backend>) {
875         panic!(DO_NOT_USE_MESSAGE)
876     }
877 
reset_query_pool(&mut self, _: &(), _: Range<query::Id>)878     unsafe fn reset_query_pool(&mut self, _: &(), _: Range<query::Id>) {
879         panic!(DO_NOT_USE_MESSAGE)
880     }
881 
copy_query_pool_results( &mut self, _: &(), _: Range<query::Id>, _: &(), _: buffer::Offset, _: buffer::Offset, _: query::ResultFlags, )882     unsafe fn copy_query_pool_results(
883         &mut self,
884         _: &(),
885         _: Range<query::Id>,
886         _: &(),
887         _: buffer::Offset,
888         _: buffer::Offset,
889         _: query::ResultFlags,
890     ) {
891         panic!(DO_NOT_USE_MESSAGE)
892     }
893 
write_timestamp(&mut self, _: pso::PipelineStage, _: query::Query<Backend>)894     unsafe fn write_timestamp(&mut self, _: pso::PipelineStage, _: query::Query<Backend>) {
895         panic!(DO_NOT_USE_MESSAGE)
896     }
897 
push_graphics_constants( &mut self, _: &(), _: pso::ShaderStageFlags, _: u32, _: &[u32], )898     unsafe fn push_graphics_constants(
899         &mut self,
900         _: &(),
901         _: pso::ShaderStageFlags,
902         _: u32,
903         _: &[u32],
904     ) {
905         panic!(DO_NOT_USE_MESSAGE)
906     }
907 
push_compute_constants(&mut self, _: &(), _: u32, _: &[u32])908     unsafe fn push_compute_constants(&mut self, _: &(), _: u32, _: &[u32]) {
909         panic!(DO_NOT_USE_MESSAGE)
910     }
911 
execute_commands<'a, T, I>(&mut self, _: I) where T: 'a + Borrow<CommandBuffer>, I: IntoIterator<Item = &'a T>,912     unsafe fn execute_commands<'a, T, I>(&mut self, _: I)
913     where
914         T: 'a + Borrow<CommandBuffer>,
915         I: IntoIterator<Item = &'a T>,
916     {
917         panic!(DO_NOT_USE_MESSAGE)
918     }
919 
insert_debug_marker(&mut self, _: &str, _: u32)920     unsafe fn insert_debug_marker(&mut self, _: &str, _: u32) {
921         panic!(DO_NOT_USE_MESSAGE)
922     }
begin_debug_marker(&mut self, _: &str, _: u32)923     unsafe fn begin_debug_marker(&mut self, _: &str, _: u32) {
924         panic!(DO_NOT_USE_MESSAGE)
925     }
end_debug_marker(&mut self)926     unsafe fn end_debug_marker(&mut self) {
927         panic!(DO_NOT_USE_MESSAGE)
928     }
929 }
930 
931 // Dummy descriptor pool.
932 #[derive(Debug)]
933 pub struct DescriptorPool;
934 impl pso::DescriptorPool<Backend> for DescriptorPool {
free_sets<I>(&mut self, _descriptor_sets: I) where I: IntoIterator<Item = ()>,935     unsafe fn free_sets<I>(&mut self, _descriptor_sets: I)
936     where
937         I: IntoIterator<Item = ()>,
938     {
939         panic!(DO_NOT_USE_MESSAGE)
940     }
941 
reset(&mut self)942     unsafe fn reset(&mut self) {
943         panic!(DO_NOT_USE_MESSAGE)
944     }
945 }
946 
947 /// Dummy surface.
948 #[derive(Debug)]
949 pub struct Surface;
950 impl window::Surface<Backend> for Surface {
supports_queue_family(&self, _: &QueueFamily) -> bool951     fn supports_queue_family(&self, _: &QueueFamily) -> bool {
952         panic!(DO_NOT_USE_MESSAGE)
953     }
954 
capabilities(&self, _: &PhysicalDevice) -> window::SurfaceCapabilities955     fn capabilities(&self, _: &PhysicalDevice) -> window::SurfaceCapabilities {
956         panic!(DO_NOT_USE_MESSAGE)
957     }
958 
supported_formats(&self, _: &PhysicalDevice) -> Option<Vec<format::Format>>959     fn supported_formats(&self, _: &PhysicalDevice) -> Option<Vec<format::Format>> {
960         panic!(DO_NOT_USE_MESSAGE)
961     }
962 }
963 impl window::PresentationSurface<Backend> for Surface {
964     type SwapchainImage = ();
965 
configure_swapchain( &mut self, _: &Device, _: window::SwapchainConfig, ) -> Result<(), window::CreationError>966     unsafe fn configure_swapchain(
967         &mut self,
968         _: &Device,
969         _: window::SwapchainConfig,
970     ) -> Result<(), window::CreationError> {
971         panic!(DO_NOT_USE_MESSAGE)
972     }
973 
unconfigure_swapchain(&mut self, _: &Device)974     unsafe fn unconfigure_swapchain(&mut self, _: &Device) {
975         panic!(DO_NOT_USE_MESSAGE)
976     }
977 
acquire_image( &mut self, _: u64, ) -> Result<((), Option<window::Suboptimal>), window::AcquireError>978     unsafe fn acquire_image(
979         &mut self,
980         _: u64,
981     ) -> Result<((), Option<window::Suboptimal>), window::AcquireError> {
982         panic!(DO_NOT_USE_MESSAGE)
983     }
984 }
985 
986 /// Dummy swapchain.
987 #[derive(Debug)]
988 pub struct Swapchain;
989 impl window::Swapchain<Backend> for Swapchain {
acquire_image( &mut self, _: u64, _: Option<&()>, _: Option<&()>, ) -> Result<(window::SwapImageIndex, Option<window::Suboptimal>), window::AcquireError>990     unsafe fn acquire_image(
991         &mut self,
992         _: u64,
993         _: Option<&()>,
994         _: Option<&()>,
995     ) -> Result<(window::SwapImageIndex, Option<window::Suboptimal>), window::AcquireError> {
996         panic!(DO_NOT_USE_MESSAGE)
997     }
998 }
999 
1000 #[derive(Debug)]
1001 pub struct Instance;
1002 
1003 impl hal::Instance<Backend> for Instance {
create(_name: &str, _version: u32) -> Result<Self, hal::UnsupportedBackend>1004     fn create(_name: &str, _version: u32) -> Result<Self, hal::UnsupportedBackend> {
1005         Ok(Instance)
1006     }
1007 
enumerate_adapters(&self) -> Vec<adapter::Adapter<Backend>>1008     fn enumerate_adapters(&self) -> Vec<adapter::Adapter<Backend>> {
1009         vec![]
1010     }
1011 
create_surface( &self, _: &impl raw_window_handle::HasRawWindowHandle, ) -> Result<Surface, hal::window::InitError>1012     unsafe fn create_surface(
1013         &self,
1014         _: &impl raw_window_handle::HasRawWindowHandle,
1015     ) -> Result<Surface, hal::window::InitError> {
1016         panic!(DO_NOT_USE_MESSAGE)
1017     }
1018 
destroy_surface(&self, _surface: Surface)1019     unsafe fn destroy_surface(&self, _surface: Surface) {
1020         panic!(DO_NOT_USE_MESSAGE)
1021     }
1022 }
1023