bevy/crates/bevy_render/src/renderer/render_context.rs

36 lines
1 KiB
Rust
Raw Normal View History

use super::RenderResourceContext;
use crate::{
2020-04-13 20:04:31 +00:00
pass::{PassDescriptor, RenderPass},
render_resource::{RenderResourceId, RenderResourceAssignments},
texture::{Extent3d},
};
pub trait RenderContext {
fn resources(&self) -> &dyn RenderResourceContext;
fn resources_mut(&mut self) -> &mut dyn RenderResourceContext;
fn copy_buffer_to_buffer(
&mut self,
source_buffer: RenderResourceId,
source_offset: u64,
destination_buffer: RenderResourceId,
destination_offset: u64,
size: u64,
);
fn copy_buffer_to_texture(
&mut self,
source_buffer: RenderResourceId,
source_offset: u64,
source_bytes_per_row: u32,
destination_texture: RenderResourceId,
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,
render_resource_assignments: &RenderResourceAssignments,
2020-04-15 22:55:00 +00:00
run_pass: &mut dyn Fn(&mut dyn RenderPass),
2020-04-13 20:04:31 +00:00
);
}