Set renderer multisample and depth-stencil state
This commit is contained in:
parent
da4bb4af5c
commit
74e9aa37a1
3 changed files with 80 additions and 43 deletions
|
@ -4,9 +4,9 @@ use glyphon::{
|
|||
};
|
||||
use wgpu::{
|
||||
Backends, CommandEncoderDescriptor, CompositeAlphaMode, DeviceDescriptor, Features, Instance,
|
||||
Limits, LoadOp, Operations, PresentMode, RenderPassColorAttachment, RenderPassDescriptor,
|
||||
RequestAdapterOptions, SurfaceConfiguration, TextureFormat, TextureUsages,
|
||||
TextureViewDescriptor,
|
||||
Limits, LoadOp, MultisampleState, Operations, PresentMode, RenderPassColorAttachment,
|
||||
RenderPassDescriptor, RequestAdapterOptions, SurfaceConfiguration, TextureFormat,
|
||||
TextureUsages, TextureViewDescriptor,
|
||||
};
|
||||
use winit::{
|
||||
dpi::LogicalSize,
|
||||
|
@ -64,12 +64,13 @@ async fn run() {
|
|||
surface.configure(&device, &config);
|
||||
|
||||
// Set up text renderer
|
||||
let mut text_renderer = TextRenderer::new(&device, &queue);
|
||||
unsafe {
|
||||
FONT_SYSTEM = Some(FontSystem::new());
|
||||
}
|
||||
let mut cache = SwashCache::new(unsafe { FONT_SYSTEM.as_ref().unwrap() });
|
||||
let mut atlas = TextAtlas::new(&device, &queue, swapchain_format);
|
||||
let mut text_renderer =
|
||||
TextRenderer::new(&mut atlas, &device, MultisampleState::default(), None);
|
||||
let mut buffer = Buffer::new(
|
||||
unsafe { FONT_SYSTEM.as_ref().unwrap() },
|
||||
Metrics::new(30, 42),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue