2020-04-12 01:40:30 +00:00
|
|
|
use super::RenderResourceContext;
|
2020-04-12 21:47:41 +00:00
|
|
|
use crate::{
|
2020-04-13 20:04:31 +00:00
|
|
|
pass::{PassDescriptor, RenderPass},
|
2020-07-17 01:26:21 +00:00
|
|
|
renderer::{BufferId, RenderResourceBindings, TextureId},
|
2020-06-14 18:41:42 +00:00
|
|
|
texture::Extent3d,
|
2020-04-12 21:47:41 +00:00
|
|
|
};
|
2020-04-09 22:03:54 +00:00
|
|
|
|
|
|
|
pub trait RenderContext {
|
2020-04-12 01:40:30 +00:00
|
|
|
fn resources(&self) -> &dyn RenderResourceContext;
|
|
|
|
fn resources_mut(&mut self) -> &mut dyn RenderResourceContext;
|
2020-04-09 22:03:54 +00:00
|
|
|
fn copy_buffer_to_buffer(
|
|
|
|
&mut self,
|
2020-06-14 18:41:42 +00:00
|
|
|
source_buffer: BufferId,
|
2020-04-09 22:03:54 +00:00
|
|
|
source_offset: u64,
|
2020-06-14 18:41:42 +00:00
|
|
|
destination_buffer: BufferId,
|
2020-04-09 22:03:54 +00:00
|
|
|
destination_offset: u64,
|
|
|
|
size: u64,
|
|
|
|
);
|
2020-08-16 07:30:04 +00:00
|
|
|
#[allow(clippy::too_many_arguments)]
|
2020-04-24 19:48:12 +00:00
|
|
|
fn copy_buffer_to_texture(
|
|
|
|
&mut self,
|
2020-06-14 18:41:42 +00:00
|
|
|
source_buffer: BufferId,
|
2020-04-24 19:48:12 +00:00
|
|
|
source_offset: u64,
|
|
|
|
source_bytes_per_row: u32,
|
2020-06-14 18:41:42 +00:00
|
|
|
destination_texture: TextureId,
|
2020-04-24 19:48:12 +00:00
|
|
|
destination_origin: [u32; 3],
|
|
|
|
destination_mip_level: u32,
|
|
|
|
size: Extent3d,
|
|
|
|
);
|
2020-04-13 20:04:31 +00:00
|
|
|
fn begin_pass(
|
|
|
|
&mut self,
|
|
|
|
pass_descriptor: &PassDescriptor,
|
2020-06-14 19:02:19 +00:00
|
|
|
render_resource_bindings: &RenderResourceBindings,
|
2020-04-15 22:55:00 +00:00
|
|
|
run_pass: &mut dyn Fn(&mut dyn RenderPass),
|
2020-04-13 20:04:31 +00:00
|
|
|
);
|
2020-04-09 22:03:54 +00:00
|
|
|
}
|