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
568 stars 98 forks source link

Static function does not see members of enclosing type #66

Closed OndrejPetrzilka closed 7 years ago

OndrejPetrzilka commented 7 years ago
struct PassInterface
{
    float3 BaseColor;
    float Metalness;
    float3 Normal;
    float Roughness;

    static PassInterface Create(float3 color = 0, float3 norm = 0, float rough = 1, float metal = 0)
    {
        PassInterface result;
        result.BaseColor = color; // 'PassInterface' does not have a field 'BaseColor'
        result.Normal = norm; //'PassInterface' does not have a field 'Normal'
        result.Roughness = rough; // here too
        result.Metalness = metal; // here too
        return result;
    }
};

When I only declare function within struct and it's implementation is below, it works fine