shaderir: Remove inout params

This commit is contained in:
Hajime Hoshi 2020-06-07 18:57:46 +09:00
parent e64c806698
commit 9a5481459a
3 changed files with 17 additions and 31 deletions

View File

@ -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++

View File

@ -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);
}
}`,
},

View File

@ -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.