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/modifier-defs.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/modifier-defs.h') diff --git a/source/slang/modifier-defs.h b/source/slang/modifier-defs.h index fdbb05748..baa08a160 100644 --- a/source/slang/modifier-defs.h +++ b/source/slang/modifier-defs.h @@ -258,6 +258,9 @@ END_SYNTAX_CLASS() // HLSL `nointerpolation` modifier SIMPLE_SYNTAX_CLASS(HLSLNoInterpolationModifier, InterpolationModeModifier) +// HLSL `noperspective` modifier +SIMPLE_SYNTAX_CLASS(HLSLNoPerspectiveModifier, InterpolationModeModifier) + // HLSL `linear` modifier SIMPLE_SYNTAX_CLASS(HLSLLinearModifier, InterpolationModeModifier) -- cgit v1.2.3