-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot pass items implementing blade_graphics::traits to blade_egui #249
Comments
Could you provide a piece of problematic code, to better understand the problem? |
Sorry, coded away on other parts for some days! The core faulty design decision I made was I had assumed I could have a utility function return a We have a blit-utility function and when blitting the final off-screen buffer to the frameview with postprocessing, we can do the GUI in the same renderpass. So, the function returns the let options = BlitOptions {
name: "blit with postprocess + gui",
from_view: state.render_buffers.resolved_color_view(),
from_format: state.render_buffers.settings.formats.color,
from_sample_count: 1,
to_view: frame_view,
to_format: surface_info.format,
postprocess: true,
..Default::default()
};
if let (Some(mut rp), None) = blit_with_options(&state.context, encoder, options, &mut state.pipelines, &mut state.samplers) {
state.gui_painter.paint(
&mut rp,
&egui_tesselation_result,
&state.screen_desc,
&state.context,
);
}
|
Ok, so it sounds like there is no blocker/issue today. We can leave this issue open as a suggestion to expose |
in blade_egui, the
paint
function expects apass: &mut blade_graphics::RenderCommandEncoder
since it needs to internally call.with
.I am in some parts of my code using the
blade_grahpics::traits
which can have aRenderEncoder
andRenderPipelineEncoder
. However, due to thewith
function not being part of the traits (or blade's common api), it is impossible to use the egui renderer with those since it is impossible to refactor the paint function's signature to instead take in a trait since everything isn't covered.I still think the
.with
function and its return type should be standardized. Let it always specify both pipeline's and the encoder's lifetime as is required in the vulkan implementation, and other implementations can use phantom data for the lifetimes.The text was updated successfully, but these errors were encountered: