From 1fc22efa6797c4a66e87cb5daa95c02af0347cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Espeute?= Date: Mon, 18 May 2026 11:21:38 +0200 Subject: [PATCH] [hxsl] Removed @varying, @function and fixed struct decls in Printer output This ensures the printer output is more correct in regards to actual hxsl syntax --- hxsl/Printer.hx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hxsl/Printer.hx b/hxsl/Printer.hx index 3c166dad45..8f106fc422 100644 --- a/hxsl/Printer.hx +++ b/hxsl/Printer.hx @@ -17,6 +17,8 @@ class Printer { public function shaderString( s : ShaderData ) { buffer = new StringBuf(); for( v in s.vars ) { + if(v.kind == Function) + continue; addVar(v, null); add(";\n"); } @@ -76,7 +78,7 @@ class Printer { case Global: add("@global "); case Var: - add("@varying "); + add("@var "); case Param: add("@param "); case Input: @@ -86,19 +88,20 @@ class Printer { case Output: add("@output "); } - add("var "); - if( v.parent == parent ) + if( parent != null && v.parent == parent ) add(v.name + (varId?"@" + v.id:"")); - else + else { + add("var "); addVarName(v); + } add(" : "); switch( v.type ) { case TStruct(vl): add("{"); var first = true; - for( v in vl ) { + for( childV in vl ) { if( first ) first = false else add(", "); - addVar(v,v.kind,tabs,v); + addVar(childV,v.kind,tabs,v); } add("}"); default: