File tree Expand file tree Collapse file tree
sources/engine/Stride.Graphics/Effects Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33using System ;
44using System . Collections . Generic ;
55using System . Linq ;
6+ using System . Runtime . InteropServices ;
67using Stride . Core ;
78using Stride . Core . Mathematics ;
89using Stride . Core . Serialization ;
910using Stride . Core . Serialization . Contents ;
1011using Stride . Core . Storage ;
1112using Stride . Rendering ;
1213using Stride . Shaders ;
13- using Stride . Shaders . Compiler ;
1414
1515namespace Stride . Graphics
1616{
@@ -104,12 +104,14 @@ private void Initialize()
104104
105105 private static void PrepareReflection ( EffectReflection reflection )
106106 {
107+ var resourceBindingsSpan = CollectionsMarshal . AsSpan ( reflection . ResourceBindings ) ;
108+
107109 // prepare resource bindings used internally
108110 for ( int i = 0 ; i < reflection . ResourceBindings . Count ; i ++ )
109111 {
110112 // it is fine if multiple threads do this at the same time (same result)
111113 // we use ref to avoid reassigning to the list (which cause a Collection modified during enumeration exception)
112- UpdateResourceBindingKey ( ref reflection . ResourceBindings . Items [ i ] ) ;
114+ UpdateResourceBindingKey ( ref resourceBindingsSpan [ i ] ) ;
113115 }
114116 foreach ( var constantBuffer in reflection . ConstantBuffers )
115117 {
You can’t perform that action at this time.
0 commit comments