1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

eframe: rename render_state to wgpu_render_state for added clarity

This commit is contained in:
Emil Ernerfeldt
2022-08-08 12:15:31 +02:00
parent 66c601f775
commit 9e41fa021a
6 changed files with 37 additions and 23 deletions

View File

@@ -13,9 +13,9 @@ impl Custom3d {
pub fn new<'a>(cc: &'a eframe::CreationContext<'a>) -> Self {
// Get the WGPU render state from the eframe creation context. This can also be retrieved
// from `eframe::Frame` when you don't have a `CreationContext` available.
let render_state = cc.render_state.as_ref().expect("WGPU enabled");
let wgpu_render_state = cc.wgpu_render_state.as_ref().expect("WGPU enabled");
let device = &render_state.device;
let device = &wgpu_render_state.device;
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: None,
@@ -53,7 +53,7 @@ impl Custom3d {
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
targets: &[Some(render_state.target_format.into())],
targets: &[Some(wgpu_render_state.target_format.into())],
}),
primitive: wgpu::PrimitiveState::default(),
depth_stencil: None,
@@ -81,7 +81,7 @@ impl Custom3d {
// Because the graphics pipeline must have the same lifetime as the egui render pass,
// instead of storing the pipeline in our `Custom3D` struct, we insert it into the
// `paint_callback_resources` type map, which is stored alongside the render pass.
render_state
wgpu_render_state
.egui_rpass
.write()
.paint_callback_resources