mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/shaderir/hlsl: add function forward declarations
This commit is contained in:
parent
1de1bfef55
commit
d30a31b16c
@ -1,3 +1,5 @@
|
||||
void F0(in float4 l0, out float4 l1);
|
||||
|
||||
void F0(in float4 l0, out float4 l1) {
|
||||
float4 l2 = 0.0;
|
||||
l2 = mul(l0, float4x4FromScalar(1.0));
|
||||
|
2
internal/shader/testdata/out.expected.hlsl
vendored
2
internal/shader/testdata/out.expected.hlsl
vendored
@ -1,3 +1,5 @@
|
||||
void F0(out float l0, out float l1[4], out float4 l2);
|
||||
|
||||
void F0(out float l0, out float l1[4], out float4 l2) {
|
||||
l0 = 0.0;
|
||||
l1[0] = 0.0;
|
||||
|
@ -122,6 +122,9 @@ func Compile(p *shaderir.Program) (string, []int) {
|
||||
|
||||
if len(p.Funcs) > 0 {
|
||||
lines = append(lines, "")
|
||||
for _, f := range p.Funcs {
|
||||
lines = append(lines, c.function(p, &f, true)...)
|
||||
}
|
||||
for _, f := range p.Funcs {
|
||||
if len(lines) > 0 && lines[len(lines)-1] != "" {
|
||||
lines = append(lines, "")
|
||||
|
Loading…
Reference in New Issue
Block a user