internal/shaderir: add comments

This commit is contained in:
Hajime Hoshi 2022-12-03 15:37:14 +09:00
parent 6a0eb82207
commit 724516a0e0

View File

@ -460,6 +460,8 @@ func (p *Program) reachableUniformVariablesFromBlock(block *Block) []int {
return is return is
} }
// FilterUniformVariables replaces uniform variables with nil when they are not used.
// By minimizing uniform variables, more commands can be merged in the graphicscommand package.
func (p *Program) FilterUniformVariables(uniforms [][]uint32) { func (p *Program) FilterUniformVariables(uniforms [][]uint32) {
if p.reachableUniforms == nil { if p.reachableUniforms == nil {
p.reachableUniforms = make([]bool, len(p.Uniforms)) p.reachableUniforms = make([]bool, len(p.Uniforms))