diff --git a/go.mod b/go.mod index 7cc48a90..31681445 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( require ( gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2 - gioui.org/shader v0.0.0-20210816161847-c12352edbd45 + gioui.org/shader v0.0.0-20210820085839-484f7c0305de ) diff --git a/go.sum b/go.sum index 595a0c55..26efce91 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7 gioui.org/cpu v0.0.0-20210808092351-bfe733dd3334/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ= gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2 h1:AGDDxsJE1RpcXTAxPG2B4jrwVUJGFDjINIPi1jtO6pc= gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ= -gioui.org/shader v0.0.0-20210816161847-c12352edbd45 h1:tWCgnOK33iYKNvQ4ctNHBknZ6r273Na82wcTOFc29ZM= -gioui.org/shader v0.0.0-20210816161847-c12352edbd45/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM= +gioui.org/shader v0.0.0-20210820085839-484f7c0305de h1:fkcZh0i9T0SzMlqiDm2GBVqXZsbX6bevHcJHfR0llcg= +gioui.org/shader v0.0.0-20210820085839-484f7c0305de/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= diff --git a/gpu/compute.go b/gpu/compute.go index cffc6353..33f9c7c8 100644 --- a/gpu/compute.go +++ b/gpu/compute.go @@ -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)) diff --git a/gpu/gpu.go b/gpu/gpu.go index 318c1a1d..4bdf5347 100644 --- a/gpu/gpu.go +++ b/gpu/gpu.go @@ -135,7 +135,7 @@ type imageOp struct { // shaderModuleVersion is the exact version of gioui.org/shader expected by // this package. Shader programs are not backwards or forwards compatible. -const shaderModuleVersion = "v0.0.0-20210816161847-c12352edbd45" +const shaderModuleVersion = "v0.0.0-20210820085839-484f7c0305de" func decodeStrokeOp(data []byte) clip.StrokeStyle { _ = data[4]