working 3d textures
This commit is contained in:
+2
-3
@@ -1,5 +1,4 @@
|
||||
use winit::{window::Window, dpi::PhysicalSize};
|
||||
use wgpu::util::DeviceExt;
|
||||
|
||||
mod buffers; use buffers::{NodeBuffer, UniformBuffer, RasterBuffer, Vertex};
|
||||
pub mod camera; use camera::Camera;
|
||||
@@ -28,7 +27,7 @@ impl Renderer {
|
||||
format: adapter.get_swap_chain_preferred_format(&surface),
|
||||
width: size.width,
|
||||
height: size.height,
|
||||
present_mode: wgpu::PresentMode::Immediate, // Fifo = Vsync
|
||||
present_mode: wgpu::PresentMode::Mailbox, // Fifo = Vsync
|
||||
};
|
||||
let swapchain = device.create_swap_chain(&surface, &swapchain_desc);
|
||||
(swapchain_desc, swapchain)
|
||||
@@ -84,7 +83,7 @@ impl Renderer {
|
||||
pub async fn new(window: &Window) -> Self {
|
||||
|
||||
// Create surface and pick device
|
||||
let instance = wgpu::Instance::new(wgpu::BackendBit::DX11);
|
||||
let instance = wgpu::Instance::new(wgpu::BackendBit::PRIMARY);
|
||||
let surface = unsafe { instance.create_surface(window) };
|
||||
|
||||
// Pick adapter (physical gpu)
|
||||
|
||||
Reference in New Issue
Block a user