diff --git a/internal/shaderir/glsl.go b/internal/shaderir/glsl.go index a245e707c..8a0886b8a 100644 --- a/internal/shaderir/glsl.go +++ b/internal/shaderir/glsl.go @@ -203,10 +203,6 @@ func (p *Program) glslFunc(f *Func) []string { args = append(args, "in "+p.glslVarDecl(&t, fmt.Sprintf("l%d", idx))) idx++ } - for _, t := range f.InOutParams { - args = append(args, "inout "+p.glslVarDecl(&t, fmt.Sprintf("l%d", idx))) - idx++ - } for _, t := range f.OutParams { args = append(args, "out "+p.glslVarDecl(&t, fmt.Sprintf("l%d", idx))) idx++ diff --git a/internal/shaderir/ir_test.go b/internal/shaderir/ir_test.go index 5b9c4d512..67d27b260 100644 --- a/internal/shaderir/ir_test.go +++ b/internal/shaderir/ir_test.go @@ -233,18 +233,15 @@ varying vec3 V0;`, {Main: Vec2}, {Main: Vec4}, }, - InOutParams: []Type{ - {Main: Mat2}, - }, OutParams: []Type{ {Main: Mat4}, }, }, }, }, - GlslVS: `void F0(in float l0, in vec2 l1, in vec4 l2, inout mat2 l3, out mat4 l4) { + GlslVS: `void F0(in float l0, in vec2 l1, in vec4 l2, out mat4 l3) { }`, - GlslFS: `void F0(in float l0, in vec2 l1, in vec4 l2, inout mat2 l3, out mat4 l4) { + GlslFS: `void F0(in float l0, in vec2 l1, in vec4 l2, out mat4 l3) { }`, }, { @@ -282,9 +279,6 @@ varying vec3 V0;`, InParams: []Type{ {Main: Float}, }, - InOutParams: []Type{ - {Main: Float}, - }, OutParams: []Type{ {Main: Float}, }, @@ -295,13 +289,13 @@ varying vec3 V0;`, }, }, }, - GlslVS: `void F0(in float l0, inout float l1, out float l2) { + GlslVS: `void F0(in float l0, out float l1) { + mat4 l2 = mat4(0.0); mat4 l3 = mat4(0.0); - mat4 l4 = mat4(0.0); }`, - GlslFS: `void F0(in float l0, inout float l1, out float l2) { + GlslFS: `void F0(in float l0, out float l1) { + mat4 l2 = mat4(0.0); mat4 l3 = mat4(0.0); - mat4 l4 = mat4(0.0); }`, }, { @@ -313,9 +307,6 @@ varying vec3 V0;`, InParams: []Type{ {Main: Float}, }, - InOutParams: []Type{ - {Main: Float}, - }, OutParams: []Type{ {Main: Float}, }, @@ -336,20 +327,20 @@ varying vec3 V0;`, }, }, }, - GlslVS: `void F0(in float l0, inout float l1, out float l2) { + GlslVS: `void F0(in float l0, out float l1) { + mat4 l2 = mat4(0.0); mat4 l3 = mat4(0.0); - mat4 l4 = mat4(0.0); { + mat4 l4 = mat4(0.0); mat4 l5 = mat4(0.0); - mat4 l6 = mat4(0.0); } }`, - GlslFS: `void F0(in float l0, inout float l1, out float l2) { + GlslFS: `void F0(in float l0, out float l1) { + mat4 l2 = mat4(0.0); mat4 l3 = mat4(0.0); - mat4 l4 = mat4(0.0); { + mat4 l4 = mat4(0.0); mat4 l5 = mat4(0.0); - mat4 l6 = mat4(0.0); } }`, }, diff --git a/internal/shaderir/program.go b/internal/shaderir/program.go index 376fe359c..8613ffe5e 100644 --- a/internal/shaderir/program.go +++ b/internal/shaderir/program.go @@ -28,12 +28,11 @@ type Program struct { } type Func struct { - Index int - InParams []Type - InOutParams []Type - OutParams []Type - Return Type - Block Block + Index int + InParams []Type + OutParams []Type + Return Type + Block Block } // VertexFunc takes pseudo params, and the number if len(attributes) + len(varyings) + 1.