From a5c221451a36826c67343ce5496f128b334872a1 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 8 Dec 2024 22:39:26 +0900 Subject: [PATCH] internal/shaderir: trim space before calc hash --- internal/shaderir/program.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/shaderir/program.go b/internal/shaderir/program.go index 10f2968ad..88202c044 100644 --- a/internal/shaderir/program.go +++ b/internal/shaderir/program.go @@ -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])