Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.

Commit 4a7264f

Browse files
authored
Add support for std140 qualifier (#1153)
Updates the AST builder and adds a class for the qualifier.
1 parent 79aa124 commit 4a7264f

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2021 The GraphicsFuzz Project Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.graphicsfuzz.common.ast.type;
18+
19+
public class Std140LayoutQualifier implements LayoutQualifier {
20+
21+
@Override
22+
public String toString() {
23+
return "std140";
24+
}
25+
26+
}

ast/src/main/java/com/graphicsfuzz/common/ast/visitors/AstBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
import com.graphicsfuzz.common.ast.type.QualifiedType;
7979
import com.graphicsfuzz.common.ast.type.SamplerType;
8080
import com.graphicsfuzz.common.ast.type.SetLayoutQualifier;
81+
import com.graphicsfuzz.common.ast.type.Std140LayoutQualifier;
8182
import com.graphicsfuzz.common.ast.type.Std430LayoutQualifier;
8283
import com.graphicsfuzz.common.ast.type.StructDefinitionType;
8384
import com.graphicsfuzz.common.ast.type.StructNameType;
@@ -1664,6 +1665,8 @@ private LayoutQualifier processLayoutQualifierId(
16641665
switch (layoutQualifierId.IDENTIFIER().getText()) {
16651666
case "std430":
16661667
return new Std430LayoutQualifier();
1668+
case "std140":
1669+
return new Std140LayoutQualifier();
16671670
default:
16681671
return new UnknownLayoutQualifier(layoutQualifierId.getText());
16691672
}

0 commit comments

Comments
 (0)