From 2b825c477157c028550b94d3333253182968141a Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 1 Oct 2023 21:12:54 +0000 Subject: [PATCH] gio: make blit and cover shaders available for FBO rendering Signed-off-by: Elias Naur --- README.md | 4 ++-- gio/blit.vert | 8 +++++++- gio/cover.vert | 8 +++++++- gio/shaders.go | 8 ++++---- gio/zblit.vert.0.dxbc | Bin 1312 -> 1348 bytes gio/zblit.vert.0.glsl100es | 22 ++++++++++++++++------ gio/zblit.vert.0.glsl150 | 22 ++++++++++++++++------ gio/zblit.vert.0.metallibios | Bin 3268 -> 3300 bytes gio/zblit.vert.0.metallibiossimulator | Bin 3726 -> 3758 bytes gio/zblit.vert.0.metallibmacos | Bin 3300 -> 3316 bytes gio/zblit.vert.0.spirv | Bin 1784 -> 2072 bytes gio/zcover.vert.0.glsl100es | 22 ++++++++++++++++------ gio/zcover.vert.0.glsl150 | 22 ++++++++++++++++------ gio/zcover.vert.0.metallibios | Bin 3156 -> 3220 bytes gio/zcover.vert.0.metallibiossimulator | Bin 3598 -> 3662 bytes gio/zcover.vert.0.metallibmacos | Bin 3204 -> 3252 bytes gio/zcover.vert.0.spirv | Bin 1972 -> 2260 bytes 17 files changed, 84 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 4ea4867..67f7456 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # GPU programs for the Gio project -This repository contains the source code for the [Gio](https://gioui.org) -project. It also contains the generators and dereived versions for use with the +This repository contains source code for the [Gio](https://gioui.org) +project. It also contains the generators and derived versions for use with the GPU APIs supported by Gio. # Generating CPU fallbacks diff --git a/gio/blit.vert b/gio/blit.vert index 2009ced..adb5971 100644 --- a/gio/blit.vert +++ b/gio/blit.vert @@ -13,6 +13,8 @@ layout(push_constant) uniform Block { vec4 uvTransformR1; vec4 uvTransformR2; float opacity; + // fbo is set if blitting to a FBO, otherwise the window. + float fbo; } _block; layout(location = 0) in vec2 pos; @@ -24,7 +26,11 @@ layout(location = 1) out float opacity; void main() { vec2 p = pos*_block.transform.xy + _block.transform.zw; - gl_Position = vec4(transform3x2(windowTransform, vec3(p, 0)), 1); + if (_block.fbo != 0.0) { + gl_Position = vec4(transform3x2(fboTransform, vec3(p, 0)), 1); + } else { + gl_Position = vec4(transform3x2(windowTransform, vec3(p, 0)), 1); + } vUV = transform3x2(m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz), vec3(uv,1)).xy; opacity = _block.opacity; } diff --git a/gio/cover.vert b/gio/cover.vert index 02fae50..dddfd05 100644 --- a/gio/cover.vert +++ b/gio/cover.vert @@ -13,6 +13,8 @@ layout(push_constant) uniform Block { vec4 uvCoverTransform; vec4 uvTransformR1; vec4 uvTransformR2; + // fbo is set if blitting to a FBO, otherwise the window. + float fbo; } _block; layout(location = 0) in vec2 pos; @@ -24,7 +26,11 @@ layout(location = 1) out vec2 vUV; void main() { vec2 p = vec2(pos*_block.transform.xy + _block.transform.zw); - gl_Position = vec4(transform3x2(windowTransform, vec3(p, 0)), 1); + if (_block.fbo != 0.0) { + gl_Position = vec4(transform3x2(fboTransform, vec3(p, 0)), 1); + } else { + gl_Position = vec4(transform3x2(windowTransform, vec3(p, 0)), 1); + } vUV = transform3x2(m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz), vec3(uv,1)).xy; vec3 uv3 = vec3(uv, 1.0); vCoverUV = (uv3*vec3(_block.uvCoverTransform.xy, 1.0)+vec3(_block.uvCoverTransform.zw, 0.0)).xy; diff --git a/gio/shaders.go b/gio/shaders.go index 282e4a0..61eb04c 100644 --- a/gio/shaders.go +++ b/gio/shaders.go @@ -79,8 +79,8 @@ var ( Name: "blit.vert", Inputs: []shader.InputLocation{{Name: "pos", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}, {Name: "uv", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 2}}, Uniforms: shader.UniformsReflection{ - Locations: []shader.UniformLocation{{Name: "_block.transform", Type: 0x0, Size: 4, Offset: 0}, {Name: "_block.uvTransformR1", Type: 0x0, Size: 4, Offset: 16}, {Name: "_block.uvTransformR2", Type: 0x0, Size: 4, Offset: 32}, {Name: "_block.opacity", Type: 0x0, Size: 1, Offset: 48}}, - Size: 52, + Locations: []shader.UniformLocation{{Name: "_block.transform", Type: 0x0, Size: 4, Offset: 0}, {Name: "_block.uvTransformR1", Type: 0x0, Size: 4, Offset: 16}, {Name: "_block.uvTransformR2", Type: 0x0, Size: 4, Offset: 32}, {Name: "_block.opacity", Type: 0x0, Size: 1, Offset: 48}, {Name: "_block.fbo", Type: 0x0, Size: 1, Offset: 52}}, + Size: 56, }, } //go:embed zblit.vert.0.spirv @@ -209,8 +209,8 @@ var ( Name: "cover.vert", Inputs: []shader.InputLocation{{Name: "pos", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}, {Name: "uv", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 2}}, Uniforms: shader.UniformsReflection{ - Locations: []shader.UniformLocation{{Name: "_block.transform", Type: 0x0, Size: 4, Offset: 0}, {Name: "_block.uvCoverTransform", Type: 0x0, Size: 4, Offset: 16}, {Name: "_block.uvTransformR1", Type: 0x0, Size: 4, Offset: 32}, {Name: "_block.uvTransformR2", Type: 0x0, Size: 4, Offset: 48}}, - Size: 64, + Locations: []shader.UniformLocation{{Name: "_block.transform", Type: 0x0, Size: 4, Offset: 0}, {Name: "_block.uvCoverTransform", Type: 0x0, Size: 4, Offset: 16}, {Name: "_block.uvTransformR1", Type: 0x0, Size: 4, Offset: 32}, {Name: "_block.uvTransformR2", Type: 0x0, Size: 4, Offset: 48}, {Name: "_block.fbo", Type: 0x0, Size: 1, Offset: 64}}, + Size: 68, }, } //go:embed zcover.vert.0.spirv diff --git a/gio/zblit.vert.0.dxbc b/gio/zblit.vert.0.dxbc index 4bf7b8b5ea0fd437fc1830a119929cac21670aa1..e447446ec281a78818723a4c9ca8fa41d3dd8f39 100644 GIT binary patch delta 242 zcmZ3$b%e{*CBn&h@15zYI*c!_Eczlb$zGeKjFEwX!G)E9felDo0I>#8pofWpfrFWW zp@W5i;mStS>r9LllX;n?S^a@>Hj_6piBEQ67O4knVu%4^2Ox%lD^P|2kOmsU@B+&J z0i;1<=;FLU6BV$CD*?p~fZ{+0fXy)h@V)4$Cnf(=1qRjoH{w4MPqUY%N_s( C1R^8= diff --git a/gio/zblit.vert.0.glsl100es b/gio/zblit.vert.0.glsl100es index 908f4e5..8e9a61e 100644 --- a/gio/zblit.vert.0.glsl100es +++ b/gio/zblit.vert.0.glsl100es @@ -12,6 +12,7 @@ struct Block vec4 uvTransformR1; vec4 uvTransformR2; float opacity; + float fbo; }; uniform Block _block; @@ -29,12 +30,21 @@ vec3 transform3x2(m3x2 t, vec3 v) void main() { vec2 p = (pos * _block.transform.xy) + _block.transform.zw; - m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0)); - vec3 param_1 = vec3(p, 0.0); - gl_Position = vec4(transform3x2(param, param_1), 1.0); - m3x2 param_2 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz); - vec3 param_3 = vec3(uv, 1.0); - vUV = transform3x2(param_2, param_3).xy; + if (_block.fbo != 0.0) + { + m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0)); + vec3 param_1 = vec3(p, 0.0); + gl_Position = vec4(transform3x2(param, param_1), 1.0); + } + else + { + m3x2 param_2 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0)); + vec3 param_3 = vec3(p, 0.0); + gl_Position = vec4(transform3x2(param_2, param_3), 1.0); + } + m3x2 param_4 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz); + vec3 param_5 = vec3(uv, 1.0); + vUV = transform3x2(param_4, param_5).xy; opacity = _block.opacity; } diff --git a/gio/zblit.vert.0.glsl150 b/gio/zblit.vert.0.glsl150 index ffb2070..4d4d33d 100644 --- a/gio/zblit.vert.0.glsl150 +++ b/gio/zblit.vert.0.glsl150 @@ -12,6 +12,7 @@ struct Block vec4 uvTransformR1; vec4 uvTransformR2; float opacity; + float fbo; }; uniform Block _block; @@ -29,12 +30,21 @@ vec3 transform3x2(m3x2 t, vec3 v) void main() { vec2 p = (pos * _block.transform.xy) + _block.transform.zw; - m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0)); - vec3 param_1 = vec3(p, 0.0); - gl_Position = vec4(transform3x2(param, param_1), 1.0); - m3x2 param_2 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz); - vec3 param_3 = vec3(uv, 1.0); - vUV = transform3x2(param_2, param_3).xy; + if (_block.fbo != 0.0) + { + m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0)); + vec3 param_1 = vec3(p, 0.0); + gl_Position = vec4(transform3x2(param, param_1), 1.0); + } + else + { + m3x2 param_2 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0)); + vec3 param_3 = vec3(p, 0.0); + gl_Position = vec4(transform3x2(param_2, param_3), 1.0); + } + m3x2 param_4 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz); + vec3 param_5 = vec3(uv, 1.0); + vUV = transform3x2(param_4, param_5).xy; opacity = _block.opacity; } diff --git a/gio/zblit.vert.0.metallibios b/gio/zblit.vert.0.metallibios index 348facefa60c6a091e0d532f4efb58477f68f9e4..e0c58f5922d6055db6a2f78da55748767dfc80e8 100644 GIT binary patch delta 895 zcmX>i`9xCCH^j$@k%0*aA>heGL3_pr69Y9=cYK_?d4qT2?Lz`_(ut2!G+U({{x?6q zvG@LMrFH3@*>V1EZXpsA7m7{XA`aAW#zpW5Hv_|eAaHU%a8Hqkf#Ka|MaDf$Hk}TA z6PI-esntizI6AfoFf|x;ByhA!D9Sh;=3owBTOhKwvB8qbz=P4;oq?;FqsgF0!QwDS zvvCIlhw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X3cZJc0c- bPqqSkrURqKX5NI!J9xweBUqss14aP=BYZtS diff --git a/gio/zblit.vert.0.metallibiossimulator b/gio/zblit.vert.0.metallibiossimulator index f0edc06afe84a4649558aacf19631a91140bde8c..f5d5d335a4ef084483aee9bf3ee530c69c234582 100644 GIT binary patch delta 913 zcmeB^T_-E(8{*@{$iT$F!T|q1t%B8J zh%mMGsJpqH5Hw1;a)N;;iKE+y{phiYj$2&VjCGD4l;BpWY+hi)G1cU(Kx```P|s#R zj@^vRX-WB$Ik`*)8Cnv6VnATf^ngQ|gWqJbAD2vh(*q4-o>YMu2YC)la%31d8=Nti z;wZV~AP-9*Tj~ThW0s>ljfTzzXA%@THyNDeVSA*(&wMt(rR#`~F;B$=_9}zsNo*lg z+0qj6NsY40IDVYb@G8Ia5KxAbuh^)XVjYD_Ny*hO6)V?>To;I0sF?gI|IOCWxYujXf9%V+^$-z9f z^%*l29L}&XW~p&ZFm`O1$IGahBjM&K>Xmr-!x|^eoCudhAY0TYQPi(dG@wy5DDm(G zt~Cu@KpSuK1bz!tIHlm+;2;+9$o_lL3?I~VkytaNhncXJDon7B}E;udkG0$zx2S3j4K&`?ho0R}Chz&4R-c40f44=TTo z)4wtCtu14~WNk)eM&Zr=jC+`DPCE2WT-G6^Rv#_n=-4X2G{up{S>p)DLjfr_i3THv zr5U^|X9OD@xpr7G1xUCEv?Q_|lysAruGruF6) zySA8b-xDz$V=wsenU~L+sziB?pCi zBxIa8np*31vNmuiv$YE}B|MZrEv0iv2wSl|KB6sZ%F>v-jX Q340!|7~}fMTX}y10CCM8y8r+H diff --git a/gio/zblit.vert.0.metallibmacos b/gio/zblit.vert.0.metallibmacos index 079e24486360b58f2eefd199ce0c46f675528d73..f74230739dd7ac9da2fe14da15b55cdf8923ddb1 100644 GIT binary patch delta 852 zcmaDN`9)IDH^j$@v4M$!i2(w>Ocb#^T#4X}L4QE^gZ*Vg({09Oj=L7c?c^DWzZ&qa7!erCw z&^K{ehmcx*w2Y%;n*dXTQA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vkW6Q7&|fWh@n3Eu==p+ z1$)Mw^<(x~MG<#NIj94DRa!xNS#n~|&H2lemhbZq$6-*f5o$6K`iYSO{$s`4bh zSeC=)zAub>wmuJ}gRu;2Ne3ggp$SpjYYAL@^!+oPT_T;j@f*gUAa#IQ{5R=v@eyzL o_C`8BgvFW6kGG1C-g#Sx5_;#&(F^z1mK;jp^ER=6E5nxL58WP!)c^nh diff --git a/gio/zcover.vert.0.glsl100es b/gio/zcover.vert.0.glsl100es index 423ca60..4e6d142 100644 --- a/gio/zcover.vert.0.glsl100es +++ b/gio/zcover.vert.0.glsl100es @@ -12,6 +12,7 @@ struct Block vec4 uvCoverTransform; vec4 uvTransformR1; vec4 uvTransformR2; + float fbo; }; uniform Block _block; @@ -29,12 +30,21 @@ vec3 transform3x2(m3x2 t, vec3 v) void main() { vec2 p = vec2((pos * _block.transform.xy) + _block.transform.zw); - m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0)); - vec3 param_1 = vec3(p, 0.0); - gl_Position = vec4(transform3x2(param, param_1), 1.0); - m3x2 param_2 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz); - vec3 param_3 = vec3(uv, 1.0); - vUV = transform3x2(param_2, param_3).xy; + if (_block.fbo != 0.0) + { + m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0)); + vec3 param_1 = vec3(p, 0.0); + gl_Position = vec4(transform3x2(param, param_1), 1.0); + } + else + { + m3x2 param_2 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0)); + vec3 param_3 = vec3(p, 0.0); + gl_Position = vec4(transform3x2(param_2, param_3), 1.0); + } + m3x2 param_4 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz); + vec3 param_5 = vec3(uv, 1.0); + vUV = transform3x2(param_4, param_5).xy; vec3 uv3 = vec3(uv, 1.0); vCoverUV = ((uv3 * vec3(_block.uvCoverTransform.xy, 1.0)) + vec3(_block.uvCoverTransform.zw, 0.0)).xy; } diff --git a/gio/zcover.vert.0.glsl150 b/gio/zcover.vert.0.glsl150 index a5005d6..f4a0449 100644 --- a/gio/zcover.vert.0.glsl150 +++ b/gio/zcover.vert.0.glsl150 @@ -12,6 +12,7 @@ struct Block vec4 uvCoverTransform; vec4 uvTransformR1; vec4 uvTransformR2; + float fbo; }; uniform Block _block; @@ -29,12 +30,21 @@ vec3 transform3x2(m3x2 t, vec3 v) void main() { vec2 p = vec2((pos * _block.transform.xy) + _block.transform.zw); - m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0)); - vec3 param_1 = vec3(p, 0.0); - gl_Position = vec4(transform3x2(param, param_1), 1.0); - m3x2 param_2 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz); - vec3 param_3 = vec3(uv, 1.0); - vUV = transform3x2(param_2, param_3).xy; + if (_block.fbo != 0.0) + { + m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0)); + vec3 param_1 = vec3(p, 0.0); + gl_Position = vec4(transform3x2(param, param_1), 1.0); + } + else + { + m3x2 param_2 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0)); + vec3 param_3 = vec3(p, 0.0); + gl_Position = vec4(transform3x2(param_2, param_3), 1.0); + } + m3x2 param_4 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz); + vec3 param_5 = vec3(uv, 1.0); + vUV = transform3x2(param_4, param_5).xy; vec3 uv3 = vec3(uv, 1.0); vCoverUV = ((uv3 * vec3(_block.uvCoverTransform.xy, 1.0)) + vec3(_block.uvCoverTransform.zw, 0.0)).xy; } diff --git a/gio/zcover.vert.0.metallibios b/gio/zcover.vert.0.metallibios index 335704b60a0779d34010a98338c4ba2ed8e9ac15..e833f4faa3aa934a33cc6e1e8c7be0591768397c 100644 GIT binary patch delta 1402 zcmY*ZdrVVT7{8a6%dK4SRvNtRZLk$32tFM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