Przeglądaj źródła

Added sginput and sgoutput qualifiers for hxsl

Clement Espeute 2 lat temu
rodzic
commit
72dfd30108
5 zmienionych plików z 12 dodań i 0 usunięć
  1. 2 0
      hxsl/Ast.hx
  2. 1 0
      hxsl/Checker.hx
  3. 4 0
      hxsl/MacroParser.hx
  4. 2 0
      hxsl/Printer.hx
  5. 3 0
      hxsl/Serializer.hx

+ 2 - 0
hxsl/Ast.hx

@@ -86,6 +86,8 @@ enum VarQualifier {
 	Doc( s : String );
 	Borrow( source : String );
 	Sampler( name : String );
+	SgInput;
+	SgOutput;
 }
 
 enum Prec {

+ 1 - 0
hxsl/Checker.hx

@@ -826,6 +826,7 @@ class Checker {
 					default: error("Sampler should be on sampler type or sampler array", pos);
 					}
 				case Ignore, Doc(_):
+				case SgInput, SgOutput:
 				}
 		}
 		if( tv.type != null )

+ 4 - 0
hxsl/MacroParser.hx

@@ -78,6 +78,10 @@ class MacroParser {
 			v.qualifiers.push(Ignore);
 		case "perInstance":
 			v.qualifiers.push(PerInstance(1));
+		case "sginput":
+			v.qualifiers.push(SgInput);
+		case "sgoutput":
+				v.qualifiers.push(SgOutput);
 		default:
 			error("Unsupported qualifier " + m.name, m.pos);
 		}

+ 2 - 0
hxsl/Printer.hx

@@ -64,6 +64,8 @@ class Printer {
 				case Doc(s): "doc(\"" + StringTools.replace(s, '"', '\\"') + "\")";
 				case Borrow(s): "borrow(" + s + ")";
 				case Sampler(s): "sampler("+ s + ")";
+				case SgInput: "sginput";
+				case SgOutput: "sgoutput";
 				}) + " ");
 		}
 		if( v.kind != defKind )

+ 3 - 0
hxsl/Serializer.hx

@@ -187,6 +187,7 @@ class Serializer {
 				case Doc(s): writeString(s);
 				case Borrow(s): writeString(s);
 				case Sampler(s): writeString(s);
+				case SgInput, SgOutput:
 				}
 			}
 		}
@@ -403,6 +404,8 @@ class Serializer {
 				case 10: Doc(readString());
 				case 11: Borrow(readString());
 				case 12: Sampler(readString());
+				case 13: SgInput;
+				case 14: SgOutput;
 				default: throw "assert";
 				}
 				v.qualifiers.push(q);