gpu: update gioui.org/shader for portable materials.vert shader

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-08-20 10:47:44 +02:00
parent 04cc616e1f
commit 13b93b27d8
4 changed files with 8 additions and 7 deletions
+4 -3
View File
@@ -893,9 +893,10 @@ restart:
m.cpuTex = cpu.NewImageRGBA(texSize, texSize)
}
}
// Transform to clip space: [-1, -1] - [1, 1].
g.materials.vert.uniforms.scale = [2]float32{2 / float32(texSize), 2 / float32(texSize)}
g.materials.vert.uniforms.pos = [2]float32{-1, -1}
// Transform to clip space: [-1, -1] - [1, 1] and flip Y-axis to cancel the implied transformation
// between framebuffer and texture space.
g.materials.vert.uniforms.scale = [2]float32{2 / float32(texSize), -2 / float32(texSize)}
g.materials.vert.uniforms.pos = [2]float32{-1, +1}
g.materials.vert.buf.Upload(byteslice.Struct(g.materials.vert.uniforms))
vertexData := byteslice.Slice(m.quads)
n := pow2Ceil(len(vertexData))