internal/shaderir: trim space before calc hash

This commit is contained in:
Hajime Hoshi 2024-12-08 22:39:26 +09:00
parent 7d3007a43e
commit a5c221451a

View File

@ -16,6 +16,7 @@
package shaderir
import (
"bytes"
"encoding/hex"
"go/constant"
"go/token"
@ -35,7 +36,7 @@ type SourceHash [16]byte
func CalcSourceHash(source []byte) SourceHash {
h := fnv.New128a()
_, _ = h.Write(source)
_, _ = h.Write(bytes.TrimSpace(source))
var hash SourceHash
h.Sum(hash[:0])