DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Internal llvm::cast<X> due to particular combination of class fields and methods

Open siliconvoodoo opened this issue 3 years ago • 0 comments

(reduced to minimum crashing example) code:

struct PSInput
{
};

class SurfaceData_BasePBR
{
    float3 albedo;
};

interface ISpecRough
{
    void ApplySpecularAA();
};

class SurfaceData_NewPBR : SurfaceData_BasePBR, ISpecRough
{
    float3 emissiveLighting;

    void ApplySpecularAA()
    {
    } 
};

float4 PSMain( PSInput input ) : SV_TARGET
{
    SurfaceData_NewPBR obj ;
    obj . albedo . x = 1 ;
    return float4 ( obj . albedo , 1 ) ;
} 

Example command line:

-T ps_6_5 -E PSMain -HV 2021

Effect:

Internal Compiler error: llvm::cast<X>() argument of incompatible type!

siliconvoodoo avatar Aug 31 '22 09:08 siliconvoodoo