File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/ImageSharp.Drawing.WebGPU.ShaderGen Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -393,18 +393,20 @@ private static string ToPropertyName(string path)
393393 return builder . ToString ( ) ;
394394 }
395395
396- // AdditionalFiles come through as full paths. The generated API is keyed by the relative
397- // path beneath the raw WGSL source tree so imports remain stable across machines.
396+ // AdditionalFiles come through as full paths with the platform's native separators.
397+ // Normalize first so Linux/macOS and Windows builds all resolve the same shader-relative
398+ // path beneath Shaders/WgslSource.
398399 private static string ? GetRelativeShaderPath ( string path )
399400 {
400- const string marker = "\\ Shaders\\ WgslSource\\ " ;
401- int index = path . LastIndexOf ( marker , StringComparison . OrdinalIgnoreCase ) ;
401+ string normalizedPath = NormalizePath ( path ) ;
402+ const string marker = "/Shaders/WgslSource/" ;
403+ int index = normalizedPath . LastIndexOf ( marker , StringComparison . OrdinalIgnoreCase ) ;
402404 if ( index < 0 )
403405 {
404406 return null ;
405407 }
406408
407- return NormalizePath ( path . Substring ( index + marker . Length ) ) ;
409+ return normalizedPath . Substring ( index + marker . Length ) ;
408410 }
409411
410412 private static string NormalizePath ( string path )
You can’t perform that action at this time.
0 commit comments