working 3d textures

This commit is contained in:
Piotrek
2021-04-18 12:00:28 +02:00
parent 4f24394273
commit 20ac933cc3
6 changed files with 42 additions and 24 deletions
+2 -3
View File
@@ -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)