tgjones / HlslTools

A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files
http://timjones.io/blog/archive/2016/04/25/hlsl-tools-for-visual-studio-v1.0-released
Other
565 stars 97 forks source link

#247 Implement pragma once directive. #267

Open TIMONz1535 opened 5 months ago

TIMONz1535 commented 5 months ago
objects:
    header.hlsli:
        #pragma once
    object.hlsl:
        #include "header.hlsli" // valid
        #include "header.hlsli" // valid, skip

shading.hlsl:
    #include "objects/header.hlsli" // valid, skip
    #include "objects/object.hlsl" // skip header, but not object
    #include "objects/Header.hlsli" // redefinition, because don't do that
    // dxc bug
    #include "fake/../objects/header.hlsli" // on no, redefinition
    #include "fake/../objects/object.hlsl" // on no, another redefinition of header

If you don't know how to resolve the conflict with VariadicArgument, just put OnceKeyword after WarningKeyword but before VariadicArgument.

изображение