Make sure we translate the new type for wgpu.

This commit is contained in:
John Mitchell 2020-08-13 12:50:13 -04:00
parent 02b1907738
commit c40f39ec7e

View File

@ -5,7 +5,7 @@ use crate::{
use bevy_asset::{Assets, Handle, HandleUntyped};
use bevy_render::{
pipeline::{BindGroupDescriptor, BindGroupDescriptorId, PipelineDescriptor},
pipeline::{BindGroupDescriptor, BindGroupDescriptorId, BindingShaderStage, PipelineDescriptor},
renderer::{
BindGroup, BufferId, BufferInfo, RenderResourceBinding, RenderResourceContext,
RenderResourceId, SamplerId, TextureId,
@ -115,7 +115,13 @@ impl WgpuRenderResourceContext {
.map(|binding| {
wgpu::BindGroupLayoutEntry::new(
binding.index,
wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
match binding.shader_stage {
BindingShaderStage::VERTEX | BindingShaderStage::FRAGMENT => wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
BindingShaderStage::VERTEX => wgpu::ShaderStage::VERTEX,
BindingShaderStage::FRAGMENT => wgpu::ShaderStage::FRAGMENT,
BindingShaderStage::COMPUTE => wgpu::ShaderStage::COMPUTE,
_ => panic!("Invalid binding shader stage."),
},
(&binding.bind_type).wgpu_into(),
)
})