From 6f60c1ca5c9fa0966204589e2d1df2f1c9e228f8 Mon Sep 17 00:00:00 2001 From: Capucho Date: Sun, 6 Dec 2020 16:00:53 +0000 Subject: [PATCH] Pass format to particle pipeline --- voxygen/src/render/pipelines/particle.rs | 4 ++-- voxygen/src/render/renderer.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/voxygen/src/render/pipelines/particle.rs b/voxygen/src/render/pipelines/particle.rs index a307d63226..b0d20464ce 100644 --- a/voxygen/src/render/pipelines/particle.rs +++ b/voxygen/src/render/pipelines/particle.rs @@ -171,6 +171,7 @@ impl ParticlePipeline { device: &wgpu::Device, vs_module: &wgpu::ShaderModule, fs_module: &wgpu::ShaderModule, + sc_desc: &wgpu::SwapChainDescriptor, global_layout: &GlobalsLayouts, aa_mode: AaMode, ) -> Self { @@ -212,8 +213,7 @@ impl ParticlePipeline { }), primitive_topology: wgpu::PrimitiveTopology::TriangleList, color_states: &[wgpu::ColorStateDescriptor { - // TODO pass this format in or make it a const - format: wgpu::TextureFormat::Rgba8UnormSrgb, + format: sc_desc.format, color_blend: wgpu::BlendDescriptor { src_factor: wgpu::BlendFactor::SrcAlpha, dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha, diff --git a/voxygen/src/render/renderer.rs b/voxygen/src/render/renderer.rs index f314e34c4a..d71cad9ca4 100644 --- a/voxygen/src/render/renderer.rs +++ b/voxygen/src/render/renderer.rs @@ -2128,6 +2128,7 @@ fn create_pipelines( device, &create_shader("particle-vert", ShaderKind::Vertex)?, &create_shader("particle-frag", ShaderKind::Fragment)?, + sc_desc, &layouts.global, mode.aa, );