store PipelineSpecialization.dynamic_bindings in HashSet (#936)

This commit is contained in:
Mariusz Kryński 2020-11-28 22:10:18 +01:00 committed by GitHub
parent 097a55948c
commit dbf226be49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize};
pub struct PipelineSpecialization { pub struct PipelineSpecialization {
pub shader_specialization: ShaderSpecialization, pub shader_specialization: ShaderSpecialization,
pub primitive_topology: PrimitiveTopology, pub primitive_topology: PrimitiveTopology,
pub dynamic_bindings: Vec<String>, pub dynamic_bindings: HashSet<String>,
pub index_format: IndexFormat, pub index_format: IndexFormat,
pub vertex_buffer_descriptor: VertexBufferDescriptor, pub vertex_buffer_descriptor: VertexBufferDescriptor,
pub sample_count: u32, pub sample_count: u32,

View File

@ -8,6 +8,7 @@ use crate::{
use bevy_asset::{Assets, Handle}; use bevy_asset::{Assets, Handle};
use bevy_ecs::{Query, Res, ResMut}; use bevy_ecs::{Query, Res, ResMut};
use bevy_reflect::Reflect; use bevy_reflect::Reflect;
use bevy_utils::HashSet;
#[derive(Debug, Default, Clone, Reflect)] #[derive(Debug, Default, Clone, Reflect)]
pub struct RenderPipeline { pub struct RenderPipeline {
@ -110,7 +111,7 @@ pub fn draw_render_pipelines_system(
.bindings .bindings
.iter_dynamic_bindings() .iter_dynamic_bindings()
.map(|name| name.to_string()) .map(|name| name.to_string())
.collect::<Vec<String>>(); .collect::<HashSet<String>>();
pipeline.dynamic_bindings_generation = pipeline.dynamic_bindings_generation =
render_pipelines.bindings.dynamic_bindings_generation(); render_pipelines.bindings.dynamic_bindings_generation();
} }