mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Enable downcasting of RenderContext
(#2240)
Related to https://github.com/bevyengine/bevy/discussions/2210. This may make it possible to have external `wgpu` libraries work with `bevy`.
This commit is contained in:
parent
9f94f7eb6c
commit
4b1d47da99
1 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
|||
use downcast_rs::{impl_downcast, Downcast};
|
||||
|
||||
use super::RenderResourceContext;
|
||||
use crate::{
|
||||
pass::{PassDescriptor, RenderPass},
|
||||
|
@ -5,7 +7,7 @@ use crate::{
|
|||
texture::Extent3d,
|
||||
};
|
||||
|
||||
pub trait RenderContext {
|
||||
pub trait RenderContext: Downcast {
|
||||
fn resources(&self) -> &dyn RenderResourceContext;
|
||||
fn resources_mut(&mut self) -> &mut dyn RenderResourceContext;
|
||||
fn copy_buffer_to_buffer(
|
||||
|
@ -56,3 +58,5 @@ pub trait RenderContext {
|
|||
run_pass: &mut dyn FnMut(&mut dyn RenderPass),
|
||||
);
|
||||
}
|
||||
|
||||
impl_downcast!(RenderContext);
|
||||
|
|
Loading…
Reference in a new issue