Skip to content

Commit

Permalink
internal/shaderir: trim space before calc hash
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Dec 8, 2024
1 parent 7d3007a commit a5c2214
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/shaderir/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package shaderir

import (
"bytes"
"encoding/hex"
"go/constant"
"go/token"
Expand All @@ -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])
Expand Down

0 comments on commit a5c2214

Please sign in to comment.