shader: Do not sort variables since the order matters

This commit is contained in:
Hajime Hoshi 2020-05-10 01:21:34 +09:00
parent eaf93a532f
commit 1a7da0bc63

View File

@ -121,9 +121,6 @@ func (sh *Shader) parse(f *ast.File) {
} }
// TODO: This is duplicated with parseBlock. // TODO: This is duplicated with parseBlock.
sort.Slice(sh.global.vars, func(a, b int) bool {
return sh.global.vars[a].name < sh.global.vars[b].name
})
sort.Slice(sh.global.consts, func(a, b int) bool { sort.Slice(sh.global.consts, func(a, b int) bool {
return sh.global.consts[a].name < sh.global.consts[b].name return sh.global.consts[a].name < sh.global.consts[b].name
}) })
@ -372,9 +369,6 @@ func (sh *Shader) parseBlock(b *ast.BlockStmt) *block {
} }
} }
sort.Slice(block.vars, func(a, b int) bool {
return block.vars[a].name < block.vars[b].name
})
sort.Slice(block.consts, func(a, b int) bool { sort.Slice(block.consts, func(a, b int) bool {
return block.consts[a].name < block.consts[b].name return block.consts[a].name < block.consts[b].name
}) })