From 7a8ed51873743e6497db28b5a756e080491d2fa3 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 4 Apr 2018 07:18:33 -0700 Subject: Pass AST interpolation modifiers through to codegen. (#475) This is a short-term fix, because we (1) don't have an IR-level representation of interpolation qualifiers, and (2) can't introduce one until *after* the IR-level type system is introduced (to be able to handle `struct` fields). The approach here is to find the AST-level declaration, either from layout information (in the case of an ordinary variable or function parameter), or from struct field information (because structs are being output from the AST form anyway). I've included a single end-to-end rendering test to confirm that we handle the `nointerpolation` modifier the same as HLSL. I also added the `noperspective` modifier, which seemed to be missing from our implementation. --- source/slang/parser.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source/slang/parser.cpp') diff --git a/source/slang/parser.cpp b/source/slang/parser.cpp index a3afbe87a..ea8e567b4 100644 --- a/source/slang/parser.cpp +++ b/source/slang/parser.cpp @@ -4358,6 +4358,7 @@ namespace Slang MODIFIER(column_major, HLSLColumnMajorLayoutModifier); MODIFIER(nointerpolation, HLSLNoInterpolationModifier); + MODIFIER(noperspective, HLSLNoPerspectiveModifier); MODIFIER(linear, HLSLLinearModifier); MODIFIER(sample, HLSLSampleModifier); MODIFIER(centroid, HLSLCentroidModifier); -- cgit v1.2.3