2020-04-12 01:40:30 +00:00
|
|
|
use crate::{render_resource::RenderResource, texture::TextureDescriptor};
|
|
|
|
use super::RenderResourceContext;
|
2020-04-09 22:03:54 +00:00
|
|
|
|
|
|
|
pub trait RenderContext {
|
|
|
|
// fn setup_render_pipeline(
|
|
|
|
// &mut self,
|
|
|
|
// pipeline_handle: Handle<PipelineDescriptor>,
|
|
|
|
// pipeline_descriptor: &mut PipelineDescriptor,
|
|
|
|
// shader_storage: &AssetStorage<Shader>,
|
|
|
|
// );
|
|
|
|
// fn setup_bind_groups(
|
|
|
|
// &mut self,
|
|
|
|
// render_resource_assignments: &mut RenderResourceAssignments,
|
|
|
|
// pipeline_descriptor: &PipelineDescriptor,
|
|
|
|
// );
|
|
|
|
|
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 create_texture_with_data(
|
|
|
|
&mut self,
|
|
|
|
texture_descriptor: &TextureDescriptor,
|
2020-04-10 08:39:38 +00:00
|
|
|
bytes: &[u8],
|
2020-04-09 22:03:54 +00:00
|
|
|
) -> RenderResource;
|
|
|
|
fn copy_buffer_to_buffer(
|
|
|
|
&mut self,
|
|
|
|
source_buffer: RenderResource,
|
|
|
|
source_offset: u64,
|
|
|
|
destination_buffer: RenderResource,
|
|
|
|
destination_offset: u64,
|
|
|
|
size: u64,
|
|
|
|
);
|
|
|
|
// fn copy_buffer_to_texture(
|
|
|
|
// &mut self,
|
|
|
|
// source_buffer: RenderResource,
|
|
|
|
// source_offset: u64,
|
|
|
|
// destination_buffer: RenderResource,
|
|
|
|
// destination_offset: u64,
|
|
|
|
// size: u64,
|
|
|
|
// );
|
|
|
|
}
|